ENGR00218013-4 MX6Q ARM2: Set HDMI event as event 2 of SDMA event

Select external SDMA request as SDMA event 2 for MX6Q ARM2 board.
SDMA event 2 can be configured HDMI or IPU.
Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218013-5 HDMI: Add SDMA to help HDMI audio support multi buffer

For chip version easily than TO1.1, HDMI use internel DMA enginue for
audio tranfer. Due to capability of HDMI module, FIFO underrun is
unavoidable.

For chip TO 1.2, introducing SDMA to help HDMI audio DMA. With the help
of SDMA, HDMI audio can use ping-pong buffer mechanism and FIFO underrun
can be avoid.

In this path: Add SDMA support for i.MX6Q later than TO1.2.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218013-6 SDMA:Add HDMI script in SDMA firmware

Add support for hdmi-sdma script content in sdma firmware.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218774 ESAI ASRC: fix multi channel p2pplayback bug

ASRC driver would configure ASRC as ideal ratio mode for p2p playback.
However, multi channel convert can't work well with ideal ratio mode.

In this patch, change ASRC p2p playbck mode to internal ratio mode to
better support multi channel p2p playback.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218421-1 ESAI: Setup virtual device under ESAI sound card

For ESAI sound card, ESAI driver setup device 0 for raw ESAI playback
and capture.

In this patch, add ESAI virtual device 1 under ESAI sound card. Device 1
is for ESAI audio p2p playback. Every time user use device 1 for
playback, ASRC would be called defaultly. Thus for device 1, it can
support all sample rate between 8k ~ 192k.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218421-2 ESAI_ASRC:Add support for p2p virtual device playback

In the origin code, ESAI driver supoprt audio p2p playback by setting
input PCM data's sample rate thought amixer interface.It is ugly and
request user application call amixer control interface everytime before
and playback.

In this patch, user can call the audio p2p playback by writing data to
an special virtual device. Driver would automatically get the params of
input PCM. At the same time, driver would get the output sample rate and
word data. With the data abover, driver can  set ASRC properly and audio
p2p palyback is support.

This patch mainly focus on:
	1 clean old p2p playback way for ESAI.
	2 Setup the output sample rate and word width to virtual
	device's substream_runtime's private data. Everytime the virtual
	device is called, the data abover is used for config ASRC, ESAI,
	and codec.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218421-3 ESAI: init platform data for p2p playback

Set audio p2p playback params(sample rate, word width) for ESAI in board
init file(ARD).

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218771 mx6 USB:USB disconnect issue verification on MX6QTO1.2/MX6DLTO1.1

- for Rigel1.1/Arik1.2, bit 17 of HW_USBPHY_IP will be set, it will fix the
  issue that no wakeup between SUSP/PHCD. And the usb_platform_rh_suspend/
  usb_platform_rh_resume do not need do complex software workaround, only
  need set/clear the workaround bit.
- for Megrez , bit 17 and bit 18 of HW_USBPHY_IP will be set, it will fix the
  issue that no wakeup between SUSP/PHCD and disconnect after resume. No need
  do any software workaround.

Signed-off-by: make shi <b15407@freescale.com>
ENGR00218807 ESAI: fix bootup issue cause by accessing unexist address

To support p2p playback, ESAI driver would copy platform data to
esai_asrc struct. The platform data only exist on boards that supports
ESAI. However, for ARM2 board, it supports ESAI but not necessary
get the codec CS42888. Thus the probe() in ESAI driver would also try to
copy the platform data from board init file.

The p2p playback now only support ARD board, so the ESAI probe() for
ARM2 would access unexisted address and cause an kernel dump.

In the patch, check the platform data address before copy.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218824 VPU: revert  ENGR00217123 about VPU regulator

Two reason:
1. VPU regulator is not enough stable,sometimes will cause system hang
2. GPU regulator is not ready, because GPU/VPU share PU LDO, so revert
the patch firstly.

