linux.git
7 years agoMLK-12136-2 ARM: imx: add ddr phy registers restore for i.MX7D
Anson Huang [Wed, 13 Jan 2016 14:36:26 +0000 (22:36 +0800)]
MLK-12136-2 ARM: imx: add ddr phy registers restore for i.MX7D

i.MX7D TO1.1 adds some DDR PHY register settings to fix the CKE
timing issue, when fast MIX off in DSM, need to restore them
to make sure the DDR PHY setting is correct.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-12136-1 ARM: imx: adjust slot control to meet design requirement on i.MX7D
Anson Huang [Wed, 13 Jan 2016 10:59:56 +0000 (18:59 +0800)]
MLK-12136-1 ARM: imx: adjust slot control to meet design requirement on i.MX7D

Design team recommend to put SCU/C0/C1 in same power up slot
to avoid reset timing issue of debug mode, adjust the power
up slot and timing per their requirement.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-12251 video: mipi_dsi: fix an unsigned compared against zero issue
Fancy Fang [Thu, 14 Jan 2016 01:59:52 +0000 (09:59 +0800)]
MLK-12251 video: mipi_dsi: fix an unsigned compared against zero issue

Compared 'mux' against zero is meaningless. So correct this.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-12218 video: mxsfb: fix a potential unitialized pointer dereference
Fancy Fang [Tue, 12 Jan 2016 10:08:09 +0000 (18:08 +0800)]
MLK-12218 video: mxsfb: fix a potential unitialized pointer dereference

The 'rgb' pointer may be dereferenced before being initialized.
So correct this.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-12217 video: mxsfb: fix an uninitialized variable usage
Fancy Fang [Tue, 12 Jan 2016 10:03:39 +0000 (18:03 +0800)]
MLK-12217 video: mxsfb: fix an uninitialized variable usage

The 'vmode' variable is used before it is initialized.
So initialize it before that.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-12216 video: mipi_dsi: fix the potential uninitalized variable usage
Fancy Fang [Tue, 12 Jan 2016 09:34:57 +0000 (17:34 +0800)]
MLK-12216 video: mipi_dsi: fix the potential uninitalized variable usage

The 'val' variable may be used before uninitialized.
So initialize it at the begining.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-12215 video: mxsfb: free the 'timings' after using it to avoid resource leak
Fancy Fang [Tue, 12 Jan 2016 09:29:19 +0000 (17:29 +0800)]
MLK-12215 video: mxsfb: free the 'timings' after using it to avoid resource leak

The 'timings' is allocated by 'of_get_display_timings()'
dynamically. So it should be freed when it is not used
anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-12213 dma: pxp-v2: fix the potential resource leak issue reported by Coverity
Fancy Fang [Wed, 13 Jan 2016 07:11:23 +0000 (15:11 +0800)]
MLK-12213 dma: pxp-v2: fix the potential resource leak issue reported by Coverity

There may be potential memory leak when the 'desc' allocation failed.
The previous allocated descriptors should be freed when the allocation
failed.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
7 years agoMLK-12257 ARM: dts: imx6qdl/imx6sx: add enet magic packet support
Fugang Duan [Wed, 13 Jan 2016 10:11:41 +0000 (18:11 +0800)]
MLK-12257 ARM: dts: imx6qdl/imx6sx: add enet magic packet support

Add imx6q/dl/qp sabresd, imx6sx sabreauto magic packet support.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12252 dts: imx7d: move lpsr pin definition into a separated head file
Dong Aisheng [Wed, 13 Jan 2016 08:04:06 +0000 (16:04 +0800)]
MLK-12252 dts: imx7d: move lpsr pin definition into a separated head file

Originally we put all the definition of both imx7d normal pins and
lpsr pins in imx7d-pinfunc.h which may lead to a easy failure of
user by wrongly put the normal pins of &iomuxc under &iomuxc_lpsr
node due to user has no idea about the difference, then pinctrl
driver will take the wrong value to set which may potentially break
other devices to work.

We have met this issue several times and it's hard to debug when it
happens.

This patch separates the lpsr pins into a dedicated head file
to give user a reminder to put lpsr pins group under the correct
pinctrl device node.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(cherry picked from commit c524454c24fd9e5e329351dd154cbd24d47d0e0e)

7 years agoMLK-12189 imx: mx7d correct iomux error for SAI3 and ENET2_EN
Peng Fan [Wed, 13 Jan 2016 06:50:29 +0000 (14:50 +0800)]
MLK-12189 imx: mx7d correct iomux error for SAI3 and ENET2_EN

pinmux settings using GPIO1_IO0[0-7] should use iomuxc_lpsr,
but not iomuxc. If use iomuxc, you will set wrong register
and may impact other functions.

Without this patch, SAI3_MCLK use GPIO1_IO03 pinmux and impacts
QSPI function.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-12205 ARM: dts: 6sx-ard: add sensor node
Gao Pan [Tue, 12 Jan 2016 10:21:20 +0000 (18:21 +0800)]
MLK-12205 ARM: dts: 6sx-ard: add sensor node

Add sensor node in 6sx-ard dts. The sensors are mma8451,
mag3110 and isl29023.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-12203-2 ARM: imx: adjust loop number to delay ~20us for i.MX7D low power idle
Anson Huang [Sat, 9 Jan 2016 16:38:37 +0000 (00:38 +0800)]
MLK-12203-2 ARM: imx: adjust loop number to delay ~20us for i.MX7D low power idle

ARM does NOT execute one instruction every cycle, the bus bandwidth,
cache status etc. would impacts the instruction execution time, so we
can NOT just calculate the delay time by ARM frequency, this patch
adjusts loop number to get a ~20us delay, measured via GPIO pin.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-12203-1 ARM: imx: adjust i.MX7D DDR retention mode for LPSR
Anson Huang [Sat, 9 Jan 2016 16:02:00 +0000 (00:02 +0800)]
MLK-12203-1 ARM: imx: adjust i.MX7D DDR retention mode for LPSR

Per design team's recommendation, for i.MX7D TO1.1
LPSR mode, as IOMUXC will lost power, so it needs to
use TO1.0's flow to avoid CKE toggle during retention,
but it has a limitation of POR reset fail during LPSR.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-11909-2 regulator: anatop-regulator: Dereference null return value (NULL_RETURNS)
Robin Gong [Thu, 26 Nov 2015 09:05:07 +0000 (17:05 +0800)]
MLK-11909-2 regulator: anatop-regulator: Dereference null return value (NULL_RETURNS)

Dereference null return value (NULL_RETURNS).

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit e5d41f4bbded2f2b948a13d4dc04596cd896b072)

7 years agoMLK-12179 epdc: use outer_flush_range instead of outer_flush_all
Robby Cai [Tue, 12 Jan 2016 08:35:12 +0000 (16:35 +0800)]
MLK-12179 epdc: use outer_flush_range instead of outer_flush_all

l2c210_flush_all, the underlying implementation of outer_flush_all() has the
constraint on 4.1 kernel that, it can not be called under interrupt context.
However the EPDC driver can not guarantee this condition at calling point, thus
it could cause kernel dump. This has been observed on i.MX6SL, and theorically
on other platforms like i.MX6DL (using PL310 L2 cache). So use outer_flush_range
to fix it.

Although we don't have such issue on i.MX7D (not PL310 L2), we still prefer to
use outer_flush_range() for legacy software dithering support and for easy
maintenance. Then we do the change in both EPDC driver.

