OMAPDSS: Use PM notifiers for system suspend

The current way how omapdss handles system suspend and resume is that
omapdss device (a platform device, which is not part of the device
hierarchy of the DSS HW devices, like DISPC and DSI, or panels.) uses
the suspend and resume callbacks from platform_driver to handle system
suspend. It does this by disabling all enabled panels on suspend, and
resuming the previously disabled panels on resume.

This presents a few problems.

One is that as omapdss device is not related to the panel devices or the
DSS HW devices, there's no ordering in the suspend process. This means
that suspend could be first ran for DSS HW devices and panels, and only
then for omapdss device. Currently this is not a problem, as DSS HW
devices and panels do not handle suspend.

Another, more pressing problem, is that when suspending or resuming, the
runtime PM functions return -EACCES as runtime PM is disabled during
system suspend. This causes the driver to print warnings, and operations
to fail as they think that they failed to bring up the HW.

This patch changes the omapdss suspend handling to use PM notifiers,
which are called before suspend and after resume. This way we have a
normally functioning system when we are suspending and resuming the
panels.

This patch, I believe, creates a problem that somebody could enable or
disable a panel between PM_SUSPEND_PREPARE and the system suspend, and
similarly the other way around in resume. I choose to ignore the problem
for now, as it sounds rather unlikely, and if it happens, it's not
fatal.

In the long run the system suspend handling of omapdss and panels should
be thought out properly. The current approach feels rather hacky.
Perhaps the panel drivers should handle system suspend, or the users of
omapdss (omapfb, omapdrm) should handle system suspend.

Note that after this patch we could probably revert
0eaf9f52e94f756147dbfe1faf1f77a02378dbf9 (OMAPDSS: use sync versions of
pm_runtime_put). But as I said, this patch may be temporary, so let's
leave the sync version still in place.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reported-by: Jassi Brar <jaswinder.singh@linaro.org>
Tested-by: Jassi Brar <jaswinder.singh@linaro.org>
Tested-by: Joe Woodward <jw@terrafix.co.uk>
Signed-off-by: Archit Taneja <archit@ti.com>
[fts: fixed 2 brace coding style issues]
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Revert "OMAP2: DSS: Check if RPM enabled before trying to change state"

This reverts commit 3f00f4f9b6c411357b2eafbbe7b355c7cd4606bd.
OMAPDSS: fix warnings if CONFIG_PM_RUNTIME=n

If runtime PM is not enabled in the kernel config, pm_runtime_get_sync()
will always return 1 and pm_runtime_put_sync() will always return
-ENOSYS. pm_runtime_get_sync() returning 1 presents no problem to the
driver, but -ENOSYS from pm_runtime_put_sync() causes the driver to
print a warning.

One option would be to ignore errors returned by pm_runtime_put_sync()
totally, as they only say that the call was unable to put the hardware
into suspend mode.

However, I chose to ignore the returned -ENOSYS explicitly, and print a
warning for other errors, as I think we should get notified if the HW
failed to go to suspend properly.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Revert "OMAPDSS: HDMI: Add sysfs support to configure quantization range in HDMI"

This reverts commit 3acc448bcdbe439a05a3e52608933b65d06042c2.

Conflicts:

	drivers/video/omap2/dss/dss_features.c
	drivers/video/omap2/dss/ti_hdmi.h
Revert "OMAPDSS: HDMI: Add support for h/w configuration of quantization range"

This reverts commit 14702064fbbd39e2697f3a20568975bf317f9aef.

Conflicts:

	drivers/video/omap2/dss/ti_hdmi_5xxx_ip.c
Revert "OMAPDSS: HDMI: Add deep color support"

This reverts commit 730dbaf7b1faeff50a2924ce976ea2506df4c576.
Revert "OMAPDSS: HDMI: support non-cea non standard VESA formats"

This reverts commit e2179213c1f40c5873f61df6ffd98ac7724d0fc5.

Conflicts:

	drivers/video/omap2/dss/hdmi.c
Revert "OMAP5: DSS: HDMI: Configure HDMI core for deep color support"

This reverts commit deebac563256c02bd32853187f3fb81c1814ba5d.
Revert "staging: drm/omap: Provide hpd change frrom irq handler"

This reverts commit ab5288ef071a3dcc3ce27de36da3b0cf7d243a5f.
UBUNTU: version 3.4.0-1485.2+dsstry3

Signed-off-by: Xavier Boudet <x-boudet@ti.com>