]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agousb: chipidea: udc: manage dynamic amount of tds with a linked list
Michael Grzeschik [Thu, 13 Jun 2013 14:59:53 +0000 (17:59 +0300)]
usb: chipidea: udc: manage dynamic amount of tds with a linked list

Instead of having a limited number of usable tds in the udc we use a
linked list to support dynamic amount of needed tds for all special
gadget types. This improves throughput.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: improve kconfig
Peter Chen [Thu, 13 Jun 2013 14:59:52 +0000 (17:59 +0300)]
usb: chipidea: improve kconfig

Randy Dunlap <rdunlap@infradead.org> reported this problem
on i386:

> drivers/built-in.o: In function `ci_hdrc_host_init':
> (.text+0x2ce75c): undefined reference to `ehci_init_driver'
>
> When USB_EHCI_HCD=m and USB_CHIPIDEA=y.

In fact, this problem is existed on all platforms which are using
chipidea driver. The root cause of this problem is the chipidea host
uses symbol exported from ehci-hcd, but chipidea core
does not depends on USB_EHCI_HCD. So, chipidea driver
will not be compiled as module if USB_EHCI_HCD=m.

It is very hard to give a perfect solution since chipidea core
depends on USB || USB_GADGET, and chipdiea host depends on
both USB_EHCI_HCD and USB_CHIPIDEA, the same problem exists for
gadget.

To fix this problem, we had to have below assumptions:

- If USB_EHCI_HCD=y && USB_GADGET=y, USB_CHIPIDEA can be 'y'.

- If USB_EHCI_HCD=m && USB_GADGET=y, USB_CHIPIDEA=m
or USB_CHIPIDEA_HOST can't be seen if USB_CHIPIDEA=y.
It will cause compile error due to no glue layer for ehci:

> error: #error "missing bus glue for ehci-hcd"

So, we had to compile USB_CHIPIDEA=m if USB_EHCI_HCD=m,
current ehci hcd core guarantee it.

- If USB_EHCI_HCD=y && USB_GADGET=m, USB_CHIPIDEA=m
or USB_CHIPIDEA_UDC can't be seen if USB_CHIPIDEA=y.
Of cos, the gadget will out of working at this situation,
so the user had to compile USB_CHIPIDEA=m.

- USB_EHCI_HCD=m && USB_GADGET=m, we can't see
USB_CHIPIDEA_HOST and USB_CHIPIDEA_UDC unless
USB_CHIPIDEA=m.

The reason why it has above assumptions:
- If both ehci core and gadget core build as module,
the chipidea has to build as module.
- If one of ehci core or gadget core is built in, another
is built as module, we can only enable the function which
is built in, or enable both roles as modules (USB_CHIPIDEA=m),
since chipidea core driver takes care of both host and device roles.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: ci13xxx_imx: remove 'phy_np'
Fabio Estevam [Thu, 13 Jun 2013 14:59:51 +0000 (17:59 +0300)]
usb: chipidea: ci13xxx_imx: remove 'phy_np'

There is no need to keep a local 'phy_np' as we can directly use the private
structure in data->phy_np.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: ci13xxx_imx: check if 'data->phy_np' is not NULL
Fabio Estevam [Thu, 13 Jun 2013 14:59:50 +0000 (17:59 +0300)]
usb: chipidea: ci13xxx_imx: check if 'data->phy_np' is not NULL

Similarly as it is done in ci13xxx_imx_remove(), only calls of_node_put if
data->phy_np is not NULL.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: ci13xxx_imx: remove reg_vbus
Fabio Estevam [Thu, 13 Jun 2013 14:59:49 +0000 (17:59 +0300)]
usb: chipidea: ci13xxx_imx: remove reg_vbus

There is no need to keep a 'reg_vbus' indirection, so get rid of it.

The motivation for doing this change is that in the case of error, the current
code only sets the local reg_vbus to NULL instead of updating the private
structure 'data->reg_vbus'.

Updating only the local reg_vbus is wrong, since we currently check for
data->reg_vbus in the ci13xxx_imx_remove() function.

In order to avoid such issue, just use 'data->reg_vbus' directly.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: ci13xxx_imx: fix error path
Fabio Estevam [Thu, 13 Jun 2013 14:59:48 +0000 (17:59 +0300)]
usb: chipidea: ci13xxx_imx: fix error path

If usbmisc_ops->post() fails it should point the error path to release all
previously acquired resources, so adjust it to call ci13xxx_remove_device().

While at it, remove the unnecessary 'plat_ci' indirection, as we can directly
use the private structure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: udc: configure iso endpoints
Michael Grzeschik [Thu, 13 Jun 2013 14:59:47 +0000 (17:59 +0300)]
usb: chipidea: udc: configure iso endpoints

This patch adds iso endpoint support to the device controller.
It makes use of the multiplication bits in the maxpacket field
of the endpoint and calculates the multiplier bits for each
transfer description on every request.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: usbmisc_imx: Staticize usbmisc_imx_drv_init/exit
Fabio Estevam [Thu, 13 Jun 2013 14:59:46 +0000 (17:59 +0300)]
usb: chipidea: usbmisc_imx: Staticize usbmisc_imx_drv_init/exit

Fix the following sparse warnings:

drivers/usb/chipidea/usbmisc_imx.c:246:5: warning: symbol 'usbmisc_imx_drv_init' was not declared. Should it be static?
drivers/usb/chipidea/usbmisc_imx.c:252:6: warning: symbol 'usbmisc_imx_drv_exit' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: ci13xxx_imx: let device core handle pinctrl
Fabio Estevam [Thu, 13 Jun 2013 14:59:45 +0000 (17:59 +0300)]
usb: chipidea: ci13xxx_imx: let device core handle pinctrl

Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for handling pinctrl.

So remove devm_pinctrl_get_select_default() from the driver.

Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agousb: chipidea: depend on CONFIG_OF instead of CONFIG_OF_DEVICE
Rob Herring [Fri, 19 Apr 2013 22:32:15 +0000 (17:32 -0500)]
usb: chipidea: depend on CONFIG_OF instead of CONFIG_OF_DEVICE

CONFIG_OF_DEVICE is going away, so use CONFIG_OF instead. It does not
appear that CONFIG_OF_DEVICE was the correct dependency either.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
11 years agoENGR00273344-2 thermal: imx: make thermal trip temp changeable
Anson Huang [Fri, 2 Aug 2013 17:29:17 +0000 (13:29 -0400)]
ENGR00273344-2 thermal: imx: make thermal trip temp changeable

