Merge all CEC driver changes to 3.10
This commit pushes all changes I did in the 3.0.35 kernel
to improve/fix its behavior with libcec port for imx6

It also fixes CEC clock handling in case of FB mode change event
and of HDMI cable disconnection
Fix a bug that could result in CEC interrupts to be improperly muted
in case the CEC_STAT register was 0, the worker was not invoked and
as a consequence the interrupts were not unmuted
Also try to play better with the interrupt sharing with hmdi_video
fsl_spdif: Default to 'no preemphasis'

Signed-off-by: Rudi <r.ihle@s-t.de>
fsl_spdif: Set validity bit according to channel status

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: fsl_spdif: Add support for sample rates 88.2kHz through 192kHz

Add support for the sample rates between 48kHz and 192kHz that are also
supported by HDMI: 88.2kHz, 96kHz, 176.4kHz, 192kHz.

TODO: TESTING

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
ASoC: spdif_transmitter: Allow 192kHz sample rate

Transmitters and receivers may support a 192kHz sample rate.

Tested with Cubox-i imx6 system and Onkyo TX-SR607 receiver.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
ASoC: fsl_spdif: Fix integer overflow when calculating divisor

The calculation code does
u64 = (u32 - u32) * 100000;

The 64 bits are of no help here as the type is casted only after the
multiplication, and therefore the result may overflow, possibly causing
inoptimal or wrong clock setup.

Fix the code to cast before multiplication.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
spdif: cubox-i/hummingboard: Use only PLL4 (internal) as clock source

The spdif driver will enumerate all possible clock sources (internal
and external) for a matching frequency. Since CuBox-i does not have
any external oscillator, we must tell the driver so. Otherwise it may
choose a non-present clock source resulting in no sound at 88.2 and
176.4kHz.

Signed-off-by: Rudi <r.ihle@s-t.de>

Conflicts:
	arch/arm/boot/dts/imx6dl-hummingboard.dts
ASoC: fsl_spdif: Add support for full 6 byte channel status.

This patch allows all 6 bytes ot the SPDIF channel status information
to be transmitted.
ASoC: imx-hdmi: Add support for HBR/HD bitstreaming

Enable HBR mode when the userspace sets 8 channel output with non-PCM
indicated in PCM status bits (AES0 & 0x02).

HBR mode allows passthrough/bitstreaming of TrueHD/DTS-HD encoded audio.

ALSA needs an appropriate imx-hdmi-soc.conf for most applications to
automatically set the AESx bits.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
ASoC: imx-hdmi-dma: Cleanup parity bit calculation

Inline the odd_ones() function and use it in all places where possible.

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: imx-hdmi-dma: Set validity bit in HDMI according to channel status.

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: fsl_hdmi/imx-hdmi-dma: Enable/fix 24bit audio output.

Since SNDRV_PCM_FORMAT_S24 uses 4 bytes, the constraint has to be set to 32.
Also we need to extend the parity calculation to full 32 bit.

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: imx-hdmi-dma: Add support for mmap emulation when using 24bit samples.

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: imx-hdmi-dma: Remove unnecessary double condition check.

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: imx-hdmi-dma: Fix md optimize subframe assembly.

Do not include unused bits of pcm_data in parity calculation and
avoid make better use of odd_ones().

Signed-off-by: Rudi <r.ihle@s-t.de>
ASoC: imx-hdmi-dma: Fix channel mapping ALSA <-> CEA

Map default ALSA channel allocation (see snd_pcm_std_chmaps[] in pcm_lib.c)
to HDMI/CEA-861D speaker locations. This patch only implements a single,
fixed mapping. In order to support all features, we need to add this:
https://www.kernel.org/doc/Documentation/sound/alsa/Channel-Mapping-API.txt

Signed-off-by: Rudi <r.ihle@s-t.de>