]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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)

10 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)

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 years agoASoC: fsl: remove imx-pcm driver
Shawn Guo [Thu, 25 Apr 2013 03:18:50 +0000 (11:18 +0800)]
ASoC: fsl: remove imx-pcm driver

Commit dbdf6b54340e1671439a4a5efbd15b7a0b14eacb upstream.

With imx-pcm-dma moving to generic dmaengine pcm driver and the removal
of imx-pcm-audio/imx-fiq-pcm-audio platform device use, now imx-pcm
driver contains a few functions that are only used by imx-pcm-fiq.c.
Move these functions into imx-pcm-fiq.c and remove imx-pcm.c completely.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoASoC: fsl: remove use of imx-fiq-pcm-audio from imx-ssi
Shawn Guo [Thu, 25 Apr 2013 03:18:49 +0000 (11:18 +0800)]
ASoC: fsl: remove use of imx-fiq-pcm-audio from imx-ssi

Commit 2bf9d4bbd0fa97ff6f214484f62fc8aca64d1d00 upstream.

Rather than instantiating imx-fiq-pcm-audio to call imx_pcm_fiq_init(),
imx-ssi can just directly call it to save the use of imx-fiq-pcm-audio.
With this change, imx-ssi becomes not only a cpu DAI but also a platform
device, so updates platform device setup in eukrea-tlv320, phycore-ac97
and wm1133-ev1 accordingly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoASoC: fsl: create function imx_pcm_fiq_exit()
Shawn Guo [Thu, 25 Apr 2013 03:18:48 +0000 (11:18 +0800)]
ASoC: fsl: create function imx_pcm_fiq_exit()

Commit 88e89f5548a6e19bf837633f622764f2d1531748 upstream.

Create function imx_pcm_fiq_exit() to be paired with imx_pcm_fiq_init()
just like the pair of imx_pcm_dma_init() and imx_pcm_dma_exit().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoASoC: fsl: remove use of imx-pcm-audio from imx-ssi
Shawn Guo [Thu, 25 Apr 2013 03:18:47 +0000 (11:18 +0800)]
ASoC: fsl: remove use of imx-pcm-audio from imx-ssi

Commit 3b7d46380beae3de4a0f03ba4dcbd509c97ab503 upstream.

Rather than instantiating imx-pcm-audio to call imx_pcm_dma_init(),
imx-ssi can just directly call it to save the use of imx-pcm-audio.
With this change, imx-ssi becomes not only a cpu DAI but also a
platform device, so updates platform device setup in imx-mc13783 and
mx27vis-aic32x4 accordingly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoASoC: fsl: remove use of imx-pcm-audio from fsl_ssi
Shawn Guo [Thu, 25 Apr 2013 03:18:46 +0000 (11:18 +0800)]
ASoC: fsl: remove use of imx-pcm-audio from fsl_ssi

Commit bd41bc9696b5631b2c2fe26f40c8cdd99b3aeb3e upstream.

Rather than instantiating imx-pcm-audio to call imx_pcm_dma_init(),
fsl_ssi can just directly call it to save the use of imx-pcm-audio.
With this change, fsl_ssi becomes not only a cpu DAI but also a platform
device, so updates platform device setup in imx-sgtl5000 accordingly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agodma: imx-sdma: move to generic device tree bindings
Shawn Guo [Thu, 30 May 2013 14:23:32 +0000 (22:23 +0800)]
dma: imx-sdma: move to generic device tree bindings

Commit 9479e17c9bb455c01b369d294e01de8fa9b0a8d3 upstream.

Update imx-sdma driver to adopt generic DMA device tree bindings.  It
calls of_dma_controller_register() with imx-sdma specific of_dma_xlate
to get the generic DMA device tree helper support.  The #dma-cells for
imx-sdma must be 3, which includes request ID, peripheral type and
priority.

The existing way of requesting channel, clients directly call
dma_request_channel(), still work there, and will be removed after
all imx-sdma clients get converted to generic DMA device tree helper.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: ARM: imx: add CONFIG_GPIO_PCA953X into defconfig
Shawn Guo [Sun, 14 Jul 2013 14:41:23 +0000 (22:41 +0800)]
ENGR00269945: ARM: imx: add CONFIG_GPIO_PCA953X into defconfig