Make all thermal trips' temp changeable:

1. Different users may have different definitions about the
trip temp;
2. For testing purpose, if we want to test cooling device's
function, it is easy to change trip temp to cheat the cooling
device to active, otherwise, need to test it using heating box
which is very inconvenient.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00273344-1 thermal: imx: Update formula for thermal sensor
Anson Huang [Wed, 31 Jul 2013 23:29:29 +0000 (19:29 -0400)]
ENGR00273344-1 thermal: imx: Update formula for thermal sensor

Thermal sensor used to need two calibration data which are
in Fuse to get a slope for converting thermal sensor's raw
data to real temperature in degree C.
Now we use an universal formula to get real temp
from internal thermal sensor raw data:
Slope = 0.4297157 - (0.0015976 * 25C fuse);

Using universal formula can reduce the effort of chip
calibration, so update the formula.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00269945 ARM: imx: Enable PU power
Anson Huang [Fri, 2 Aug 2013 19:53:57 +0000 (15:53 -0400)]
ENGR00269945 ARM: imx: Enable PU power

PU is turned off in uboot, so we need to turn it on here
to avoid kernel hang during GPU init.
PU power enable need to follow the flows:

1. Enable xPU's clk;
2. Enable PU power rail and wait for PU power stable;
3. Enable PU power gate in GPC;

Otherwise, some chips' PU may not work.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoARM: dts: imx6qdl-sabreauto: enable the WEIM NOR
Huang Shijie [Tue, 28 May 2013 06:20:12 +0000 (14:20 +0800)]
ARM: dts: imx6qdl-sabreauto: enable the WEIM NOR

Enable the WEIM NOR for imx6q{dl}-sabreauto boards.

For the pin conflict with SPI NOR, its status is set to "disabled".

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agoARM: dts: imx6qdl: add more information for WEIM
Huang Shijie [Tue, 28 May 2013 06:20:09 +0000 (14:20 +0800)]
ARM: dts: imx6qdl: add more information for WEIM

Add the clock and compatible information for the weim.
Also adds the weim label.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agodrivers: bus: add a new driver for WEIM
Huang Shijie [Tue, 28 May 2013 06:20:07 +0000 (14:20 +0800)]
drivers: bus: add a new driver for WEIM

The WEIM(Wireless External Interface Module) works like a bus.
You can attach many different devices on it, such as NOR, onenand.

In the case of i.MX6q-sabreauto, the NOR is connected to WEIM.

This patch also adds the devicetree binding document.
The driver only works when the devicetree is enabled.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agoASoC: fsl: Disable SSI in trigger() if RE/TE are both cleared
Nicolin Chen [Wed, 10 Jul 2013 10:43:54 +0000 (18:43 +0800)]
ASoC: fsl: Disable SSI in trigger() if RE/TE are both cleared

The code enabled SSIEN when triggered by SNDRV_PCM_TRIGGER_START,
so move the disable code to SNDRV_PCM_TRIGGER_STOP for symmetric.

This also allows us to use the SSI driver more flexible so that
it can support some use cases like "aplay S16_LE.wav S24_LE.wav"
which would call the driver in sequence like:
 startup()->hw_params(S16_LE)->trigger(START)->tirgger(STOP)->
 hw_params(S24_LE)->trigger(START)->tirgger(STOP)->shutdown()

If we disable SSIEN in shutdown(), the second hw_params() would
bypass the sample bits setting while using symmetric_rate.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
11 years agoENGR00273673-3 dma: imx-sdma: Add event pending trigger interface
Nicolin Chen [Fri, 19 Apr 2013 09:18:53 +0000 (17:18 +0800)]
ENGR00273673-3 dma: imx-sdma: Add event pending trigger interface

Add interface to allow other modules, like ASRC for example,
to trigger a dma request manually.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoENGR00273673-2 dma: imx-sdma: Add dual-fifo script for ssi
Nicolin Chen [Fri, 2 Aug 2013 09:18:55 +0000 (17:18 +0800)]
ENGR00273673-2 dma: imx-sdma: Add dual-fifo script for ssi

To support SSI dual-fifo mode, we need to add dual-fifo script for sdma.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoENGR00273673-1 dma: imx-sdma: Fix wrong total script number
Nicolin Chen [Fri, 2 Aug 2013 09:12:11 +0000 (17:12 +0800)]
ENGR00273673-1 dma: imx-sdma: Fix wrong total script number

The total number should be 35. Thus fix it.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
11 years agoserial: imx: add DMA support for imx6q
Huang Shijie [Mon, 8 Jul 2013 09:14:18 +0000 (17:14 +0800)]
serial: imx: add DMA support for imx6q

We only enable the DMA support when the following are meet:

  [1] The uart port supports the hardware flow control(CTS/RTS).
      (Some uart port does not support the CTS/RTS.)

  [2] The application enables the CTS/RTS.

  [3] The Soc is imx6q.
      For the sdma's firmware limit, we do not support the DMA except
      the imx6q platform.

  [4] The uart is not used as a console.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agodrivers/tty/serial: don't use devm_pinctrl_get_select_default() in probe
Wolfram Sang [Wed, 10 Jul 2013 15:57:46 +0000 (16:57 +0100)]
drivers/tty/serial: don't use devm_pinctrl_get_select_default() in probe

Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
we can rely on device core for setting the default pins. Compile tested only.

Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoserial/imx: fix custom-baudrate handling
Hubert Feurstein [Thu, 18 Jul 2013 16:52:49 +0000 (18:52 +0200)]
serial/imx: fix custom-baudrate handling

It was not possible to set custom-baudrates like 62500.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoserial: imx: distinguish the imx6q uart from the others
Huang Shijie [Mon, 8 Jul 2013 09:14:17 +0000 (17:14 +0800)]
serial: imx: distinguish the imx6q uart from the others

We will add the DMA support for the imx uart. For the firmware's limit,
only the imx6 serial chips (including the imx6q, imx6dl, imx6sl) can
support the DMA.

This patch adds the necessary macro and helper to distinguish the
imx6q uart from the other imx uart. Other chips can use the "fsl,imx6q-uart"
to enable the DMA support.

This patch also replaces the check "is_imx21_uart()" with "!is_imx1_uart()".

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoserial: imx: remove the uart_console() check
Huang Shijie [Fri, 28 Jun 2013 05:39:42 +0000 (13:39 +0800)]
serial: imx: remove the uart_console() check