------------[ cut here ]------------
Kernel BUG at 800204d8 [verbose debug info unavailable]
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in: galcore(O) evbug
CPU: 0 PID: 842 Comm: kworker/u3:1 Tainted: G           O    4.1.8-1.0.0+ge352a0b #1
Hardware name: Freescale i.MX6 SoloLite (Device Tree)
Workqueue: EPDC Submit epdc_submit_work_func
task: a8a8f900 ti: a92a4000 task.ti: a92a4000
PC is at l2c210_flush_all+0x5c/0x60
LR is at epdc_submit_work_func+0x684/0xbf8
pc : [<800204d8>]    lr : [<8030702c>]    psr: 600b0013
sp : a92a5e90  ip : a9150c8c  fp : a8480518
r10: a84a28c0  r9 : 00000008  r8 : a9150644
r7 : a91512e0  r6 : 0000012c  r5 : a91512e0  r4 : a91512dc
r3 : a00b0013  r2 : 80b184a0  r1 : 701fe019  r0 : f4a02000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: a943404a  DAC: 00000015
Process kworker/u3:1 (pid: 842, stack limit = 0xa92a4210)
Stack: (0xa92a5e90 to 0xa92a6000)
5e80:                                     a92a5ed0 8005d058 0000bbc2 a851d4c0
5ea0: 00000000 a9150000 a8480000 a8480440 00000190 00000193 55555556 a84a28c0
5ec0: a8480518 a8500000 80b18088 a94f3900 00000000 00000000 00000190 0000012c
5ee0: a94f3900 a8480518 a87e8d80 a8479000 a845a200 00000020 00000000 a8479000
5f00: a8479000 80046458 a92a4000 a8479000 a8479014 a8479000 a87e8d98 a8479014

...

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-12240: mxc cec: Fix potential memory leak issue
Sandor Yu [Tue, 12 Jan 2016 09:30:48 +0000 (17:30 +0800)]
MLK-12240: mxc cec: Fix potential memory leak issue

Fix mxc cec driver potential memory leak issue.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-12219 thermal: imx: unregister busfreq_notifier in thermal_remove
Bai Ping [Tue, 12 Jan 2016 08:27:46 +0000 (16:27 +0800)]
MLK-12219 thermal: imx: unregister busfreq_notifier in thermal_remove

unregister the busfreq_notifier when the thermal driver is removed.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-12211-2: ARM: configs: imx_v7_defconfig: enable CONFIG_POWER_RESET_SYSCON_POWEROFF
Robin Gong [Tue, 12 Jan 2016 07:16:45 +0000 (15:16 +0800)]
MLK-12211-2: ARM: configs: imx_v7_defconfig: enable CONFIG_POWER_RESET_SYSCON_POWEROFF

On v4.1, use syscon-poweroff driver instead of poweroff interface in
rtc-snvs driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-12211-1: ARM: dts: imx6/imx7: enable snvs-poweroff
Robin Gong [Tue, 12 Jan 2016 07:12:03 +0000 (15:12 +0800)]
MLK-12211-1: ARM: dts: imx6/imx7: enable snvs-poweroff

enable snvs-poweroff driver on imx6sx(except sabreauto board),imx6ul and
imx7d all boards.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-12190 ARM: dts: imx7d-sdb-revb: change pad setting to remove stripe
Robby Cai [Fri, 8 Jan 2016 10:51:07 +0000 (18:51 +0800)]
MLK-12190 ARM: dts: imx7d-sdb-revb: change pad setting to remove stripe

Change GPIO pad setting to control EPDC/ENET signals on REV B board from 0x59
to default one 0x14 in order to remove stripe when do EPDC unit test.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-12185 mlb: imx: fix the operation for mlb status in mlb_isr
Gao Pan [Mon, 11 Jan 2016 08:30:05 +0000 (16:30 +0800)]
MLK-12185 mlb: imx: fix the operation for mlb status in mlb_isr

As a result that the wrong operation is used for the mlb status
in mlb_isr(), some results are independent of their operations.

for example:
rx_cis = (cdt_val[2] & ~MASK) >> SHIFT, where, MASK = 0xf0000000
and SHIFT = 28. So, the result is always 0 regardless of the values
of its operands.

This patch fixes the operation for mlb status in mlb_isr().

(reported by coverity check)

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
7 years agoMLK-12188 dmaengine: fsl-edma: add fsl_chan->edesc NULL check
Fugang Duan [Mon, 11 Jan 2016 09:42:44 +0000 (17:42 +0800)]
MLK-12188 dmaengine: fsl-edma: add fsl_chan->edesc NULL check

Add fsl_chan->edesc NULL when calling .fsl_edma_desc_residue() to avoid
NULL pointer access.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12184 drm/imx: imx-ldb: add mux id check
Fugang Duan [Mon, 11 Jan 2016 08:54:30 +0000 (16:54 +0800)]
MLK-12184 drm/imx: imx-ldb: add mux id check

Add mux id check and transfer a valid mux to .imx_ldb_set_clock().

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12181 misc: at25: Cleaning up missing null-terminate in conjunction with strncpy
Fugang Duan [Mon, 11 Jan 2016 08:10:10 +0000 (16:10 +0800)]
MLK-12181 misc: at25: Cleaning up missing null-terminate in conjunction with strncpy

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12180 net: fec: add return value check after calling .of_property_read_u32()
Fugang Duan [Mon, 11 Jan 2016 07:44:28 +0000 (15:44 +0800)]
MLK-12180 net: fec: add return value check after calling .of_property_read_u32()

Add return value check after calling .of_property_read_u32() to avoid
the warning reported by coverity.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12176 Input: ads7846: add return value check after calling .of_property_read_u32()
Fugang Duan [Mon, 11 Jan 2016 06:40:32 +0000 (14:40 +0800)]
MLK-12176 Input: ads7846: add return value check after calling .of_property_read_u32()

Add return value check after calling .of_property_read_u32().
The issue was reported by coverity.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12186: ARM: imx: clk-imx6q: correct gpu2d_core_clock on i.mx6dl
Robin Gong [Mon, 11 Jan 2016 09:25:33 +0000 (17:25 +0800)]
MLK-12186: ARM: imx: clk-imx6q: correct gpu2d_core_clock on i.mx6dl

On i.mx6dl, gpu2d_core_clock share with gpu3d_shader_clock, thus, no need
change gpu2d_core_clock anymore, since gpu3d_shader has already change.
This patch also fix the below boot warning, since there is no pll2_pfd1_594m
in gpu2d_core_sel:

[    0.000000] failed to set parent of clk gpu2d_core_sel to pll2_pfd1_594m: -22

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMGS-1535 gpu: update 5.0.11.p8 driver copyright
Xianzhong [Mon, 11 Jan 2016 10:49:56 +0000 (18:49 +0800)]
MGS-1535 gpu: update 5.0.11.p8 driver copyright

Updated 5.0.11.p8 driver copyright from 2015 to 2016

Date: Jan 11, 2016
Signed-off-by: Xianzhong <b07117@freescale.com>
7 years agoMLK-12172: ARM: dts: imx7d-sdb-m4: disable reg_can2_3v3
Robin Gong [Mon, 11 Jan 2016 02:23:55 +0000 (10:23 +0800)]
MLK-12172: ARM: dts: imx7d-sdb-m4: disable reg_can2_3v3

Disable can2 is not enough, since the reg_can2_3v3 will be turned off by
the regulator framwork and that will impact can2 in m4 side even if can2
driver disabled in A7 side.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit f1bd999df30c6e88c1a967856304086aa72f2db0)

7 years agoMLK-12175: dma: imx-sdma: fix issues repoted by Coverity
Robin Gong [Mon, 11 Jan 2016 05:41:23 +0000 (13:41 +0800)]
MLK-12175: dma: imx-sdma: fix issues repoted by Coverity

Fix two code issues, but not function break or potential bug:
  --Unsigned compared against 0 (NO_EFFECT)
  --Wrong size argument (SIZEOF_MISMATCH)

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
7 years agoMLK-9699: ARM: dts: imx6: enable spi dma support
Robin Gong [Thu, 16 Oct 2014 02:30:46 +0000 (10:30 +0800)]
MLK-9699: ARM: dts: imx6: enable spi dma support

This patch cherry-pick from the below commit, but make little change:
align i.mx6dl with i.mx6q, since TKT238285 should be exit on other chips
although it can't reproduced by SPI-NOR, now there is official workaround
for this bug(a619a00e11a67b00805b9148f004a3c94d54f863). So this patch just
enable dma support on i.mx6sl and i.mx6sx.

*****************
There is one BUG(TKT238285) in ecspi module in DMA mode,but
it only found on i.mx6dl now, so enable dma support on all
i.mx6 chips except i.mx6dl

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit fa9ef1796819aadbb1ea184613d4fdd3de1b46c6)
(cherry picked from commit cfedad0e853fbcd5e57591b559734d54cdb782c8)