CONFIG_GPIO_PCA953X enables driver support for MAX7310 which is used on
imx6qdl-sabreauto board for IO expanders.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: ARM: dts: add uart3 support for imx6qdl-sabreauto
Shawn Guo [Sun, 14 Jul 2013 14:21:53 +0000 (22:21 +0800)]
ENGR00269945: ARM: dts: add uart3 support for imx6qdl-sabreauto

On imx6qdl-sabreauto board, the pin function UART3_CTS is steered by the
GPIO4 of MAX7310 Expander B, while UART3_RXD and UART3_TXD are steered
by GPIO3 of MAX7310 Expander C.  And both GPIOs need to be pulled high
to assert UART3 on the board.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoARM: dts: imx6qdl: add a new pinctrl for uart3
Huang Shijie [Fri, 12 Jul 2013 07:56:11 +0000 (15:56 +0800)]
ARM: dts: imx6qdl: add a new pinctrl for uart3

Add the a new pinctrl for uart3. In the imx6q{dl}-sabreauto boards,
the uart3 is used for Bluetooth.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoENGR00269945: ARM: dts: add max7310 support for imx6qdl-sabreauto
Shawn Guo [Sun, 14 Jul 2013 14:17:16 +0000 (22:17 +0800)]
ENGR00269945: ARM: dts: add max7310 support for imx6qdl-sabreauto

On imx6qdl-sabreauto board, there are three IO expanders implemented by
max7310, which are all controlled by I2C3.  And GPIO5_4 is steering the
I2C3_SDA availability, while GPIO1_15 is used to reset max7310.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: pinctrl: support pinctrl setting assertion via gpios
Shawn Guo [Mon, 15 Jul 2013 08:31:53 +0000 (16:31 +0800)]
ENGR00269945: pinctrl: support pinctrl setting assertion via gpios

It's pretty common that on some reference design or validation boards,
one pin could be used by two devices on board, and the pin route is
controlled by a GPIO.  So to assert the pin for given device, not only
the pinmux controller in SoC needs to be set up properly but also the
GPIO needs to be pulled up/down.

The patch adds support of a device tree property "pinctrl-assert-gpios"
under client device node.  It plays pretty much like a board level pin
multiplexer, and steers the pin route by controlling the GPIOs.  When
client device has the property represent in its node, pinctrl device
tree mapping function will firstly pull up/down the GPIOs to assert the
pins for the device at board level.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: gpio: pca953x: add device_reset() call
Shawn Guo [Sun, 14 Jul 2013 13:52:38 +0000 (21:52 +0800)]
ENGR00269945: gpio: pca953x: add device_reset() call

The pca953x type of devices, e.g. max7310, may have a reset which needs
to be handled to get the device start working.  Add a device_reset()
call for that, and defer the probe if the reset controller for that is
not ready yet.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: select ARCH_HAS_RESET_CONTROLLER for IMX
Shawn Guo [Sun, 14 Jul 2013 13:39:35 +0000 (21:39 +0800)]
ENGR00269945: select ARCH_HAS_RESET_CONTROLLER for IMX

Move ARCH_HAS_RESET_CONTROLLER from HAVE_IMX_SRC to ARCH_MXC to have it
selected for the whole IMX family instead of SRC (System Reset
Controller), since GPIO could be another reset controller in many cases.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: reset: add dummy device_reset() for !CONFIG_RESET_CONTROLLER build
Shawn Guo [Sun, 14 Jul 2013 13:35:49 +0000 (21:35 +0800)]
ENGR00269945: reset: add dummy device_reset() for !CONFIG_RESET_CONTROLLER build

Add dummy device_reset() function for !CONFIG_RESET_CONTROLLER build,
so that we do not have to add #ifdef CONFIG_RESET_CONTROLLER in every
single client device drivers that call the function.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: reset: build in CONFIG_RESET_GPIO by default
Shawn Guo [Sun, 14 Jul 2013 13:10:37 +0000 (21:10 +0800)]
ENGR00269945: reset: build in CONFIG_RESET_GPIO by default

