ENGR00290337 ipuv3: Setup pixel clock tree after ipu reset

When the ipu pixel clocks are initialized, the default pixel clock rate
will be calucated according to the present ipu register setting which
is likely set by a bootloader.
But these registers will be reset by the ipu reset function.
If the default pixel clock rate is the same to what is requested later,
the clk_set_rate function will treat this case as pixel clock unchanged.

Move the pixel clock setup function after the ipu reset function to
resolve this issue

Signed-off-by: Sandor Yu <R01008@freescale.com>
ENGR00290361-1 IPUv3 IC:Add check for a IDMAC errata

The IPUv3 IDMAC has a bug to read 32bpp pixels from a
graphics plane whose alpha component is at the most
significant 8 bits. The bug only impacts on cases in which
the relevant separate alpha channel is enabled.
This patch adds check for the errata so that the bad
cases won't be triggered.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
ENGR00290361-2 MXC IPUv3 fb:Add check for a IDMAC errata

The IPUv3 IDMAC has a bug to read 32bpp pixels from a
graphics plane whose alpha component is at the most
significant 8 bits. The bug only impacts on cases in which
the relevant separate alpha channel is enabled.
This patch adds check for the errata so that the bad
cases won't be triggered.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
ENGR00290496-1 ARM: imx6: Add charging led support on Sabresd board

Enable led lighting while the board in charging status. Implement it on Sabresd
board.

Signed-off-by: Robin Gong <b38343@freescale.com>
ENGR00290496-2 ARM: imx_v7_defconfig: Enable gpio-led in configs

Enable the related option of configuration.

Signed-off-by: Robin Gong <b38343@freescale.com>
ENGR00290635-1 mxc vout:Fix a build warning

This patch fixes the following build warning by allocating
a block of virtual memory to cache an instance of the structure
mxc_vout_output instead of using the stack frame.
drivers/media/platform/mxc/output/mxc_vout.c: In function ‘mxc_vidioc_s_crop’:
drivers/media/platform/mxc/output/mxc_vout.c:1529:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
ENGR00290635-2 IPUv3 stripe:Fix a build warning

This patch fixes the following build warning by
initializing some local variables:
drivers/mxc/ipu3/ipu_calc_stripes_sizes.c: In function ‘ipu_calc_stripes_sizes’:
drivers/mxc/ipu3/ipu_calc_stripes_sizes.c:393:3: warning: ‘difwr’ may be used uninitialized in this function [-Wuninitialized]
drivers/mxc/ipu3/ipu_calc_stripes_sizes.c:393:3: warning: ‘onw’ may be used uninitialized in this function [-Wuninitialized]
drivers/mxc/ipu3/ipu_calc_stripes_sizes.c:393:3: warning: ‘inw’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
ENGR00290654 IPUv3 dev:Workaround split mode downsize overflow

The downsizing ratio overflow check should cover every stripe
in the split mode. We need to do the overflow check correctly
by taking the width/height 8-pixel alignment requirement into
consideration since the alignment would be done when every
stripe is checked in it's own ipu task.

This patch takes a workaround for the issue which can be
reproduced by this unit test case:

==================================================================
mxc_v4l2_output.out -iw 1920 -ih 1080 -ow 200 -oh 200 -v 1

mxc_ipu mxc_ipu: ERR:create_split_child_task() ret:-22
mxc_ipu mxc_ipu: sp_task[0],no-0x12 fail state:-22, queue err:-22.
mxc_ipu mxc_ipu: ERR: [0xac73ea00] no-0x10,state 3: error
mxc_ipu mxc_ipu: ERR: no-0x10,ipu_queue_task err:-125
mxc_v4l2_output v4l2_out.35: display work fail ret = -125
mxc_ipu mxc_ipu: ERR:create_split_child_task() ret:-22
mxc_ipu mxc_ipu: sp_task[0],no-0x22 fail state:-22, queue err:-22.
mxc_ipu mxc_ipu: ERR: [0xac73ea00] no-0x20,state 3: error
mxc_ipu mxc_ipu: ERR: no-0x20,ipu_queue_task err:-125
mxc_v4l2_output v4l2_out.35: display work fail ret = -125
mxc_ipu mxc_ipu: ERR:create_split_child_task() ret:-22
mxc_ipu mxc_ipu: sp_task[0],no-0x32 fail state:-22, queue err:-22.
mxc_ipu mxc_ipu: ERR: [0xac63c400] no-0x30,state 3: error
mxc_ipu mxc_ipu: ERR: no-0x30,ipu_queue_task err:-125
mxc_v4l2_output v4l2_out.35: display work fail ret = -125
VIDIOC_QBUF failed -1
==================================================================

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
ENGR00290613 PXP: add asynchronous multi instances support for PXP

