OMAPDSS: HDMI: OMAP4: Remove CEA-861 audio infoframe and IEC-60958 enums

Instead of having its own definitions for CEA-861 and IEC-60958, the HDMI
driver should use those provided by ALSA. This patch removes the definitions
that are already provided by ALSA.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: OMAP4: Correct a typo in I2S definitions

This pach corrects a typo in the naming of a I2S define.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: OMAP4: Remove invalid I2S settings

According to the most up-to-date documentation from Texas Instruments,
it is not possible to configure the HDMI IP for High Bitrate Audio.
Also, it is not possible to set polarity of the I2S Word Select
signal. This patch implements the required updates.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Decouple wrapper enable/disable and audio start/stop

Decouple the enable/disable operation of the HDMI audio wrapper from
audio start/stop. Otherwise, an audio FIFO underflow may occur. The
audio wrapper enablement must be done after configuration and
before audio playback is started.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Decouple HDMI audio from ASoC

Instead of having OMAPDSS HDMI audio functionality depending on the
ASoC HDMI audio driver, use a new config option so that
potential users, including ASoC,  may select if needed.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: OMAP4: Expand configuration for IEC-60958 audio

Utilize a snd_aes_iec958 struct to write the parameters of the IEC-60958
channel status word into the HDMI IP registers. Hence, the user of the
driver has full control of what parameters are written in the word.

Also, some of the paramters of the I2S structure have been removed
as they belong to IEC-60958 parameteres.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Relocate N/CTS calculation

The N and CTS parameters are relevant to all HDMI implmentations and
not specific to a given IP. Hence, the calculation is relocated
into the generic HDMI driver.

Also, deep color is not queried but it is still considered in the
calculation of N. This is to be changed when deep color functionality is
implemented in the driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Add support for more audio sample rates in N/CTS calculation

Add support for more sample rates when calculating N and CTS. This
covers all the audio sample rates that an HDMI source is allowed
to transmit according to the HDMI 1.4a specification.

Also, reorganize the logic for the calculation when using deep color.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Add an audio configuration function

The generic HDMI driver does not need to know about the specific
settings of a given IP. Hence, it just passes the audio configuration
and the IP library parses such configuration and sets the IP
accordingly. This patch introduces an IP-specific audio configuration
function.

Also, this patch implements the audio config function for OMAP4. The
DMA, format and core config functions are no longer exposed to the
generic HDMI driver as they are IP-specific.

The audio configuration function caters for 16-bit through 24-bit
audio samples with sample rates from 32kHz and up to 192kHz as well
as up to 8 audio channels.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Panel: Simplify the name of the HDMI mutex

As the hdmi_lock mutex is inside the hdmi struct, rename to simply
"lock". This is only a change in the name. There are not changes
in functionality.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
OMAPDSS: HDMI: Implement DSS driver interface for audio

Implement the DSS device driver audio support interface in the HDMI
panel driver and generic driver. The implementation relies on the
IP-specific functions that are defined at DSS probe time.

A hardirq-safe spinlock is used to protect the audio_start/stop
functions.. This is because such function may be called while
holding a lock. The operation should not take too long to complete
as at this point all the required resources (DMA, audio FIFO,
regulators, companion chips, etc.) should be prepared to start
audio data transfers.

At the moment, the rest of the audio functions also are protected
by a hardirq-safe spinlock. In the future, a mutex may have to be
used, as the enablement of resources may take too much time.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Select DSS HDMI audio support

Select the HDMI audio support provided by the DSS device driver.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Change error values in HDMI CPU DAI

When getting the needed resources fails, return ENODEV. This is more
in line with other drivers do and it gives a more descriptive error.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Introduce codec

Introduce codec for HDMI. At the moment, this is a dummy codec. In the
future it will parse the EDID to modify the supported parameters, such
as the number of channels and the sample rates. At the moment, it blindly
supports all the sample rates and audio channels described in the HDMI
1.4a specification.

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

Conflicts:

	sound/soc/codecs/Kconfig
	sound/soc/codecs/Makefile
ASoC: OMAP: HDMI: Update the platform device names

In order to utilize the new OMAP HDMI codec and updated CPU DAI,
use the new platform device names.

While there, also update the machine driver to be more generic
and encompass more OMAP processors featuring HDMI and not only OMAP4.

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

Add operations to the CPU DAI. This is to configure the HDMI IP
using DSS functionality.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Expand capabilities of the HDMI DAI

According to the HDMI specification, a source is permitted to
transmit L-PCM audio in the following sample rates: 32kHz, 44.1kHz,
48kHz, 88.2kHz, 96kHz, 176.4kHz or 192kHz.

It also supports up to 8 audio channels.

The sink may not necessarily support all these sample rates and
channels. However, as this CPU DAI describes the HDMI source, it
makes sense to include them. The limitation of capabilities as
supported by the sink should be done in the ASoC HDMI codec.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Make build config more generic

Make Kconfig and Makefile more generic to encompass not only
OMAP4 but other OMAP processors featuring HDMI.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
ASoC: OMAP: HDMI: Rename OMAP4 HDMI audio card

Rename the OMAP4 HDMI audio card. This is tu reuse this audio card
for OMAP5. This is possible as they share similar design features.
Differentiation is handled at the DSS level.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
scripts: fix menuconfig due to DSOlink change

Due to stricter link rules[1], make menuconfig fails. This patch
fixes it. This is the error:

$ make menuconfig
  HOSTLD  scripts/kconfig/mconf
/usr/bin/ld: scripts/kconfig/lxdialog/checklist.o: undefined reference to symbol 'acs_map'
/usr/bin/ld: note: 'acs_map' is defined in DSO /lib/libtinfo.so.5 so try adding it to the linker command line
/lib/libtinfo.so.5: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2

[1]. http://fedoraproject.org/wiki/UnderstandingDSOLinkChange

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