7 years agoMLK-12142 video: fbdev: mxc_ipuv3_fb: Set non-zero blank to FB_BLANK_POWERDOWN
Liu Ying [Mon, 11 Jan 2016 02:51:21 +0000 (10:51 +0800)]
MLK-12142 video: fbdev: mxc_ipuv3_fb: Set non-zero blank to FB_BLANK_POWERDOWN

We have implemented only two states for blank which are FB_BLANK_UNBLANK and
FB_BLANK_POWERDOWN.  Let's map all the other blank states(FB_BLANK_NORMAL,
FB_BLANK_VSYNC_SUSPEND and FB_BLANK_HSYNC_SUSPEND) to FB_BLANK_POWERDOWN,
since all of them make the screen be blanked.  This may avoid blanking a blanked
screen by setting the state to different non-zero values.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
7 years agoMLK-12140 ARM: dts: imx7d-sdb-epdc: add EPDC touch support for imx7d-sdb
Haibo Chen [Fri, 8 Jan 2016 12:15:05 +0000 (20:15 +0800)]
MLK-12140 ARM: dts: imx7d-sdb-epdc: add EPDC touch support for imx7d-sdb

EPDC board has touch screen, this patch add touch support on imx7d-sdb TO1.1
board, due to the touch pin conflict with UART5 and GPMI, so disable UART5 in
imx7d-sdb-epdc.dtsi. For GPMI, it default disabled in imx7d-sdb.dts, so do not
impact touch.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
7 years agoMLK-12162 ARM: imx: correct SCU PGC setting on i.MX7D
Anson Huang [Fri, 8 Jan 2016 16:20:25 +0000 (00:20 +0800)]
MLK-12162 ARM: imx: correct SCU PGC setting on i.MX7D

SCU PGC register is different from others, it contains
other timing settings, so we can NOT just program 0/1
to disable/enable SCU power gating, but need to only
program bit 0, correct it for all modules' PGC settings.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-12161 tty: serial: imx: only enable RTSD interrupt for hw flow control
Fugang Duan [Fri, 8 Jan 2016 05:36:05 +0000 (13:36 +0800)]
MLK-12161 tty: serial: imx: only enable RTSD interrupt for hw flow control

Only enable RTSD interrupt for hw flow control, otherwise RTS_B signal
has some external signal disturbance without config RTS_B select input.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: 471e8c43aca3)

Conflicts:
drivers/tty/serial/imx.c

7 years agoMLK-12160 net: fec: disable all irqs during normal suspend
Fugang Duan [Fri, 8 Jan 2016 05:24:41 +0000 (13:24 +0800)]
MLK-12160 net: fec: disable all irqs during normal suspend

During normal suspend process, disable all irqs to avoid the late
TXF interrupt comming after clocks disabled that accessing registers
cause system hang.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12145 ARM: dts: imx6ul-pinfunc: update imx6ul iomux headers
Fugang Duan [Fri, 8 Jan 2016 07:25:49 +0000 (15:25 +0800)]
MLK-12145 ARM: dts: imx6ul-pinfunc: update imx6ul iomux headers

- Update i.MX6ul iomux haeders to b151130 version.
- Merge the origin two pinfunc:
MX6UL_PAD_BOOT_MODE0__GPIO5_IO10
MX6UL_PAD_BOOT_MODE1__GPIO5_IO11

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked and merged from commit: f9bab6534f9f)

7 years agoMLK-12153: mtd: fsl-quadspi: fix the QSPI dereference null return value found by...
Han Xu [Thu, 7 Jan 2016 19:21:02 +0000 (13:21 -0600)]
MLK-12153: mtd: fsl-quadspi: fix the QSPI dereference null return value found by coverity

check the return value to avoid the dereference null return value when
parsing device tree.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-12144 epdc: fix gpio active level to enable epdc signal
Robby Cai [Thu, 7 Jan 2016 10:19:34 +0000 (18:19 +0800)]
MLK-12144 epdc: fix gpio active level to enable epdc signal

There's a GPIO pin to enable epdc signals on some platform like i.MX7D SDB.
However, it's changed from active-low to active-high on i.MX7D SDB RevB board.
Enhance the driver to handle the active level automatically,
then only need to adjust gpio as well as active level in dts file if necessary.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-12051: enable KCONFIG and KCONFIG_PROC
Frank Li [Wed, 6 Jan 2016 22:23:22 +0000 (16:23 -0600)]
MLK-12051: enable KCONFIG and KCONFIG_PROC

Fixed no /proc/config.gz is found in /proc.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
7 years agoMLK-11719-1: imx: config: enable debugfs in mfg_defconfig
Han Xu [Fri, 9 Oct 2015 15:16:24 +0000 (10:16 -0500)]
MLK-11719-1: imx: config: enable debugfs in mfg_defconfig

enable debugfs in mfg_defconfig for mfgtool to read bch layout setting
from debugfs.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit a4a31e73897b51b73b1be994d36759584407914f)

7 years agoMLK-12126 ARM: dts: imx6/imx7d: correct wdog pinctrl setting
Robin Gong [Wed, 6 Jan 2016 03:06:45 +0000 (11:06 +0800)]
MLK-12126 ARM: dts: imx6/imx7d: correct wdog pinctrl setting

We move WDOG_B pinctrl setting from pinctrl_hog to wdog driver, so need to
remove the original setting in pinctl_hog device node, otherwise the below
warning message will be caught:

[    1.284161] imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_LCD_RESET already requested by 20e0000.iomuxc; cannot claim for 20bc000.wdog
[    1.294990] imx6ul-pinctrl 20e0000.iomuxc: pin-69 (20bc000.wdog) status -22
[    1.300689] imx6ul-pinctrl 20e0000.iomuxc: could not request pin 69 (MX6UL_PAD_LCD_RESET) from group wdoggrp  on device 20e0000.iomuxc
[    1.311550] imx2-wdt 20bc000.wdog: Error applying setting, reverse things back

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-12093-2 ARM: imx: correct coding error
Anson Huang [Wed, 6 Jan 2016 10:40:31 +0000 (18:40 +0800)]
MLK-12093-2 ARM: imx: correct coding error

Correct coding error and use macro define instead
of register value.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-12093-1 ARM: imx: adjust latency value of low power idle on imx7d
Anson Huang [Thu, 24 Dec 2015 08:59:17 +0000 (16:59 +0800)]
MLK-12093-1 ARM: imx: adjust latency value of low power idle on imx7d

Per design team's suggestion, when enter/exit DDR PADs low power
mode, ~10us delay is necessary to make sure signal stable enough
for DDR operation, so add ~20us delay(10us margin) and adjust
latency value of low power idle.

Optimize enter/exit self-refresh flow of DDRC according to
design team's suggestion.

Signed-off-by: Anson Huang <Anson.Huang@freescale.com>
7 years agoMLK-12064 can: flexcan: fix timeout when set small bitrate
Dong Aisheng [Mon, 4 Jan 2016 12:55:55 +0000 (20:55 +0800)]
MLK-12064 can: flexcan: fix timeout when set small bitrate

Current we can meet timeout issue when setting a small bitrate
like 10000 as follows:
root@imx6qdlsolo:~# ip link set can0 up type can bitrate 10000
A link change request failed with some changes committed already.
Interface can0 may have been left with an inconsistent configuration,
please check.
RTNETLINK answers: Connection timed out

It is caused by calling of flexcan_chip_unfreeze() timeout.

Originally the code is using usleep_range(10, 20) for unfreeze operation,
but the patch (8badd65 can: flexcan: avoid calling usleep_range from
interrupt context) changed it into udelay(10) which is only a half delay
of before, there're also some other delay changes.

After only changed unfreeze delay back to udelay(20), the issue is gone.
So other timeout values are kept the same as 8badd65 changed.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
7 years agoMA-7253 bcmdhd: avoid null interface before update tx status
Haoran Wang [Wed, 25 Nov 2015 08:48:11 +0000 (16:48 +0800)]
MA-7253 bcmdhd: avoid null interface before update tx status

Avoid to access the null interface before update tx status.