The uart_console() check makes the clocks(clk_per and clk_ipg) opened
even when we close the console uart.

This patch enable/disable the clocks in imx_console_write(),
so we can keep the clocks closed when the console uart is closed.

Also remove the clock enable/disable oprations in the probe, we do not
need them any more.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoserial: remove unnecessary platform_set_drvdata()
Jingoo Han [Tue, 25 Jun 2013 01:08:49 +0000 (10:08 +0900)]
serial: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Barry Song <baohua.song@csr.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoserial: imx: Fix serial clock unbalance
Fabio Estevam [Sun, 9 Jun 2013 18:17:18 +0000 (15:17 -0300)]
serial: imx: Fix serial clock unbalance

Since commit 0c375501 (serial: imx: enable the clocks for console), the
imx_startup() function calls clk_prepare_enable conditionally, so we
need to call clk_disable_unprepare inside imx_shutdown() under the same
condition to avoid unbalanced clock calls.

This avoids the following warning:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 70 at drivers/clk/clk.c:780 __clk_disable+0x68/0x84()
Modules linked in:
CPU: 0 PID: 70 Comm: mountall Not tainted 3.10.0-rc4-next-20130607+ #435
Backtrace:
[<800116a4>] (dump_backtrace+0x0/0x10c) from [<80011844>] (show_stack+0x18/0x1c)
 r6:8069f4e8 r5:0000030c r4:00000000 r3:00000000
[<8001182c>] (show_stack+0x0/0x1c) from [<8053bce0>] (dump_stack+0x78/0x94)
[<8053bc68>] (dump_stack+0x0/0x94) from [<80023df8>] (warn_slowpath_common+0x6c/0x8c)
 r4:00000000 r3:00000000
[<80023d8c>] (warn_slowpath_common+0x0/0x8c) from [<80023e3c>] (warn_slowpath_null+0x24/0x2c)
 r8:bf2ed008 r7:bfaa9810 r6:000f0013 r5:bf824b80 r4:bf824b80
[<80023e18>] (warn_slowpath_null+0x0/0x2c) from [<8041af84>] (__clk_disable+0x68/0x84)
[<8041af1c>] (__clk_disable+0x0/0x84) from [<8041b098>] (clk_disable+0x20/0x2c)
 r4:600f0013 r3:00000001
[<8041b078>] (clk_disable+0x0/0x2c) from [<802c93e8>] (imx_shutdown+0xbc/0xec)
 r5:bf824b80 r4:bfaa9810
[<802c932c>] (imx_shutdown+0x0/0xec) from [<802c63a0>] (uart_port_shutdown+0x34/0x40)
 r5:bf86f860 r4:bfaa9810
[<802c636c>] (uart_port_shutdown+0x0/0x40) from [<802c68c0>] (uart_shutdown+0x98/0xc4)
 r4:bf86f800 r3:00000000
[<802c6828>] (uart_shutdown+0x0/0xc4) from [<802c7514>] (uart_close+0x5c/0x198)
 r7:bfaa9810 r6:bf274400 r5:bf86f86c r4:bf86f800
[<802c74b8>] (uart_close+0x0/0x198) from [<802ac648>] (tty_release+0xf8/0x500)
[<802ac550>] (tty_release+0x0/0x500) from [<800c5a30>] (__fput+0x9c/0x208)
[<800c5994>] (__fput+0x0/0x208) from [<800c5bac>] (____fput+0x10/0x14)
[<800c5b9c>] (____fput+0x0/0x14) from [<80040234>] (task_work_run+0xb4/0xec)
[<80040180>] (task_work_run+0x0/0xec) from [<80029238>] (do_exit+0x2b0/0x920)
 r8:8000e144 r7:000000f8 r6:bf306300 r5:00000000 r4:bfac1180
[<80028f88>] (do_exit+0x0/0x920) from [<80029a4c>] (do_group_exit+0x50/0xd4)
 r7:000000f8
[<800299fc>] (do_group_exit+0x0/0xd4) from [<80029ae8>] (__wake_up_parent+0x0/0x28)
 r7:000000f8 r6:00000001 r5:0006f7ae r4:0006f79a
[<80029ad0>] (SyS_exit_group+0x0/0x18) from [<8000dfc0>] (ret_fast_syscall+0x0/0x30)
---[ end trace 16d080eb7efea4e9 ]---

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoserial: imx: enable the clocks for console
Huang Shijie [Sun, 9 Jun 2013 02:01:19 +0000 (10:01 +0800)]
serial: imx: enable the clocks for console

The console's clocks are disabled after the uart driver is probed.
It makes that we can see less log from the console now
(though we still can get all the log by the `dmesg`).

So enable the clocks for console, and we can see all the log again.

This patch also disables the sport->clk_per when we fail to enable
the sport->clk_ipg;

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoserial: imx: Fix warning when !CONFIG_SERIAL_IMX_CONSOLE
Fabio Estevam [Wed, 5 Jun 2013 03:58:46 +0000 (00:58 -0300)]
serial: imx: Fix warning when !CONFIG_SERIAL_IMX_CONSOLE

When CONFIG_SERIAL_IMX_CONSOLE is not selected the following build warnings
appear:

drivers/tty/serial/imx.c:274:13: warning: 'imx_port_ucrs_save' defined but not used [-Wunused-function]
drivers/tty/serial/imx.c:283:13: warning: 'imx_port_ucrs_restore' defined but not used [-Wunused-function]

imx_port_ucrs_save() and imx_port_ucrs_restore() are only used when
CONFIG_CONSOLE_POLL or CONFIG_SERIAL_IMX_CONSOLE are selected, so protect these
functions declaration with a proper ifdef.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
11 years agoserial: imx: enable the clocks only when the uart is used
Huang Shijie [Tue, 4 Jun 2013 01:59:33 +0000 (09:59 +0800)]
serial: imx: enable the clocks only when the uart is used

Current code opens the clocks when the uart driver is probed.
This will wastes some power if several uarts are enabled, but not really
used.

So close these clocks for uart, and enable the clocks only when
the uart is used.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoserial: imx: add support for DTE mode
Huang Shijie [Thu, 30 May 2013 06:07:12 +0000 (14:07 +0800)]
serial: imx: add support for DTE mode

The uart works in the DCE mode by default, but sometime we need it
works at the DTE mode.