Move PXP registers setting from pxp_issue_pending() to a seperate
kernel thread. This change will avoid the multi instances hang issues
solved in previous commits. And also the pxp users won't be blocked
when it call dma_async_issue_pending() function.

Signed-off-by: Fancy Fang <B47543@freescale.com>
ENGR00290664 PXP: allocate DMA TX descriptors on demand instead of in PXP initialization

In previous PXP driver, the number of tx descriptors allocated
for each channel is a constant 16 and they can only be allocated
during PXP initialization. But since the driver allows users to
queue more than one PXP tasks for each channel before issuing
pending tasks, so in this case the descriptors may be not enough
for some cases.

Signed-off-by: Fancy Fang <B47543@freescale.com>
ENGR00290601 [iMX6x] Ensure PLL is powered down when bypass rate is requested.

Ensure that PLL is powered down when bypass rate is requested and
power it up when some other rate is requested.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
ENGR00289855 usb: chipidea: udc: pull down dp before the charger detection

If rom code or bootloader has used usb before loading kernel, the dp
may still be pulled up, it will cause USB charger detection fail.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
ENGR00290679 mxc: mlb Fix the MLB150 not stable issue in ISOC mode.

The MLB test bench has bug when testing the ISOC mode.When we press
stop test button when completing test, MITB will cause MLB150 on ARD
error.The mlbintr ISR handler is used to handle the error interrupt.
In the ISR handler, the MLB150_MS0,MLB150MS1 should be cleared.
The spec doesn't give detailed description. The spec only says that
the registers need to be cleared before enabling interrupt.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
mmc: core: Only execute tuning for SDR50 and SDR104

Only execute tuning for sd and sdio devices that are using
SDR50 or SDR104.

Make sure clock is hold during tuning for sdio devices.

Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com>
Acked-by: Johan Rudholm <jrudholm@gmail.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 810e08ee425f8d7327e4b30069a9b2b3dccfc67d)
mmc: sd: fix the maximum au_size for SD3.0

Since SD Physical Layer specification V3.0, AU_SIZE is supported up
to 0xf.  So If SD-card is supported v3.0, then max_au should be 0xf.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 77776fd0a4cc541b9a528eacc1d31ca47eb1ae7a)
ENGR00291111 mxc vout:Restore when new config fails

Users may call VIDIOC_S_CTRL and VIDIOC_S_CROP ioctrls
to change rotation and cropping settings when streaming.
The driver should restore the original settings if new
configuration fails, otherwise, it might break the
present pipeline.

This patch fixes the issue which can be reproduced by
this test case with a 1080P HDMI primary display:
gplay Mpeg4_SP1_480x260_24_1200_aac_48_128_2_terminator3.mp4
Type 't' to set rotation to 90.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
ENGR00291400 PXP: Organize PXP task queue to be FIFO

The requested PXP tasks were handled based on channel unit. All the
tasks in one channel were handled one by one, and the tasks in another
channel only can get chance after all the tasks in previous channel
were finished. So this may allow some channel occupies PXP hardware
exclusively all the time, and other channels may never get PXP services.
So this change makes the PXP task queue to be a FIFO to avoid this kind
of unfair usage for PXP.

Signed-off-by: Fancy Fang <B47543@freescale.com>
ENGR00292021-1 arm: dts: imx6sl-evk: Specify the IOMUX value of GPIO4_IO19

We are missing one pull-up resistor attached to GPIO4_IO19 on EVK board,
thus use specific IOMUX value to pull up the GPIO4_IO19 by SoC itself.
Otherwise, system like Android might not have the ability to determine
whether the headphone is currently plugged into the jack.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
ENGR00292021-2 ARM: imx6q: correct pll4_audio_div name in cko1_sels

There's a typo in cko1_sels[], thus fix it.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
ENGR00291658 PXP: allow PXP device users to submit multiple tasks before start PXP

After the commit "ffcad666548417ef21937e0a755d85ab922313a9" pushed,
adding this support in PXP device driver is also necessary. This
change allows users to submit more than one PXP tasks followd by
only one wait for finished ioctl. It means that users can wait for
more than one tasks done by calling one PXP_IOC_WAIT4CMPLT ioctl.

Signed-off-by: Fancy Fang <B47543@freescale.com>