GPIO is widely used as the reset control for various devices.  Let's
build the support in by default.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: reset: register gpio-reset driver in arch_initcall
Shawn Guo [Sun, 14 Jul 2013 12:41:00 +0000 (20:41 +0800)]
ENGR00269945: reset: register gpio-reset driver in arch_initcall

It's a little bit late to register gpio-reset driver at module_init
time, because gpio-reset provides reset control via gpio for other
devices which are mostly probed at module_init time too.  And it
becomes even worse, when the gpio comes from IO expander on I2C bus,
e.g. pca953x.  In that case, gpio-reset needs to be ready before I2C
bus driver which is generally ready at subsys_initcall time.  Let's
register gpio-reset driver in arch_initcall() to have it ready early
enough.

The defer probe mechanism is not used here, because a reset controller
driver should be reasonably registered early than other devices.  More
importantly, defer probe doe not help in some nasty cases, e.g. the
gpio-pca953x device itself needs a reset from gpio-reset driver start
working.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoENGR00269945: reset: handle cansleep case in gpio-reset
Shawn Guo [Sun, 14 Jul 2013 12:28:05 +0000 (20:28 +0800)]
ENGR00269945: reset: handle cansleep case in gpio-reset

Some gpio reset may be backed by a gpio that can sleep, e.g. pca953x
gpio output.  For such gpio, gpio_set_value_cansleep() should be
called.  Otherwise, the WARN_ON(chip->can_sleep) in gpiod_set_value()
will be hit.  Add a gpio_cansleep() check to handle cansleep gpio.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoreset: Add driver for gpio-controlled reset pins
Philipp Zabel [Thu, 30 May 2013 09:09:00 +0000 (11:09 +0200)]
reset: Add driver for gpio-controlled reset pins

This driver implements a reset controller device that toggle a gpio
connected to a reset pin of a peripheral IC. The delay between assertion
and de-assertion of the reset signal can be configured via device tree.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoARM: dts: add more imx6q/dl pin groups
Shawn Guo [Fri, 12 Jul 2013 03:38:50 +0000 (11:38 +0800)]
ARM: dts: add more imx6q/dl pin groups

Add more imx6q/dl pin groups for those supported boards, e.g. sabresd,
sabreauto, arm2.

IPU2 pin groups are added into imx6q.dtsi, since the block is only
available on imx6q.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoARM: dts: imx: share pad macro names between imx6q and imx6dl
Shawn Guo [Fri, 12 Jul 2013 01:07:14 +0000 (09:07 +0800)]
ARM: dts: imx: share pad macro names between imx6q and imx6dl

The imx6q and imx6dl are two pin-to-pin compatible SoCs.  The same board
design can work with either chip plugged into the socket, e.g. sabresd
and sabreauto boards.

We currently define pin groups in imx6q.dtsi and imx6dl.dtsi
respectively because the pad macro names are different between two
chips.  This brings a maintenance burden on having the same label point
to the same pin group defined in two places.

The patch replaces prefix MX6Q_ and MX6DL_ with MX6QDL_ for both SoCs
pad macro names.  Then the pin groups becomes completely common between
imx6q and imx6dl and can just be moved into imx6qdl.dtsi, so that the
long term maintenance of imx6q/dt pin settings becomes easier.

Unfortunately, the change brings some dramatic diff stat, but it's all
about DTS file, and the ultimate net diff stat is good.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoARM: dts: add more pin groups for imx6q/dl
Shawn Guo [Wed, 10 Jul 2013 03:06:17 +0000 (11:06 +0800)]
ARM: dts: add more pin groups for imx6q/dl

The patch adds pin groups that are already defined by community kernel,
so that both kernels can align on the pin group label names.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
10 years agoARM: dts: imx6q{dl}: add DTE pads for uart
Shawn Guo [Mon, 8 Jul 2013 09:14:20 +0000 (17:14 +0800)]
ARM: dts: imx6q{dl}: add DTE pads for uart

The uart2 in the imx6q-arm2 board is used as a DTE uart,
this patch adds the necessary DTE pads for uart2.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>