OMAPDSS: HDMI: Handle error when initing the panel at probe

Do not blindly assume that the panel could be init'ed.

While there, put mutex initialization in the same place.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Uninit display if unable to register device

The display must be uninit'ed in order to free the requested GPIOs.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Improve error handing to hdmi_probe_pdata

There are lots of things that can fail in this function. The errors
were just reported but no action was taken. Improve the error handling.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Improve error handing in hdmi_probe_of

There are lots of things that can fail in the function. Only error
messages are printed but no error is returned by the function. Add
several kinds of errors to inform the caller that there something
went wrong.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Init HDMI operations in _hw_probe

Initialize the HDMI operations from omapdss_hdmihw_probe as there is no need
to wait until hdmi_init_display.

TODO: Need to handle errors in hdmi_probe_pdata.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>

Conflicts:
	drivers/video/omap2/dss/hdmi.c
OMAPDSS: HDMI: Add operation to get the audio DMA port address offset

It could be possible that the DMA port differs accross diferent HDMI IPs. Thus,
we define an IP-specific function to obtain its offset.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Create platform device to support audio.

Creating the accessory devices, such as audio, from the HDMI driver
allows to regard HDMI as a single entity with audio an display
functionality. This intends to follow the design of drivers such
as MFD, in which a single entity handles the creation of the accesory
devices. Such devices are then used by domain-specific drivers; audio in
this case.

Also, this is in line with the DT implementation of HDMI, in which we will
have a single node to describe this feature of the OMAP SoC.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ARM: OMAP4+: Remove creation of device for ASoC HDMI driver

This is to allow the OMAPDSS HDMI driver to handle the creation of
accesory devices, such as the HDMI audio device.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ARM: OMAP4+: Relocate the creation of HDMI device to board files

The purpose of the device being relocated is to describe how the
HDMI output is wired on the 4430SDP and OMAP4 Panda boards. Hence,
it makes sense to relocate them on the applicable board files.

This device is used by the ASoC OMAP HDMI machine driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Use audio DMA port number from the device resources

Instead of defining the address offset of the DMA port for transfers of
audio samples, obtain this information from the resources of the device.
This device and its resources are populated by the OMAPDSS HDMI driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Update machine driver name

Update driver name to match the device created to describe the
connection between the HDMI output of OMAP and the level shifter
chip TPD12S015.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Update CPU DAI driver name

Update driver name to use the device created by the OMAPDSS HDMI
driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: remove omap_dss_device's suspend/resume

The panel drivers contain enable, disable, suspend and resume calls.
The suspend and resume are effectively identical to disable and enable.

This patch removes panel suspend and enable code from omapdss and the
panel drivers, and replaces their use with enable and disable.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: remove dispc_irq_handler declaration

dss.h contains dispc_irq_handler declaration, even if the function is
dispc.c internal. Remove the declaration.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: DISPC: fix dispc_mgr_lclk_rate for DIGIT output

dispc_mgr_lclk_rate() cannot currently be called with DIGIT channel
parameter, even if dispc_ovl_lclk_rate() can. Fix this by making
dispc_mgr_lclk_rate() handle DIGIT channel also.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: DISPC: use dss_feat_get_num_ovls()

Use dss_feat_get_num_ovls() in dispc.c instead of
omap_dss_get_num_overlays() to remove the dependency to overlay.c. Note
that we still have uses of omap_dss_get_num_overlays() in dispc.c, but
these will be moved out in the future patches.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: DISPC: rename dispc_mgr_enable/disable to _sync

The current dispc_mgr_enable/disable function are blocking, and do a bit
too much for omapdrm. We'll expose new enable & disable functions that
will just set the bits in the registers in the following patches.

This patch renames the current functions to *_sync, to make it clear
that they are blocking, and also to free up the dispc_mgr_enable/disable
names for these new functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: DISPC: make _enable_mgr_out public as "dispc_mgr_enable"

We need a low level manager-enable function for omapdrm. We have that
function as dispc internal func, _enable_mgr_out().

This patch exposes that function, and renames it to dispc_mgr_enable().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: add dispc_ovl_enabled()

Add new dispc function, dispc_ovl_enabled(). This returns if the overlay
enable bit is set in the registers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: DISPC: Add IRQ enable/status helpers

DISPC irqs need to be handled from the compat layer and also in the
future by the omapdrm. To make this possible, this patchs adds a set of
helper functions, so that the irqs can be managed without direct
register reads/writes.

The following functions are added, and all the current direct reg
reads/writes are changed to use these.

u32 dispc_read_irqstatus(void);
void dispc_clear_irqstatus(u32 mask);
u32 dispc_read_irqenable(void);
void dispc_write_irqenable(u32 mask);

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>