This patch workaround to fix the panic when the p2p connection
disconnect in the p2p stress test. The interface will be
released during the disconnect process.

Fixed coding style issue by Aisheng.

Acked-by: Dong Aisheng <aisheng.dong@freescale.com>
Signed-off-by: Haoran Wang <b50027@freescale.com>
(cherry picked from commit 4e093820e74a83d86f3bb0dadc1054e3ddb8248c)

7 years agoMLK-11794 bcmdhd: prevent driver to use scatter list DMA if host not support
Dong Aisheng [Sat, 31 Oct 2015 08:32:09 +0000 (16:32 +0800)]
MLK-11794 bcmdhd: prevent driver to use scatter list DMA if host not support

Current driver will meet the following warning on MX6SL platform which does
not support ADMA.
It is caused by the driver is using fixed scatter gather DMA not matter whether
the host supports or not. Then the host without ADMA capability will warning
if found the DMA sg_count is non-1.
Change the driver a bit to avoid multi DMA scatter list if found the
host->max_segs is only 1 to fix the issue.

root@imx6slevk:~# udhcpc -i wlan0
udhcpc (v1.23.1) started
Sending discover...
Sending select for 192.168.1.11...
Lease of 192.168.1.11 obtained, lease time 86400
/etc/udhcpc.d/50default: Adding DNS 192.168.1.1
root@imx6slevk:~# ------------[ cut here ]------------
WARNING: CPU: 0 PID: 954 at /home/jenkins/jobs/Standalone-X11_with_mfgtools/workspace/temp_build_dir/build_fsl-imx-internal-x11/tmp/work-shared/imx6slevk/kernel-source/drivers/mmc/host/sdhci.c:839 sdhci_send_command+0xc64/0xd10()
Modules linked in: bcmdhd evbug [last unloaded: bcmdhd]
CPU: 0 PID: 954 Comm: dhd_dpc Tainted: G        W    3.14.52-1.1.0_ga+g76946e8 #1
[<80014a68>] (unwind_backtrace) from [<80011758>] (show_stack+0x10/0x14)
[<80011758>] (show_stack) from [<80720180>] (dump_stack+0x7c/0xbc)
[<80720180>] (dump_stack) from [<80031df8>] (warn_slowpath_common+0x70/0x8c)
[<80031df8>] (warn_slowpath_common) from [<80031eb0>] (warn_slowpath_null+0x1c/0x24)
[<80031eb0>] (warn_slowpath_null) from [<804d5d2c>] (sdhci_send_command+0xc64/0xd10)
[<804d5d2c>] (sdhci_send_command) from [<804d74e8>] (sdhci_request+0xc0/0x1f0)
[<804d74e8>] (sdhci_request) from [<804c218c>] (__mmc_start_req+0x60/0x84)
[<804c218c>] (__mmc_start_req) from [<804c25a4>] (mmc_wait_for_req+0x10/0x20)
[<804c25a4>] (mmc_wait_for_req) from [<7f27ff6c>] (sdioh_request_packet_chain+0x368/0x400 [bcmdhd])
[<7f27ff6c>] (sdioh_request_packet_chain [bcmdhd]) from [<7f280da4>] (sdioh_request_buffer+0x124/0x294 [bcmdhd])
[<7f280da4>] (sdioh_request_buffer [bcmdhd]) from [<7f27f6dc>] (bcmsdh_send_buf+0x94/0x108 [bcmdhd])
[<7f27f6dc>] (bcmsdh_send_buf [bcmdhd]) from [<7f28e98c>] (dhd_bcmsdh_send_buf.constprop.25+0x80/0x220 [bcmdhd])
[<7f28e98c>] (dhd_bcmsdh_send_buf.constprop.25 [bcmdhd]) from [<7f28f454>] (dhdsdio_txpkt.constprop.24+0x928/0xa2c [bcmdhd])
[<7f28f454>] (dhdsdio_txpkt.constprop.24 [bcmdhd]) from [<7f28f6b0>] (dhdsdio_sendfromq+0x158/0x3c4 [bcmdhd])
[<7f28f6b0>] (dhdsdio_sendfromq [bcmdhd]) from [<7f2913d4>] (dhdsdio_dpc+0x2e8/0x1034 [bcmdhd])
[<7f2913d4>] (dhdsdio_dpc [bcmdhd]) from [<7f24a270>] (dhd_dpc_thread+0xe8/0x124 [bcmdhd])
[<7f24a270>] (dhd_dpc_thread [bcmdhd]) from [<8004ca6c>] (kthread+0xcc/0xe4)
[<8004ca6c>] (kthread) from [<8000e500>] (ret_from_fork+0x14/0x34)

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
(cherry picked from commit 77ff69e3d3a82c4fcf2d6c6d2a904d4fc1793542)

7 years agoMLK-11833 bcmdhd: pull back sdpcm_hdrlen length from old skb for new skb
Dong Aisheng [Thu, 5 Nov 2015 07:52:09 +0000 (15:52 +0800)]
MLK-11833 bcmdhd: pull back sdpcm_hdrlen length from old skb for new skb

Pull back sdpcm_hdrlen length from old skb as new skb here
is passed to postprocessing.
This is a generic fix. We must have it regardless of host is
non scatter-gather or scatter gather capable.

Suggested by: Vinayak Kamath <vinayak.kamath@broadcom.com>
Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
(cherry picked from commit 45c96b8881eaa2b073b9dfa2a44229accd7409b7)
(cherry picked from commit b72fea1818e92d18affe88a90f6f2460eab74360)

7 years agoMLK-11790 dts: imx6: fix wlreg_on regulator always on issue
Dong Aisheng [Thu, 29 Oct 2015 09:37:51 +0000 (17:37 +0800)]
MLK-11790 dts: imx6: fix wlreg_on regulator always on issue

wlreg_on regulator always on will make WiFi module unable to do reset
during rmmod, then the re-insmod will fail.

In stead of make wlreg_on always on, we make vmmc regulator always on
for BT to work properly.
Then WiFi can still function well on wlreg_on regulator enable/disable.

Fixes: commit f17b5e5be (dts: mx6ul evk: set regulator wlreg_on always on)
Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
(cherry picked from commit e92b727494b10c7a13e9491f55fc07a7ed7622a3)

7 years agoMLK-12054-2 defconfig: enable MIPI DSI for i.MX6QDL
Robby Cai [Mon, 4 Jan 2016 11:26:31 +0000 (19:26 +0800)]
MLK-12054-2 defconfig: enable MIPI DSI for i.MX6QDL

Enable MIPI DSI option

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-12054-1 media: video: fix multiple definition error in MIPI DSI driver
Robby Cai [Mon, 4 Jan 2016 11:19:59 +0000 (19:19 +0800)]
MLK-12054-1 media: video: fix multiple definition error in MIPI DSI driver

When enable CONFIG_FB_MXC_MIPI_DSI, meet following compiling error.

drivers/video/fbdev/mxc/mipi_dsi_samsung.o: In function `mipi_dsi_pkt_write':
mipi_dsi_samsung.c:(.text+0x818): multiple definition of `mipi_dsi_pkt_write'
drivers/video/fbdev/mxc/mipi_dsi.o:mipi_dsi.c:(.text+0xa74): first defined here
drivers/video/fbdev/mxc/mipi_dsi_samsung.o: In function `mipi_dsi_pkt_read':
mipi_dsi_samsung.c:(.text+0x9d8): multiple definition of `mipi_dsi_pkt_read'
drivers/video/fbdev/mxc/mipi_dsi.o:mipi_dsi.c:(.text+0xc5c): first defined here
drivers/video/fbdev/mxc/mipi_dsi_samsung.o: In function `mipi_dsi_dcs_cmd':
mipi_dsi_samsung.c:(.text+0xa88): multiple definition of `mipi_dsi_dcs_cmd'
drivers/video/fbdev/mxc/mipi_dsi.o:mipi_dsi.c:(.text+0xdb0): first defined here
make[4]: *** [drivers/video/fbdev/mxc/built-in.o] Error 1
make[3]: *** [drivers/video/fbdev/mxc] Error 2
make[2]: *** [drivers/video/fbdev] Error 2
make[1]: *** [drivers/video] Error 2