This patch adds the support for the DTE mode.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoserial: imx: Add Rx Fifo overrun error message
Alexander Stein [Tue, 14 May 2013 15:06:07 +0000 (17:06 +0200)]
serial: imx: Add Rx Fifo overrun error message

This patch enables the overrun error (ORE) interrupt and increases the
counter in case of overrun.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoserial: Move "uart_console" def to core header file.
Sourav Poddar [Wed, 15 May 2013 15:35:37 +0000 (21:05 +0530)]
serial: Move "uart_console" def to core header file.

Move "uart_console" definition to serial core header file, so that it can be
used by serial drivers.
Get rid of the uart_console defintion from mpc52xx_uart driver.

Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Rajendra nayak <rnayak@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoENGR00240988: ARM: imx: enable GPU support in defconfig
Shawn Guo [Mon, 29 Jul 2013 06:33:49 +0000 (14:33 +0800)]
ENGR00240988: ARM: imx: enable GPU support in defconfig

Turn on CMA with a 256 MiB pool and vivante gpu/drm options.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: ARM: imx6q: add dma_zone_size for GPU limit
Shawn Guo [Wed, 31 Jul 2013 02:24:07 +0000 (10:24 +0800)]
ENGR00240988: ARM: imx6q: add dma_zone_size for GPU limit

GPU has a limit on physical address that it accesses, which must be
below 2GiB.  Since i.MX6Q/DL maps system memory at 0x10000000 (offset
256MiB), we set dma_zone_size as (SZ_2G - SZ_256M) to ensure that.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: ARM: dts: add gpu nodes for imx6q and imx6dl
Shawn Guo [Fri, 26 Jul 2013 08:50:49 +0000 (16:50 +0800)]
ENGR00240988: ARM: dts: add gpu nodes for imx6q and imx6dl

It adds gpu nodes for imx6q and imx6dl.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: ARM: imx6q: add gpu clock initialzatin code
Loren HUANG [Fri, 9 Nov 2012 04:47:10 +0000 (12:47 +0800)]
ENGR00240988: ARM: imx6q: add gpu clock initialzatin code

This is a cherry-pick of commit 80f38bb (ENGR00240988-3 Add gpu clock
initialzatin code) from 3.5.7 kernel.

Signed-off-by: Loren HUANG <b02279@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: drm: vivante: remove reclaim_buffers callback
Shawn Guo [Tue, 23 Jul 2013 02:26:00 +0000 (10:26 +0800)]
ENGR00240988: drm: vivante: remove reclaim_buffers callback

Since commit b0071ef (drm: kill reclaim_buffers callback),
reclaim_buffers callback is unavailable.  Remove it.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: drm: copy vivante driver from 3.5.7 kernel
Shawn Guo [Thu, 24 May 2012 02:28:24 +0000 (10:28 +0800)]
ENGR00240988: drm: copy vivante driver from 3.5.7 kernel

This is a direct copy of folder drivers/gpu/drm/vivante/ from 3.5.7
kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: use dummy thermal notifier functions on 3.10 kernel
Shawn Guo [Mon, 29 Jul 2013 06:01:32 +0000 (14:01 +0800)]
ENGR00240988: gpu: use dummy thermal notifier functions on 3.10 kernel

The thermal notifier calls are not supported yet on 3.10 kernel.  Let's
use dummy functions for now.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: use reset API on 3.10 kernel
Shawn Guo [Mon, 29 Jul 2013 05:59:11 +0000 (13:59 +0800)]
ENGR00240988: gpu: use reset API on 3.10 kernel

Use reset API to reset GPU on 3.10 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: fix deprecated idr calls on 3.10 kernel
Shawn Guo [Mon, 29 Jul 2013 03:47:05 +0000 (11:47 +0800)]
ENGR00240988: gpu: fix deprecated idr calls on 3.10 kernel

The idr calls idr_pre_get() and idr_get_new_above() are deprecated on
3.10 kernel and cause the following build issues.  Replace the calls
with the new idr_alloc() to fix the issue.

  CC      drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c: In function ‘_AllocateIntegerId’:
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:776:5: error: ‘idr_pre_get’ is deprecated (declared at include/linux/idr.h:151) [-Werror=deprecated-declarations]
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:784:5: error: ‘idr_get_new_above’ is deprecated (declared at include/linux/idr.h:166) [-Werror=deprecated-declarations]

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: use a dummy imx_gpc_power_up_pu() on 3.10 for now
Shawn Guo [Mon, 29 Jul 2013 03:32:16 +0000 (11:32 +0800)]
ENGR00240988: gpu: use a dummy imx_gpc_power_up_pu() on 3.10 for now

Use a dummy imx_gpc_power_up_pu() on 3.10 kernel for now, and will need
to revisit it when the power management of PU is ready on 3.10 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: allocate contiguous memory from CMA for 3.10 kernel
Shawn Guo [Fri, 26 Jul 2013 08:49:39 +0000 (16:49 +0800)]
ENGR00240988: gpu: allocate contiguous memory from CMA for 3.10 kernel

The Contiguous Memory Allocator (CMA) is mature in 3.10 kernel.  Let's
change gpu driver to allocate contiguous memory from CMA pool.  Doing so
will save not only the memblock reserve calls in machine code but also
the request_mem_region() and ioremap() in gpu driver.  And all the
system memory will be seen by kernel no matter whether gpu driver is
running or not.

It also changes the default contiguousSize to 128 MiB for Freescale
adjustment.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: __devinit and __devexit are unavailable on 3.10 kernel
Shawn Guo [Fri, 26 Jul 2013 09:36:30 +0000 (17:36 +0800)]
ENGR00240988: gpu: __devinit and __devexit are unavailable on 3.10 kernel

__devinit, __devexit and __devexit_p are unavailable on 3.10 kernel.
Remove them for 3.10 to fix the compile issues below.

  CC      drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.o
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c:1033:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘gpu_probe’
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c:1116:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘gpu_remove’
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c:1292:19: error: ‘gpu_probe’ undeclared here (not in a function)
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c:1293:5: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: comment out busfreq calls for 3.10 kernel
Shawn Guo [Fri, 26 Jul 2013 09:25:33 +0000 (17:25 +0800)]
ENGR00240988: gpu: comment out busfreq calls for 3.10 kernel