Signed-off-by: Robin Gong <B38343@freescale.com>
ENGR00218747 - MX6Q/MX6DL: WAIT mode support for MX6QTO1.2/MX6DLTO1.1

Add the new WAIT mode workaround added for MX6Q1.2 and MX6DLTO1.1.
A new bit is added to CCM_CGPR (bit 17). This bit needs to be
enabled for the WAIT mode fix to be active and needs to be disabled
before the system enters STOP mode with power gating enabled.
Fix WAIT mode bug when system is in low power IDLE mode:
In low power IDLE mode (AHB @ 24MHz), switch ARM to run from 24MHz
on MX6QTO1.1 and MX6DLTO1.0 chips when ARM core enters WAIT mode.
We still need to use the ARM:IPG_CLK ratio of 12:5. Since IPG_CLK
is at 12MHz, we need to run ARM below 28.8MHz.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
ENGR00217401 wm8962: fix build warning

Fix two build warnings on wm8962

Signed-off-by: Xinyu Chen <Xinyu.chen@freescale.com>
ENGR00218958 ESAI ASRC: fix system hang cause by accessing ASRC with no clock

In ESAI_ASRC, to use ASRC for p2p playback, ESAI driver would maintain
an variable to keep track of ASRC pair number allocated. So every time
ESAI driver want to use ASRC, he would first init the variable to a value
(0 in ESAI driver)stand for unvalid pair number and then request an valid
pair number. At last, open the ASRC clock for ASRC register access.

However, ASRC driver treat 0 as an valid pair number. Thus, if an ESAI ASRC
playback is failed, ESAI driver would check whether the pair number is valid.
If the pair number is valid, ESAI driver would access ASRC register to do some
clean work. Thus, the init 0 value would be treat as an valid pair number and
ASRC register would be access without ASRC clock. In the case, an system
hang happens.

In this patch, init pair number variable to -1 after its allocation.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00218810-1 [Thermal]Add thermal alarm function

Add thermal irq alarm function.

Signed-off-by: Anson Huang <b20788@freescale.com>
ENGR00218810-2 [Thermal]Add thermal alarm function

1. Current thermal framework use delayed work to update
temperature, but delayed work may be blocked if system is
busy with the high priority task, which will cause the thermal
protect function not working in time, so we need to add alarm
function, when temperature reach the critical point, the alarm
function will generate an interrupt to reboot system.

2. No need to read 5 times of sensor value, read once is enough.

Signed-off-by: Anson Huang <b20788@freescale.com>
ENGR00216855 suspend resume fail related with clock glitch

GPU 2D core suspend resume fail related with clock glitch
Switch GPU 2D core clock to PLL2
PLL3 has an errata TKT094231 To1.2 will fix it

Signed-off-by: Richard Liu <r66033@freescale.com>
ENGR00219016-1 MX6Q ARM2: Add chip version checking for HDMI SDMA setup

If MX6q version is bigger than 1.2, Select external SDMA request as SDMA
event 2 for MX6Q ARM2 board.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00219016-2 MX6Q ARD: Set HDMI event as event 2 of SDMA event

If MX6q chip version is bigger than TO1.2, Select HDMI SDMA
request as SDMA event 2 for MX6Q ARM2 board. SDMA event 2 can be
configured HDMI or IPU.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00219016-3 MX6Q SMD: Set HDMI event as event 2 of SDMA event

If MX6q chip version is bigger than TO1.2, Select HDMI SDMA
request as SDMA event 2 for MX6Q ARM2 board. SDMA event 2 can be
configured HDMI or IPU.

Signed-off-by: Chen Liangjun <b36089@freescale.com>
ENGR00219016-4 MX6Q SabreLite: Set HDMI event as event 2 of SDMA event

If MX6q chip version is bigger than TO1.2, Select HDMI SDMA
request as SDMA event 2 for MX6Q ARM2 board. SDMA event 2 can be
configured HDMI or IPU.

Signed-off-by: Chen Liangjun <b36089@freescale.com>