move three dsi packet related functions to mipi_dsi_info
structure. This will avoid the multiple definition compiling
issue. This is what the commit f54c7527895575a2e474b17a4752724977b898ea does
in 3.14.y

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-12103 media: capture: ov5640_mipi: add more delay for camera to stay stable
Robby Cai [Mon, 4 Jan 2016 09:20:02 +0000 (17:20 +0800)]
MLK-12103 media: capture: ov5640_mipi: add more delay for camera to stay stable

For power saving, the camera is set ON/OFF by 'PWDN' pin.
However, the DQBUF timeout problems have been observed occasionally when
do the resolution switch for the camera. The reason could be that the power
for the camera is set to off then on when do the switch, but the delay time
is not enough for camera to go stable. The patch sets it to an empirical
value and it has passed over 3-day stress test.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-11759 mxc IPUv3: common: Config IPU_CONF correctly in ipu_enable_channel()
Liu Ying [Mon, 4 Jan 2016 02:49:17 +0000 (10:49 +0800)]
MLK-11759 mxc IPUv3: common: Config IPU_CONF correctly in ipu_enable_channel()

The register IPU_CONF contains several dedicated enable bits for IPU internal
modules.  When we enable an IPU logic channel, e.g., MEM_BG_SYNC, by calling
the function ipu_enable_channel(), we should enable the necessary IPU internal
modules for that logic channel instead of touching other irrelevant modules.
This may most definitely keep the steps for enabling a logic channel steady
if no IPU internal module is shared by different logic channels.

An known issue is caused by breaking this rule: we are likely to switch the
display pixel clock source from IPU internal HSP clock to external clock when
enabling a display which is driven by MEM_BG_SYNC.  This operation is safe if
the relevant DI enable bit in IPU_CONF is zero.  In case another task, e.g.,
MEM_PP_MEM, is being enabled in parallel, it may accidently set the DI enable
bit to one before the pixel clock source is switched, which may cause the
display engine malfunction.  To fix this issue, this patch configures the
register IPU_CONF correctly in the function ipu_enable_channel() according to
specific IPU logic channels.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-12081 ARM: dts: imx6qp-sabresd: remove the power on gpio
Richard Zhu [Mon, 28 Dec 2015 06:11:26 +0000 (14:11 +0800)]
MLK-12081 ARM: dts: imx6qp-sabresd: remove the power on gpio

In regulator implementation, the gpio power on is used
as the fixed regulator, it is already manipulated by
the regulator driver, and always enabled.
Remove the power on gpio in pcie dts

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
7 years agoMGS-1274-2 gpu: Integrate 5.0.11.p8 kernel driver
Xianzhong [Thu, 31 Dec 2015 09:32:44 +0000 (17:32 +0800)]
MGS-1274-2 gpu: Integrate 5.0.11.p8 kernel driver

Integrate the kernel part for 5.0.11.p8 gpu driver release

Signed-off-by: Xianzhong <b07117@freescale.com>
7 years agoMLK-10456-2 ata: imx: add the reset for 6qp sata
Richard Zhu [Fri, 13 Mar 2015 07:38:56 +0000 (15:38 +0800)]
MLK-10456-2 ata: imx: add the reset for 6qp sata

- add the sata phy power down and phy reset for 6qp
sata

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit b1270554354d46cf7676e354e63ec4f11766e6f6)

7 years agoMLK-11681-2 ata: imx: enable sata on imx6qp
Richard Zhu [Fri, 9 Oct 2015 06:43:24 +0000 (14:43 +0800)]
MLK-11681-2 ata: imx: enable sata on imx6qp

Since the version of the imx6qp's ahci controller
is same to the version of imx6q ahci controller.
So, this work-around should be applied to imx6qp
ahci too.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit 31a7eab5be9843263535306dbaa08592b66714e5)

7 years agoMLK-11681-1 ARM: imx: enable sata on imx6qp sdb board
Richard Zhu [Fri, 9 Oct 2015 06:41:10 +0000 (14:41 +0800)]
MLK-11681-1 ARM: imx: enable sata on imx6qp sdb board

enable sata support on imx6qp sdb board.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit 8b08d0e657a121136eebe5bb6a998b7c9a6bff25)

7 years agoMLK-12087 ARM: dts: imx6ul-9x9-evk.dts: add dual-role support for otg port
Peter Chen [Mon, 28 Dec 2015 06:24:11 +0000 (14:24 +0800)]
MLK-12087 ARM: dts: imx6ul-9x9-evk.dts: add dual-role support for otg port

Add dual-role support for imx6ul-9x9 evk board, the full otg function
is not supported at this board due to the vbus can't be controlled
by software.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
7 years agoMLK-12080 fbcon: System hang when calling fb_new_modelist()
Sandor Yu [Thu, 17 Jul 2014 12:41:14 +0000 (20:41 +0800)]
MLK-12080 fbcon: System hang when calling fb_new_modelist()

System will hang when calling fb_new_modelist() function from hdmi driver.

Hang logs:
Unable to handle kernel NULL pointer dereference at virtual address 000000e0
pgd = 80004000
[000000e0] *pgd=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 90 Comm: kworker/0:3 Not tainted 4.1.8-01364-gd02137c #6
CPU: 0 PID: 90 Comm: kworker/0:3 Not tainted 4.1.8-01364-gd02137c #6
00000e0
mmended
se run fsck.
42.254
irq=-1)
omuxc
 (307Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)  l
Workqueue: events hotplug_worker
task: a8381c80 ti: a8512000 task.ti: a8512000
PC is at fbcon_new_modelist+0xcc/0xe8
LR is at fbcon_new_modelist+0xcc/0xe8
pc : [<802e23f4>]    lr : [<802e23f4>]    psr: 600b0013
sp : a8513c60  ip : a829122c  fp : 80ac6e6c
pc : [<802e23f4>]    lr : [<802e23f4>]    psr: 600b0013
sp : a8513c60  ip : a829122c  fp : 80ac6e6c
.254
irq=-1)
omuxc
 (307r10: 00000000  r9 : 80ade1f8  r8 : a8291000
r7 : 80b80b75  r6 : 80b85080  r5 : 80b80c2c  r4 : 00000002
r7 : 80b80b75  r6 : 80b85080  r5 : 80b80c2c  r4 : 00000002
a8513c60  ip : a829122c  fp : 80ac6e6c
.254

.......

irq=-1)
omuxc
 (3073f0000000000 80046328 a8512000 ab707380 ab707394 ab707380 a8497198 ab707394
3f20: a8512000 00000008 80b2b2b9 a8497180 ab707380 80046640 80ac6100 ab7074e4
3f40: a8497180 00000000 a84bef00 a8497180 800465f4 00000000 00000000 00000000
3f60: 00000000 8004b588 6d6ddb89 00000000 75cfbfda a8497180 00000000 00000000
3f80: a8513f80 a8513f80 00000000 00000000 a8513f90 a8513f90 a8513fac a84bef00
3fa0: 8004b4ac 00000000 00000000 8000f528 00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
29122c  fp : 80ac6e6c
.254
irq=-1)
omuxc
 (3073fe000000000 00000000 00000000 00000000 00000013 00000000 68f31fff f537ef6b
[<802e23f4>] (fbcon_new_modelist) from [<802e6034>] (fbcon_event_notify+0x16c/0x958)
[<802e6034>] (fbcon_event_notify) from [<8004bff0>] (notifier_call_chain+0x44/0x84)
[<8004bff0>] (notifier_call_chain) from [<8004c34c>] (__blocking_notifier_call_chain+0x48/0x60)
[<8004c34c>] (__blocking_notifier_call_chain) from [<8004c37c>] (blocking_notifier_call_chain+0x18/0x20)
[<8004c37c>] (blocking_notifier_call_chain) from [<802ec1c4>] (fb_new_modelist+0xe4/0xf8)
[<802ec1c4>] (fb_new_modelist) from [<802f7f08>] (hotplug_worker+0x1cc/0x2f4)
[<802f7f08>] (hotplug_worker) from [<80046328>] (process_one_work+0x118/0x3e4)
[<80046328>] (process_one_work) from [<80046640>] (worker_thread+0x4c/0x4f4)
[<80046640>] (worker_thread) from [<8004b588>] (kthread+0xdc/0xf4)
[<8004b588>] (kthread) from [<8000f528>] (ret_from_fork+0x14/0x2c)
Code: eb003570 e1a01000 e28d0008 eb0034f7 (e1da2eb0)

The root cuase is fbcon driver access null pointer vc in the function of
fbcon_new_modelist().
Add null pointer check vc to fix the issue.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit 3bea30ff471c8fc1e546be26a8625e6aa425d5aa)
(cherry picked from commit ddfd6b989071e38955855351556f518b1600944d)
(cherry picked from commit 608a206caffa8abbd6bd099b9bd592cc227116c1)