The busfreq driver is not ready yet on 3.10 kernel.  Let's comment out
the busfreq header inclusion and function calls for now, and revisit it
later when busfreq driver is ready.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: mach/hardware.h is not available in kernel 3.10
Shawn Guo [Fri, 26 Jul 2013 09:03:13 +0000 (17:03 +0800)]
ENGR00240988: gpu: mach/hardware.h is not available in kernel 3.10

In kernel 3.10, drivers can not include any <mach/*> headers.  Do not
include <mach/hardware.h> for 3.10 kernel to fix the follow build
errors.

  CC      drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.o
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c:28:27: fatal error: mach/hardware.h: No such file or directory

  CC      drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:33:27: fatal error: mach/hardware.h: No such file or directory

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240988: gpu: copy gpu-viv driver from 3.5.7 kernel
Shawn Guo [Mon, 22 Jul 2013 13:55:36 +0000 (21:55 +0800)]
ENGR00240988: gpu: copy gpu-viv driver from 3.5.7 kernel

This is a direct copy of folder drivers/mxc/gpu-viv from 3.5.7 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00273073-4 ARM: imx_v6_v7_defconfig: enable more cpufreq governors
Anson Huang [Wed, 31 Jul 2013 14:45:52 +0000 (10:45 -0400)]
ENGR00273073-4 ARM: imx_v6_v7_defconfig: enable more cpufreq governors

1. Enable all supported governors;
2. Select interactive governor by default;

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00273073-3 ARM: imx_v6_v7_defconfig: run save defconfig
Anson Huang [Wed, 31 Jul 2013 14:43:35 +0000 (10:43 -0400)]
ENGR00273073-3 ARM: imx_v6_v7_defconfig: run save defconfig

Run make ARCH=arm savedefconfig on imx_v6_v7_defconfig to
clean up some unnecessary/unrelated items, so that next
time when we run savedefconfig, we only see related changes.
No functional changes.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00273073-2 cpufreq: add interactive governor for cpufreq
Anson Huang [Tue, 30 Jul 2013 18:29:26 +0000 (14:29 -0400)]
ENGR00273073-2 cpufreq: add interactive governor for cpufreq

cpufreq: interactive: New 'interactive' governor

This governor is designed for latency-sensitive workloads, such as
interactive user interfaces.  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.  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. Instead of sampling
the CPU at a specified rate, the governor will check whether to scale the
CPU frequency up soon after coming out of idle.  When the CPU comes out of
idle, a timer is configured to fire within 1-2 ticks.  If the CPU is very
busy from exiting idle to when the timer fires then we assume the CPU is
underpowered and ramp 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.

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

The tuneables for this governor are:
/sys/devices/system/cpu/cpufreq/interactive/min_sample_time:
    The minimum amount of time to spend at the current frequency before
    ramping down. This is to ensure that the governor has seen enough
    historic CPU load data to determine the appropriate workload.
/sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
    The CPU load at which to ramp to max speed.

Signed-off-by: Mike Chan <mike at android.com>
Signed-off-by: Todd Poynor <toddpoynor at google.com>
Signed-off-by: Allen Martin <amartin at nvidia.com> (submitted improvements)
Signed-off-by: Axel Haslam <axelhaslam at ti.com> (submitted improvements)
Signed-off-by: Anton Vorontsov <anton.vorontsov at linaro.org>
Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00273073-1 arm: add cpu idle notification callback
Anson Huang [Tue, 30 Jul 2013 18:25:23 +0000 (14:25 -0400)]
ENGR00273073-1 arm: add cpu idle notification callback

Some modules may need to know cpu idle status and take
actions before and after cpu idle, so we can add
notification callback when enter/exit cpu idle, then
modules only need to register this notification callback,
everytime cpu enter/exit idle, the callback chain will be
executed.

Currently only cpufreq interactive governor use this
notification, as it wants to save power, the timers of
interactive governor are only enabled when cpu is not in idle.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00268508 backlight:Correct the setting for bd props.fb_blank
Liu Ying [Tue, 25 Jun 2013 09:13:33 +0000 (17:13 +0800)]
ENGR00268508 backlight:Correct the setting for bd props.fb_blank

The patch of "ENGR00264855 backlight: Support backlight shared by
multiple fbs" doesn't consider that bd->props.fb_blank could be
shared by several framebuffers which use the same backlight device.
This causes the pwm backlight wrongly check the fb blank status.
This patch corrects the setting for the fb blank status by
considering all the framebuffers in question to fix the issue.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 68b97d114629f22f64b3d8c14d0a0b7d07d6ebb2)

11 years agoENGR00264855 backlight: Support backlight shared by multiple fbs
Liu Ying [Thu, 30 May 2013 05:56:17 +0000 (13:56 +0800)]
ENGR00264855 backlight: Support backlight shared by multiple fbs

One backlight device may shared by multiple framebuffers.
We don't hope blanking one of the framebuffers may turn the
backlight off for all the other framebuffers, since they are
likely active to show display content. This patch adds logic
to record each framebuffer's backlight usage to determine the
backlight device use count and whether the backlight should be
turned on or off.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 37cbf741e4dff1f757f3ade6bb861d9a2af70693)

11 years agoENGR00272973-4 ARM: imx_v6_v7_defconfig: enable PWM and bl options
Liu Ying [Mon, 29 Jul 2013 10:56:24 +0000 (18:56 +0800)]
ENGR00272973-4 ARM: imx_v6_v7_defconfig: enable PWM and bl options

This patch enables some necessary options for PWM backlight support.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00272973-3 ARM: dts: imx: enable pwm bl for mx6 sabresd
Liu Ying [Mon, 29 Jul 2013 10:49:57 +0000 (18:49 +0800)]
ENGR00272973-3 ARM: dts: imx: enable pwm bl for mx6 sabresd

This patch enables pwm backlight support on pwm1 in mx6
sabresd dts.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00272973-2 ARM: dts: imx: enable pwm1 for mx6 sabresd
Liu Ying [Mon, 29 Jul 2013 10:44:29 +0000 (18:44 +0800)]
ENGR00272973-2 ARM: dts: imx: enable pwm1 for mx6 sabresd

This patch enables pwm1 on pin SD1_DAT3 as display
pwm backlight controller in mx6 sabresd dts.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00272973-1 ARM: dts: imx6qdl: rename pwm0 pinctrl
Liu Ying [Tue, 30 Jul 2013 01:53:21 +0000 (09:53 +0800)]
ENGR00272973-1 ARM: dts: imx6qdl: rename pwm0 pinctrl

This patch renames pwm0 pinctrl to pwm1 to avoid confusion
on the first pwm module's name.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00269945: ARM: imx: enable SATA support in defconfig
Shawn Guo [Thu, 25 Jul 2013 06:56:34 +0000 (14:56 +0800)]
ENGR00269945: ARM: imx: enable SATA support in defconfig

Enable SATA support in imx_v6_v7_defconfig.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: enable ahci sata on imx6q platforms
Richard Zhu [Tue, 16 Jul 2013 03:28:46 +0000 (11:28 +0800)]
ARM: dtsi: enable ahci sata on imx6q platforms

Only imx6q has the ahci sata controller, enable
it on imx6q platforms.

Signed-off-by: Richard Zhu <r65037@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoahci_imx: add ahci sata support on imx platforms
Richard Zhu [Wed, 24 Jul 2013 06:15:29 +0000 (14:15 +0800)]
ahci_imx: add ahci sata support on imx platforms

imx6q contains one Synopsys AHCI SATA controller, But it can't share
ahci_platform driver with other controllers because there are some
misalignments of the generic AHCI controller - the bits definitions of
the HBA registers, the Vendor Specific registers, the AHCI PHY clock
and the AHCI signals adjustment window(GPR13 register).

 - CAP_SSS(bit20) of the HOST_CAP is writable, default value is '0',
   should be configured to be '1'

 - bit0 (only one AHCI SATA port on imx6q) of the HOST_PORTS_IMPL
   should be set to be '1'.(default 0)

 - One Vendor Specific register HOST_TIMER1MS(offset:0xe0) should be
   configured regarding to the frequency of AHB bus clock.

 - Configurations of the AHCI PHY clock, and the signal parameters of
   the GPR13

Setup its own ahci sata driver, contained the imx6q specific
initialized codes, re-use the generic ahci_platform driver, and keep
the generic ahci_platform driver clean as much as possible.

tj: patch description reformatted

Signed-off-by: Richard Zhu <r65037@freescale.com>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: update the sata bits definitions of gpr13
Richard Zhu [Wed, 24 Jul 2013 06:15:28 +0000 (14:15 +0800)]
ARM: imx6q: update the sata bits definitions of gpr13

Replace the SATA_PHY_# by the more readable definitons.

tj: Being routed through libata branch to enable implementation of
    ahci_imx.

Signed-off-by: Richard Zhu <r65037@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx: enable IPU and display support in defconfig
Shawn Guo [Tue, 23 Jul 2013 14:49:06 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx: enable IPU and display support in defconfig

It disables DRM_IMX which is the community support of IPU/display, and
enables our internal version of IPU and display (LDB and LCD) support.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: dts: enable LDB and LCD support for imx6qdl-sabresd
Shawn Guo [Tue, 23 Jul 2013 14:49:05 +0000 (22:49 +0800)]
ENGR00240987: ARM: dts: enable LDB and LCD support for imx6qdl-sabresd

This is a fast-forward porting of LDB and LCD DTS changes from 3.5.7
kernel.

Along with the changes, the "&ldb" node gets removed from imx6q.dtsi,
since it's only used by community kernel and will conflict with our
internal LDB bindings.

While adding alias for ipu in imx6qdl.dtsi, it also sorts all those
aliases alphabetically.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx: select SRAM for ARCH_MXC
Shawn Guo [Tue, 23 Jul 2013 14:49:04 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx: select SRAM for ARCH_MXC

Most of IMX SoCs have IRAM/SRAM integrated for audio/video uses, so
let's select SRAM to build in the generic on-chip SRAM driver support.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx6q: initialize clocks for IPU
Shawn Guo [Tue, 23 Jul 2013 14:49:03 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx6q: initialize clocks for IPU

This is a fast-forward porting from 3.5.7 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx6q: add vdoa gate clock
Shawn Guo [Tue, 23 Jul 2013 14:49:02 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx6q: add vdoa gate clock

Add the missing vdoa gate clock for imx6q.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: video: port LDB and LCD FB display drivers from 3.5.7 kernel
Shawn Guo [Tue, 23 Jul 2013 14:49:01 +0000 (22:49 +0800)]
ENGR00240987: video: port LDB and LCD FB display drivers from 3.5.7 kernel

This is a fast-forward porting of LDB and LCD frame buffer drivers from
3.5.7 kernel to kernel 3.10.  The change set is kept as minimum as
possible with only making necessary code changes, which are mostly for
solving compile problems.

 * Remove <mach/*> inclusions
 * Drop __devinit and __devexit
 * Drop vm flag VM_RESERVED
 * Protect ldb_setup() with #ifndef MODULE to fix "warning: ‘ldb_setup’
   defined but not used" in module build
 * Remove fb_prepare_logo() and fb_show_logo() calls, because it breaks
   module build, and penguin logo works fine without the calls in
   mxc_ipuv3_fb.c

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ipu: port ipuv3 driver from 3.5.7 kernel
Shawn Guo [Tue, 23 Jul 2013 14:49:00 +0000 (22:49 +0800)]
ENGR00240987: ipu: port ipuv3 driver from 3.5.7 kernel

This is a fast-forward porting of ipuv3 driver from 3.5.7 kernel to
kernel 3.10.  The change set is kept as minimum as possible with only
making necessary code changes to adapt 3.10 kernel internal API and
framework updates.  Everything else should be same as 3.5.7 one.  The
change set consists of the following.

 * Remove unused Kconfig options MXC_IPU_V3D, MXC_IPU_V3EX and
   MXC_IPU_V3H
 * Comment out busfreq calls
 * Move ipu-v3.h into include/linux/, and remove all <mach/*> includes
 * Drop __devinit and __devexit
 * Remove assignment of pltfm_data->pg = imx6q_ipu_pg;
 * Use generic device_reset() API rather than ipu_pltfm_data->init()
   hook to reset IPU
 * Includes <linux/sched/rt.h> ipu_device.c to fix undeclared
   MAX_USER_RT_PRIO error
 * Change compatible string to "fsl,imx6q-ipu" to align with community
   kernel
 * Define irq_sync before irq_err in DTS to align with community kernel
 * Drop "ipu1_" and "ipu2_" from clock names to save the handling of the
   second parameter of devm_clk_get()
 * Remove the buggy csi_clk setup in ipu_clk_setup_enable() and validate
   the clock before operate on it in ipu_csi_enable_mclk()
 * Replace iram API (linux/iram_alloc.h) with generic memory pool API
   (linux/genalloc.h) in VDOA driver

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: ocram size is different between imx6q and imx6dl
Shawn Guo [Tue, 23 Jul 2013 14:48:59 +0000 (22:48 +0800)]
ARM: dts: imx: ocram size is different between imx6q and imx6dl

The ocram on imx6q is 256 KiB while on imx6dl it's 128 KiB.  Let's
have separate node for imx6q and imx6dl.  It also changes imx6q size
0x3f000 to 0x40000 to match the hardware.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: add sram for imx53 and imx6q
Philipp Zabel [Tue, 23 Jul 2013 14:48:58 +0000 (22:48 +0800)]
ARM: dts: add sram for imx53 and imx6q

This patch enables the On-Chip SRAM (OCRAM) on i.MX53 and i.MX6 SoCs.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: ARM: imx: enable cpufreq and thermal support in defconfig
Shawn Guo [Thu, 18 Jul 2013 13:05:33 +0000 (21:05 +0800)]
ENGR00269945: ARM: imx: enable cpufreq and thermal support in defconfig

Enable cpufreq and thermal support in defconfig, so that cpufreq can be
used as the cpu_cooling device to throttle CPUs when passive trip point
gets crossed.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: add tempmon node for imx6q thermal support
Shawn Guo [Tue, 4 Jun 2013 07:14:06 +0000 (15:14 +0800)]
ARM: dts: imx: add tempmon node for imx6q thermal support

Mark ocotp as a syscon node and add tempmon for imx6q thermal support.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agothermal: add imx thermal driver support
Shawn Guo [Mon, 24 Jun 2013 06:30:44 +0000 (14:30 +0800)]
thermal: add imx thermal driver support

This is based on the initial imx thermal work done by
Rob Lee <rob.lee@linaro.org> (Not sure if the email address is still
valid).  Since he is no longer interested in the work and I have
rewritten a significant amount of the code, I just took the authorship
over from him.

It adds the imx thermal support using Temperature Monitor (TEMPMON)
block found on some Freescale i.MX SoCs.  The driver uses syscon regmap
interface to access TEMPMON control registers and calibration data, and
supports cpufreq as the cooling device.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agothermal: cpu_cooling: fix 'descend' check in get_property()
Shawn Guo [Tue, 28 May 2013 06:22:32 +0000 (06:22 +0000)]
thermal: cpu_cooling: fix 'descend' check in get_property()

Commit 24c7a381720843f17efb42de81f7e85aefd6f616 upstream.

The variable 'descend' is initialized as -1 in function get_property(),
and will never get any chance to be updated by the following code.

if (freq != CPUFREQ_ENTRY_INVALID && descend != -1)
descend = !!(freq > table[i].frequency);

This makes function get_property() return the wrong frequency for given
cooling level if the frequency table is sorted in ascending.  Fix it
by correcting the 'descend' check in if-condition to 'descend == -1'.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: remove board specific CLKO setup
Shawn Guo [Thu, 18 Jul 2013 06:42:28 +0000 (14:42 +0800)]
ARM: imx6q: remove board specific CLKO setup

The CLKO is widely used by imx6q board designs to clock audio codec.
Since most codecs accept 24 MHz frequency, let's initially set up CLKO
with OSC24M (cko <-- cko2 <-- osc).  Then those board specific CLKO
setup for audio codec can be removed.

The board dts files also need an update on cko reference in codec node.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: add the missing cko output selection
Shawn Guo [Thu, 18 Jul 2013 05:35:40 +0000 (13:35 +0800)]
ARM: imx6q: add the missing cko output selection

The clock output on imx6q CCM_CLKO1 pad is not always cko1 clock, and
there is a multiplexer to select between cko1 and cko2.  Add this
missing selection as the clock cko.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: add cko2 clocks
Shawn Guo [Thu, 18 Jul 2013 05:16:40 +0000 (13:16 +0800)]
ARM: imx6q: add cko2 clocks

It adds the missing cko2 clocks, including multiplexer, divider and
gate.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: add spdif gate clock
Shawn Guo [Thu, 18 Jul 2013 05:08:20 +0000 (13:08 +0800)]
ARM: imx6q: add spdif gate clock

It adds the missing spdif gate clock into imx6q clock driver.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: add ethernet phy fixup for KSZ9031
Sascha Hauer [Thu, 20 Jun 2013 15:34:33 +0000 (17:34 +0200)]
ARM: i.MX6: add ethernet phy fixup for KSZ9031

The KSZ9031 is used on the i.MX6 based Data Modul eDM-QMX6
board. It needs the same fixup to the rx/tx delays as other
i.MX6 boards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: add ethernet phy fixup for AR8031
Sascha Hauer [Thu, 20 Jun 2013 15:34:32 +0000 (17:34 +0200)]
ARM: i.MX6: add ethernet phy fixup for AR8031

The AR8031 is used on the i.MX6 based sabreSD, sabreauto and wandboard.
All need the same fixup, so add it for all i.MX6.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: call ksz9021 phy fixup for all i.MX6 boards
Sascha Hauer [Thu, 20 Jun 2013 15:34:31 +0000 (17:34 +0200)]
ARM: i.MX6: call ksz9021 phy fixup for all i.MX6 boards

In current U-Boot the sabrelite, nitrogen6x and titanium all need
the same fixup for the ksz9021 phy. Instead of limiting the fixup
to a single board apply them for all.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default
Nicolin Chen [Thu, 13 Jun 2013 11:51:04 +0000 (19:51 +0800)]
ARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default

Commit 42914fdde5bcda9f9118f20456d2c22300cda645 upstream.

Enable imx-wm8962 and PM_RUNTIME, essential for WM8962 CODEC driver.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: Enable WM8962 audio support
Nicolin Chen [Fri, 14 Jun 2013 05:22:46 +0000 (13:22 +0800)]
ARM: dtsi: imx6qdl-sabresd: Enable WM8962 audio support

Commit 77b38fc36c5dc6f99d1db0a3c216724e53e5e257 upstream.

Enable WM8962 ALSA machine driver via devicetree.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: Enable SSI2 and AUDMUX
Nicolin Chen [Fri, 14 Jun 2013 05:19:57 +0000 (13:19 +0800)]
ARM: dtsi: imx6qdl-sabresd: Enable SSI2 and AUDMUX

Commit 48828700188f4b054e94ac08994bc5874e77a2c5 upstream.

Enable SSI2 and its pin configuration in AUDMUX.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: Add WM8962 CODEC support
Nicolin Chen [Thu, 13 Jun 2013 11:51:01 +0000 (19:51 +0800)]
ARM: dtsi: imx6qdl-sabresd: Add WM8962 CODEC support

Commit 20426febe6026ba251afcb5bb7b32ac72837bde2 upstream.

Add WM8962 CODEC support and enable its parent I2C bus.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: add a fixed regulator for WM8962
Nicolin Chen [Thu, 13 Jun 2013 11:51:00 +0000 (19:51 +0800)]
ARM: dtsi: imx6qdl-sabresd: add a fixed regulator for WM8962

Commit fdbfb43b39e7876fba7048ab930c4c72e7ec2561 upstream.

On Sabre SD, system controls WM8962 power by pulling up/down GPIO_4_10,
so add a regulator controled by GPIO_4_10 for WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx6qdl-sabresd: add clko1 iomux configuration
Nicolin Chen [Thu, 13 Jun 2013 11:50:57 +0000 (19:50 +0800)]
ARM: dts: imx6qdl-sabresd: add clko1 iomux configuration

Commit 521b43d41cd41ac8763603a7b923703d5d368bc9 upstream.

Setting GPIO_0 pad as clko1 clock output to provide MCLK for WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd
Nicolin Chen [Thu, 13 Jun 2013 11:50:56 +0000 (19:50 +0800)]
ARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd

Commit e7eccc7e16acfcc3e613e7c0df7e62528d24581c upstream.

WM8962 needs 24MHz clock for its MCLK, so choose PLL4 as the parent of clko1.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: add imx-wm8962 machine driver
Nicolin Chen [Mon, 10 Jun 2013 18:43:30 +0000 (02:43 +0800)]
ASoC: fsl: add imx-wm8962 machine driver

Commit 8de2ae2a7f1fd71dc56d6b014029f93093e9c5d5 upstream.

This is the initial imx-wm8962 device-tree-only machine driver working with
fsl_ssi driver. More features can be added on top of it later.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: wm8962: Enable start-up and normal bias after reset in runtime resume
Nicolin Chen [Fri, 14 Jun 2013 11:49:06 +0000 (19:49 +0800)]
ASoC: wm8962: Enable start-up and normal bias after reset in runtime resume

Commit f5055f93733730b61a8a69dedbb216e6b4dd84c5 upstream.

This part of bias settings are essential for WM8962 to power up. Without it
"wm8962 0-001a: DC servo timed out" might be prompted due to power-up failure
that happens to FLL if being used.

The driver's also bringing the bias down in the suspend path so it needs to be
powered up in the resume path for symmetry.

According to dapm_pre_sequence_async(), DAPM would call pm_runtime_get_sync()
to let driver finish the bias settings in pm_runtime_resume() before the bias
level being set to STANDBY. So no need to worry about disordered settings for
VMID of WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: wm8962: Restore device state after reset in runtime resume
Mark Brown [Fri, 7 Jun 2013 15:19:58 +0000 (16:19 +0100)]
ASoC: wm8962: Restore device state after reset in runtime resume

Commit 9c24b1672283644adf871244771ebf387dd73f90 upstream.

After the device has been reset we need to repeat the same
initialisation we do on probe to make sure that the device is in
a known state.

Tested-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: wm8962: Add device tree binding
Nicolin Chen [Fri, 7 Jun 2013 03:23:27 +0000 (11:23 +0800)]
ASoC: wm8962: Add device tree binding

Commit d74e9e7090aeb9b61e683e5abf7ca70fa18f846b upstream.

Document the device tree binding for the WM8962 codec, and modify the
driver to extract platform data from the device tree, if present.

Based on work of WM8903 by Stephen Warren <swarren@nvidia.com>

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: WM8962: Create default platform data structure
Nicolin Chen [Thu, 6 Jun 2013 11:38:45 +0000 (19:38 +0800)]
ASoC: WM8962: Create default platform data structure

Commit e75a52c6723a61a0d768ee53794e86b7edbe54f0 upstream.

Embed a copy of struct wm8962_pdata in stuct wm8962_priv
so that there's no need to check validity of pdata any more.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: firwmare: imx: add imx6q sdma script
Shawn Guo [Tue, 16 Jul 2013 14:53:18 +0000 (22:53 +0800)]
ENGR00269945: firwmare: imx: add imx6q sdma script

Add imx6q sdma script which will be used by all i.MX6 series.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: remove old DMA binding data from gpmi node
Shawn Guo [Tue, 16 Jul 2013 09:13:00 +0000 (17:13 +0800)]
ARM: dts: imx: remove old DMA binding data from gpmi node

After mxs-dma driver adopts generic DMA device tree binding, gpmi
channel interrupt number is defined in DMA controller node, and
channel ID is listed in "dmas" property.  So the DMA channel interrupt
number in gpmi node "interrupts" property and fsl,gpmi-dma-channel which
are used by old customized DMA binding can be removed now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: use generic DMA bindings for SSI nodes
Shawn Guo [Wed, 24 Apr 2013 04:35:53 +0000 (12:35 +0800)]
ARM: dts: imx: use generic DMA bindings for SSI nodes

Updates SSI nodes to adopt generic DMA bindings.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx6qdl/imx6sl: add the dma property for uart
Huang Shijie [Fri, 12 Jul 2013 10:02:09 +0000 (18:02 +0800)]
ARM: dts: imx6qdl/imx6sl: add the dma property for uart

Add the dma property for all the uart.

Note: Add the dma property does not mean we enable the dma for this
uart.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: add #dma-cells property for sdma
Huang Shijie [Tue, 2 Jul 2013 02:15:29 +0000 (10:15 +0800)]
ARM: dts: imx: add #dma-cells property for sdma

Add the #dma-cells property for all the sdma in all the imx platforms.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: move fsl_ssi to generic DMA DT bindings
Shawn Guo [Thu, 25 Apr 2013 14:37:08 +0000 (22:37 +0800)]
ASoC: fsl: move fsl_ssi to generic DMA DT bindings

It removes the temporary custom DMA bindings from fsl_ssi driver and use
the generic one instead.  It leaves imx-ssi drive unchanged regarding
those pcm flags by updating imx_pcm_dma_init() to let SSI driver decide
the flags.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>