7 years agoMLK-12088 ARM: imx: low power idle support for imx7d single core
Anson Huang [Mon, 28 Dec 2015 14:38:26 +0000 (22:38 +0800)]
MLK-12088 ARM: imx: low power idle support for imx7d single core

When only single core online for i.MX7D, the secondary core wfi
flag should be set to make sure low power idle can be entered when
last core enters wfi. Otherwise, DDR/CCM/ANATOP will NOT enter
low power mode as the secondary core wfi flag is always clear;

Make sure the last power up slot do the ack for single core case.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
7 years agoMLK-12092: mxc_edid: Free mode buffer before function return
Sandor Yu [Mon, 28 Dec 2015 09:45:16 +0000 (17:45 +0800)]
MLK-12092: mxc_edid: Free mode buffer before function return

Free mode buffer before function return to avoid memory leak.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
7 years agoMLK-12086-3 dts: imx6: enable sdio wakeup for corresponding boards
Dong Aisheng [Mon, 13 Jan 2014 09:00:46 +0000 (17:00 +0800)]
MLK-12086-3 dts: imx6: enable sdio wakeup for corresponding boards

Enable the sdio wakeup capability for SDIO cards.
Note: we do not enable it for sabresd usdhc4 since it has a solid
eMMC card on it.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 9ea7e84fe686a5c959aebbbf4a1b81dcb1c3e3fd)
(cherry picked from commit 58a5347a1b3a6b8970ac7ddc8e336c5d9adf4ddb)
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12086-2 dts: imx6: enable keep power capability for corresponding boards
Dong Aisheng [Mon, 13 Jan 2014 08:20:55 +0000 (16:20 +0800)]
MLK-12086-2 dts: imx6: enable keep power capability for corresponding boards

All i.MX6 SabreAuto/SabreSD/EVK has the ability to keep card power
during suspend. So add this capability for them.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 3f18df4746eb33e934c55de23d6496bb4adad33b)
(cherry picked from commit 55553b7300fb3d0e3a7961f569a42bd689b3670f)
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12086-1 dts: imx6qdl-sabreauto: use external vmmc for sd3 optionally
Dong Aisheng [Fri, 10 Jan 2014 13:31:21 +0000 (21:31 +0800)]
MLK-12086-1 dts: imx6qdl-sabreauto: use external vmmc for sd3 optionally

SD3.0 cards require power cycle the card during suspend/resume,
or the card re-enumeration after resume will fail to be identified
as UHS card since the card is already working on 1.8v mode and refuse
to ack the S18R request, thus, it will then work on normal high speed
mode instead.

We have to use external vmmc regulator to power cycle the card during
suspend/resume to reset card signal voltage to 3.3v frist for the later
1.8v voltage switch.

However, due to the sabreauto board limitation, we can not use external
regulator to powere off card by default since the card power is shared
with card detect pullup. Disabling the vmmc regulator will also shutdown
the cd pullup which causes incorrect illusion of card exist.
(e.g. plug out the card, mmc core wll think the card is exist since cd pin
is low but it never can find the card)
HW rework removing R695 and enable PAD internal pullup is needed to
fix this isssue.

User can manually open the mask of vmmc in dts to enable using external
regulator if your board has done the rework as said above.
Or by default we still do not power off card during suspend.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 2fd1bf9320bce1c22f2406c74277b7422653511e)
(cherry picked from commit 0804d85c137129db17766c3f4e236ae722d9b7db)

7 years agoMLK-12084 ARM: config: imx: Add interactive governor build-in support in defconfig
Bai Ping [Mon, 28 Dec 2015 04:19:47 +0000 (12:19 +0800)]
MLK-12084 ARM: config: imx: Add interactive governor build-in support in defconfig

Enable the interactive governor in defconfig to be compiled into the kernel.
The default cpufreq governor is still ondemand governor.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMove x86_64 idle notifiers to generic
Todd Poynor [Thu, 16 Jun 2011 00:21:57 +0000 (17:21 -0700)]
Move x86_64 idle notifiers to generic

Move the x86_64 idle notifiers originally by Andi Kleen and Venkatesh
Pallipadi to generic.

Change-Id: Idf29cda15be151f494ff245933c12462643388d5
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
7 years agocpufreq: Add android's 'interactive' governor
Viresh Kumar [Tue, 17 May 2016 09:11:22 +0000 (14:41 +0530)]
cpufreq: Add android's 'interactive' governor

Interactive governor has lived in Android sources for a very long time
and this commit is based on the code present in following branch:

https://android.googlesource.com/kernel/common android-4.4

The Interactive governor is designed for latency-sensitive workloads,
such as interactive user interfaces like the mobile phones and tablets.
The interactive governor aims to be significantly more responsive to
ramp CPU quickly up when CPU-intensive activity begins.

Existing governors sample CPU load at a particular rate, typically every
X ms and then update the frequency from a work-handler.  This can lead
to under-powering UI threads for the period of time during which the
user begins interacting with a previously-idle system until the next
sample period happens.

The 'interactive' governor uses a different approach.

A real-time thread is used for scaling up, giving the remaining tasks
the CPU performance benefit, unlike existing governors which are more
likely to schedule ramp-up work to occur after your performance starved
tasks have completed.

The Android version of interactive governor also checks whether to scale
the CPU frequency up soon after coming out of idle.  When the CPU comes
out of idle, the governor check if the CPU sampling is overdue or not.
If yes, it immediately starts the sampling.  Otherwise, the utilization
hooks from the scheduler handle the sampling later.  If the CPU is very
busy from exiting idle to when the evaluation happens, then it assumes
that the CPU is under-powered and ramps it to MAX speed.

If the CPU was not sufficiently busy to immediately ramp to MAX speed,
then the governor evaluates the CPU load since the last speed
adjustment, choosing the highest value between that longer-term load or
the short-term load since idle exit to determine the CPU speed to ramp
to.

Idle notifiers will be be handled later and are not included for now.

The core of this code is written and maintained (in Android
repositories) by Mike Chan and Todd Poyner over a long period of time.

Vireshk has made changes to to the governor to align it with the current
practices followed with mainline governors, like using utilization hooks
from the scheduler and handling kobject (for governor's sysfs directory)
in a race free manner. And of course this included general cleanup of
the governor as well.

Signed-off-by: Mike Chan <mike@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V1->V2:
- Changes to fix compilation issues with updated mainline
- Timer APIs got updated
 - s/mod_timer_pinned/mod_timer
 - s/init_timer/init_timer_pinned
- Updated prototypes of cpufreq_frequency_table_target() and
  update_util_handler()

7 years agocpufreq: Move gov_attr_* macros to cpufreq.h
Viresh Kumar [Tue, 17 May 2016 07:27:06 +0000 (12:57 +0530)]
cpufreq: Move gov_attr_* macros to cpufreq.h

These macros can be reused by governors which don't use the common
governor code present in cpufreq_governor.c and should be moved to the
relevant header.

Now that they are getting moved to the right header file, reuse them in
schedutil governor as well (that required rename of show/store
routines).

Also create gov_attr_wo() macro for write-only sysfs files, this will be
used by Interactive governor in a later patch.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
7 years agoMLK-12072 thermal: imx: enable tempmon finish bit check on imx7d TO1.1
Bai Ping [Wed, 23 Dec 2015 08:52:57 +0000 (16:52 +0800)]
MLK-12072 thermal: imx: enable tempmon finish bit check on imx7d TO1.1

On i.MX7D TO1.0, the finish bit in tempmon module used for verify
the temp value is broken, so it can NOT be used for checking the temp
value. On TO1.1, this issue has been fixed, so we can use this bit
to verify if the temp value is valid.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
7 years agoMLK-12076-3: dma: imx-sdma: add imx6ul device type
Robin Gong [Fri, 25 Dec 2015 02:06:27 +0000 (10:06 +0800)]
MLK-12076-3: dma: imx-sdma: add imx6ul device type

Add imx6ul device type to enable the ERR008517 workaround or not by dts.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 17d6a090b7a39bfd7836a3685d20201dcb0fa25e)

7 years agoMLK-12076-2: firmare: imx: sdma: update ecspi tx script for ERR008517
Robin Gong [Fri, 25 Dec 2015 02:02:44 +0000 (10:02 +0800)]
MLK-12076-2: firmare: imx: sdma: update ecspi tx script for ERR008517

Since ERR008517(TKT238285) fixed on i.mx6ul, we need change script to
compatible all i.mx6 chips.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 6970e2b497621e3f2fc4005d06bb8ca76d234074)

7 years agoMLK-12060 media: output: pxp_v4l2: Add filter function for dma_request_channel
Robby Cai [Fri, 25 Dec 2015 06:04:54 +0000 (14:04 +0800)]
MLK-12060 media: output: pxp_v4l2: Add filter function for dma_request_channel

Without the filter function, the dma_request_channel() API could possibly get
a sdma channel. The dma_request_channel() API does not return error but the
consequent operations on that channel will be invalid then the upper level
application expects to be stuck.

The patch added the filter functions to get right dma channel for the fix.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
7 years agoMLK-12075 ARM: dts: remove imx7d-sdb-touch.dts
Haibo Chen [Thu, 24 Dec 2015 08:36:51 +0000 (16:36 +0800)]
MLK-12075 ARM: dts: remove imx7d-sdb-touch.dts

For imx7d-sdb TO1.1 board, the touch interrupt pin no
longer conflict with HDMI, so move touch support to
imx7d-sdb.dts. To compatible with TO1.0 board, still
use imx7d-sdb-reva-touch.dts to support touch.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12058 ARM: dts: add audio support for imx7d-sdb revb board
Zidan Wang [Tue, 22 Dec 2015 06:15:13 +0000 (14:15 +0800)]
MLK-12058 ARM: dts: add audio support for imx7d-sdb revb board

add audio support for imx7d-sdb revb board.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit e92712590a3572264283a4af90b54d3f195d3b4e)

7 years agoMLK-12057 ASoC: imx-wm8960: add headphone/micphone/headset jack support
Zidan Wang [Tue, 22 Dec 2015 06:04:04 +0000 (14:04 +0800)]
MLK-12057 ASoC: imx-wm8960: add headphone/micphone/headset jack support

Add headphone/micphone/headset jack support for different board.

There are headphone detect gpio and microphone detect gpio which
can be configured from device tree.
If headphone and microphone using the same gpio for jack detect,
it suppose to be a headset and will register a headphone jack for it.
If headphone and microphone using different gpio for jack detect,
it suppose not to be a headset, and will register headphone jack
and microphone jack respectively.

Is't not appropriate to set the adc data output in machine driver.
It will not be compatibly when we change hardware connection.
wm8960 codec driver has added "ADC Data Output Select" kcontrol,
so that we can set the ADC data output from user space.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 92f65b4bee51fabdfa3a3c191f511c2ec7cb18a1)

7 years agoMLK-12062: ov5647: Fix imx7d mipi csi phy failed to detect signal
Sandor Yu [Tue, 22 Dec 2015 08:08:28 +0000 (16:08 +0800)]
MLK-12062: ov5647: Fix imx7d mipi csi phy failed to detect signal

The patch is to fix the issue,
mipi csi unit test mx6s_v4l2_capture.out can not work in 2nd time.

In ov5647 driver, clock and data lane will been setting to LP11 mode
when stream off. And the mode will been changed to LP00 mode
at the begin of ov5647 initialization.
If MIPI CSI DPHY in power on state, it will begin to work after
clock and data lane level changed, even ov5647 is not ready.
MIPI PHY may lose ov5647 signal.

Fixed the issue with:
i.  Stream off ov5647 when ov5647 driver probe.
ii. Add 5ms delay after software reset bit set.
iii.Setting both clock and data lane in LP00 when stream off.

Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit d351a9b3ad46309354a30b256be1a39c339effcd)

7 years agoMLK-12065 ARM: imx: imx7d: enable enet mdio open drain
Fugang Duan [Mon, 21 Dec 2015 09:58:42 +0000 (17:58 +0800)]
MLK-12065 ARM: imx: imx7d: enable enet mdio open drain

The management data input/output (MDIO) bus where often high-speed,
open-drain operation is required. i.MX7D TO1.0 ENET MDIO pin has no
open drain as IC ticket number: TKT252980, i.MX7D TO1.1 fix the issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit: a747abd5f01d278b91d1b6ee6628e1935cb7b23c)

Conflicts:
arch/arm/mach-imx/mach-imx7d.c

7 years agoMLK-12046-2 ARM: dts: imx6sl-evk.dts: add elan touch support
Haibo Chen [Tue, 22 Dec 2015 05:43:52 +0000 (13:43 +0800)]
MLK-12046-2 ARM: dts: imx6sl-evk.dts: add elan touch support

Add elan touch screen support on imx6sl-evk board.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12046-1 imx_v7_defconfig: add elan touch screen support
Haibo Chen [Tue, 22 Dec 2015 07:57:07 +0000 (15:57 +0800)]
MLK-12046-1 imx_v7_defconfig: add elan touch screen support

Currently, we just use driver elan_ts.c, not elants_i2c.c. So this
patch change this.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-10142-1 touchscreen: elan: add elan touch screen driver support
Haibo Chen [Mon, 26 Jan 2015 05:30:40 +0000 (13:30 +0800)]
MLK-10142-1 touchscreen: elan: add elan touch screen driver support

Add elan touch screen driver in linux kernel.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
(cherry picked from commit 20180719c54760359d78544d55e4ac1fabaf6e8b)

7 years agoMLK-12047-3 imx_v7_defconfig: add imx7d_adc support
Haibo Chen [Tue, 22 Dec 2015 09:28:28 +0000 (17:28 +0800)]
MLK-12047-3 imx_v7_defconfig: add imx7d_adc support

Add imx7d_adc, default build into kernel

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12043: ASoC: fsl: imx-cs42888: Add return value check
Shengjiu Wang [Tue, 22 Dec 2015 08:57:06 +0000 (16:57 +0800)]
MLK-12043: ASoC: fsl: imx-cs42888: Add return value check

Report by coverity (CID 18428). The return value need be checked
for snd_soc_dai_set_sysclk().

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
7 years agoMLK-12047-1 ARM: dts: imx6sx-sabreauto.dts: add ADC support
Haibo Chen [Mon, 21 Dec 2015 10:06:01 +0000 (18:06 +0800)]
MLK-12047-1 ARM: dts: imx6sx-sabreauto.dts: add ADC support

Add ADC support for imx6sx-sabreauto board.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12042 ARM: dts: imx6sl.dtsi: add mmc aliase
Haibo Chen [Mon, 21 Dec 2015 02:50:48 +0000 (10:50 +0800)]
MLK-12042 ARM: dts: imx6sl.dtsi: add mmc aliase

This patch add mmc aliase support, to make every sd slot index
fixed.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12049 ARM: dts: imx6qdl-sabreauto.dtsi: add usdhc1 support
Haibo Chen [Mon, 21 Dec 2015 03:22:38 +0000 (11:22 +0800)]
MLK-12049 ARM: dts: imx6qdl-sabreauto.dtsi: add usdhc1 support

Add usdhc1 support for the baseboard.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-12035 dts: imx7d-sdb-revb: add i.MX7d sdb revb support
Fugang Duan [Fri, 18 Dec 2015 04:05:44 +0000 (12:05 +0800)]
MLK-12035 dts: imx7d-sdb-revb: add i.MX7d sdb revb support

Base on i.MX7d sdb revb board change list, below modules has changed:
 - enet2 and epdc enable pin
 - usb_otg2 pwr enable pin
 - ov5647_mipi pwr pin
 - tsc2046 touch pendown pin
 - uart5 tx/rx pins
 - sensor INT pin
 - pcie power is controlled by por_b, not gpio_spi pin6
 - hdmi audio change to SAI3 from SAI1

The patch add the changes for revb, and keep the original functions for
reva board. Remove redundancy sim and enet dts files to avoid excessive
dts file for reva and revb.

After the patch, there have below diff:
- default dts file: imx7d-sdb.dts for revb board, imx7d-sdb-reva.dts for reva board
- remove enet, sim extended dts files, so these modules are enabled in default dts
  file for reva and revb board.

The change of expanded dts due to pin confliction:
- Keep the original expanded name of dts file for revb board, add suffix "-reva" in dts
  file name for reva board.
- Like:
  hdmi/codec audio:
    hdmi audio and wm8960 codec are enabled in default dts file for revb board,
    no extended dts files to separate them.
    Keep original extended dts files for reva board:
imx7d-sdb-reva-hdmi-audio.dts
imx7d-sdb-reva-wm8960.dts
  epdc:
    imx7d-sdb-epdc.dts is for revb board, imx7d-sdb-reva-epdc.dts is for reva board.
  gpmi-weim:
    imx7d-sdb-gpmi-weim.dtsi for revb, imx7d-sdb-reva-gpmi-weim.dtsi for reva.
  m4:
    imx7d-sdb-m4.dts for revb, imx7d-sdb-reva-m4.dts for reva.
  qspi:
    imx7d-sdb-qspi.dts for revb, imx7d-sdb-reva-qspi.dts for reva.
  touchscreen:
    imx7d-sdb-touch.dts for revb, imx7d-sdb-reva-touch.dts for reva.

Cherry picked from commit: 2be1a236696d, and disable sai3 since there have many
Transmit underrun on kernel 4.1.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Acked-by: Robby Cai <robby.cai@nxp.com>
Acked-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Chen Bough <Haibo.Chen@freescale.com>
Conflicts:
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/imx7d-sdb-epdc.dts
arch/arm/boot/dts/imx7d-sdb-gpmi-weim.dtsi
arch/arm/boot/dts/imx7d-sdb-m4.dts
arch/arm/boot/dts/imx7d-sdb-reva-epdc.dts
arch/arm/boot/dts/imx7d-sdb-touch.dts
arch/arm/boot/dts/imx7d-sdb.dts

7 years agoMLK-11920 video: fbdev: mxc ipuv3 fb: Use fb_set_var() to unblank a framebuffer
Liu Ying [Tue, 8 Dec 2015 09:20:16 +0000 (17:20 +0800)]
MLK-11920 video: fbdev: mxc ipuv3 fb: Use fb_set_var() to unblank a framebuffer

The resolution of an overlay framebuffer could be at most the same to the
one of the relevant background framebuffer.  However, the resolution of a
HDMI monitor could be changed at runtime.  Thus, when we unblank the overlay
framebuffer, we should check it's resolution and start position in case it
exceeds the boundary of the background framebuffer.  This patch replaces
mxcfb_set_par() with fb_set_var() to implement the unblank operation so that
the logic contains the ->fb_check_var() path.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
7 years agoMLK-12036 imx: config: add the i.MX6UL config in imx_v7_mfg_defconfig
Han Xu [Thu, 17 Dec 2015 19:57:08 +0000 (13:57 -0600)]
MLK-12036 imx: config:  add the i.MX6UL config in imx_v7_mfg_defconfig

i.MX6UL config was missed in the imx_v7_mfg_defconfig, add it for
mfgtool.

Signed-off-by: Han Xu <b45815@freescale.com>
7 years agoMLK-12033 ARM: dts: imx6qdl-sabreauto: add enet irq dts files to avoid conflict with MLB
Fugang Duan [Thu, 17 Dec 2015 03:32:40 +0000 (11:32 +0800)]
MLK-12033 ARM: dts: imx6qdl-sabreauto: add enet irq dts files to avoid conflict with MLB

ENET gpio irq pin conlict with MLB on i.MX6qdl sabreauto board, since enet
gpio irq is extended feature for performance improvement, so let MLB enable
in default dts file and newly create sabreauto enet irq dts files.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-12027: ARM: dts: fix the sample rate clock not accurate for spdif tx
Shengjiu Wang [Wed, 16 Dec 2015 05:16:39 +0000 (13:16 +0800)]
MLK-12027: ARM: dts: fix the sample rate clock not accurate for spdif tx

Clock of spdif tx is derived from clk_ipg and clk_osc, which is not the
integer multiple size of sample rate, can't generate accurate clock for
each sample rate. Use pll4 as the clk_spdif's parent, because the clk_spdif
is the one of source clock of tx, use a proper frequency for pll4, then it
can generate more accurate clock for sample rate (32k,48k,96k,192k).

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
7 years agoMLK-11526-2 ARM: dts: add imx6qp sabresd board ldo enable support
Anson Huang [Wed, 9 Sep 2015 14:19:06 +0000 (22:19 +0800)]
MLK-11526-2 ARM: dts: add imx6qp sabresd board ldo enable support

Add LDO enable mode support for i.MX6QP SabreSD board.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 4107e9c4f3d8f654e75770da0a8ed7f158c3e468)

7 years agoMLK-12016-5 dts: imx6sx-sabreauto: add flexcan support
Dong Aisheng [Wed, 16 Dec 2015 10:30:21 +0000 (18:30 +0800)]
MLK-12016-5 dts: imx6sx-sabreauto: add flexcan support

The CAN transceiver on MX6SX Sabreauto board seems in sleep mode
by default after power up the board. User has to press the wakeup
key on ARD baseboard before using the transceiver, or it may not
work properly when power up the board at the first time(warm reset
does not have such issue).

This patch operates the wake pin too besides stby/en pins by chaining
them together in regulator mode.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-12016-4 dts: imx6: remove flexcan for pin conflict devices
Dong Aisheng [Wed, 16 Dec 2015 03:23:28 +0000 (11:23 +0800)]
MLK-12016-4 dts: imx6: remove flexcan for pin conflict devices

Removing flexcan for pin conflict devices such as ecspi/gpmi.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-12016-3 dts: sabreauto: add flexcan support
Dong Aisheng [Wed, 6 Nov 2013 11:37:38 +0000 (19:37 +0800)]
MLK-12016-3 dts: sabreauto: add flexcan support

The flexcan1 is pin conflict with fec. So we add a new dts file with
flexcan1 enabled with fec disabled for user to use.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-12016-2 dts: imx6sx: add flexcan stop mode support
Dong Aisheng [Mon, 24 Feb 2014 06:35:52 +0000 (14:35 +0800)]
MLK-12016-2 dts: imx6sx: add flexcan stop mode support

Add flexcan stop mode support.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMLK-12016-1 dts: imx6sx-sdb: add flexcan support
Dong Aisheng [Tue, 15 Dec 2015 12:10:15 +0000 (20:10 +0800)]
MLK-12016-1 dts: imx6sx-sdb: add flexcan support

CAN transceiver is different on RevA and RevB board.
It's active high on RevA while active low on Rev B.

Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
7 years agoMGS-1360 fix gpu kernel driver with built-in mode
Xianzhong [Wed, 16 Dec 2015 10:17:06 +0000 (18:17 +0800)]
MGS-1360 fix gpu kernel driver with built-in mode

gpu kernel driver is loadable by default, change to built-in mode.

Signed-off-by: Xianzhong <b07117@freescale.com>
7 years agoMLK-12029 ARM: dts: imx6qp-sabreauto.dts: add vmmc supply for usdhc3
Haibo Chen [Wed, 16 Dec 2015 10:00:30 +0000 (18:00 +0800)]
MLK-12029 ARM: dts: imx6qp-sabreauto.dts: add vmmc supply for usdhc3

For imx6qp-ard board, it is okay to use external regulator for card slot,
so this patch add vmmc-supply for usdhc3.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>