]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoENGR00329948-2: dma: imx-sdma: Add device to device support
Shengjiu Wang [Thu, 4 Sep 2014 02:52:45 +0000 (10:52 +0800)]
ENGR00329948-2: dma: imx-sdma: Add device to device support

This patch adds DEV_TO_DEV support for i.MX SDMA driver to support data
tranfer between two peripheral FIFOs. The per_2_per script requires two
peripheral addresses and two DMA requests, a bit different from the other
scripts.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00329948-1: firmware: imx: add latest sdma script
Shengjiu Wang [Thu, 4 Sep 2014 08:31:10 +0000 (16:31 +0800)]
ENGR00329948-1: firmware: imx: add latest sdma script

This is V3 version sdma firmware, which add support for qspi and canfd.
Another update sdma driver for this new script.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoENGR00330358 ARM: IMX6SL-EVK: PXP-V4L2: add pxp v4l2 support to 3.14 branch
Fancy Fang [Fri, 5 Sep 2014 01:23:27 +0000 (09:23 +0800)]
ENGR00330358 ARM: IMX6SL-EVK: PXP-V4L2: add pxp v4l2 support to 3.14 branch

1. Add the 'pxp_v4l2_out' entry to imx6sl-evk.dtb to enable
   the pxp v4l2 output driver.
2. Correct the backlight device node position in imx6sl-evk.dtb.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
9 years agoENGR00330128 ARM: IMX6SL: PXP: add pxp support to 3.14 branch
Fancy Fang [Wed, 3 Sep 2014 09:17:54 +0000 (17:17 +0800)]
ENGR00330128 ARM: IMX6SL: PXP: add pxp support to 3.14 branch

1. Add pxp related properties to the imx6sl dts to enable this module.
2. Configure the PXP related clocks properly.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
9 years agoENGR00330163 ARM: clk-imx6sl: correct the pxp and epdc axi clock selections
Fancy Fang [Thu, 4 Sep 2014 07:38:08 +0000 (15:38 +0800)]
ENGR00330163 ARM: clk-imx6sl: correct the pxp and epdc axi clock selections

The parent clocks of IMX6SL_CLK_PXP_AXI_SEL and IMX6SL_CLK_EPDC_AXI_SEL
clocks are not the same. So split the epdc_pxp_sels into two different
clock selections 'pxp_axi_sels' and 'epdc_axi_sels'.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
Signed-off-by: Robby Cai <R63905@freescale.com>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00329491 ARM: IMX6SX: PXP-V4L2: add pxp v4l2 support to 3.14 branch
Fancy Fang [Mon, 1 Sep 2014 08:09:31 +0000 (16:09 +0800)]
ENGR00329491 ARM: IMX6SX: PXP-V4L2: add pxp v4l2 support to 3.14 branch

1. Add pxp-v4l2 dts support for imx6sx platform.
2. Add v4l2_device to the pxp-v4l2 driver to pass the WARN_ON()
   check new added in 3.14 kernel.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
9 years agoENGR00329352-3 dts: imx6: ocotp register access needs clock
Dong Aisheng [Thu, 28 Aug 2014 08:37:13 +0000 (16:37 +0800)]
ENGR00329352-3 dts: imx6: ocotp register access needs clock

Without clock, accessing ocotp register will cause system hang.
So define the clock here in device tree for driver to use.

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

9 years agoENGR00329352-2 doc: syscon: add clocks as optional property
Dong Aisheng [Thu, 28 Aug 2014 09:01:34 +0000 (17:01 +0800)]
ENGR00329352-2 doc: syscon: add clocks as optional property

User can specify clocks in devicetree which is used for accessing the registers
in this regmap.

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

9 years agoENGR00329352-1 regmap: regmap-mmio: make clk_id optionally when getting clock
Dong Aisheng [Wed, 27 Aug 2014 07:55:59 +0000 (15:55 +0800)]
ENGR00329352-1 regmap: regmap-mmio: make clk_id optionally when getting clock

According to clock framework, the clk_id could be NULL when getting clock.
But current code relies on a non null clk_id to get clock.
Changing the code to allow a null clk_id to get clock to make it more
reasonable to use.
And the regmap_mmio_gen_context will try to get clock by default but ignore
error if not finding the clock in case some regmap access not reply on
a specific clock.

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

9 years agoENGR00320355 dts: imx6: mmc index fixed by controller order
Dong Aisheng [Thu, 26 Jun 2014 09:39:15 +0000 (17:39 +0800)]
ENGR00320355 dts: imx6: mmc index fixed by controller order

Make the linux mmc index to be fixed according to controller order.
This can make user easily to identify which mmcX corresponding to which
controller and kernel be able find the rootfs in a card plugged in a
specific slot persistently.

This is a eventually solution for finding mmc block devices correctly
for different cards on multi slots.

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

9 years agommc: Allow setting slot index via devicetree alias
Sascha Hauer [Fri, 20 Jun 2014 07:08:16 +0000 (15:08 +0800)]
mmc: Allow setting slot index via devicetree alias

As with gpio, uart and others, allow specifying the name_idx via the
aliases-node in the devicetree.

On embedded devices, there is often a combination of removable (e.g.
SD card) and non-removable mmc devices (e.g. eMMC).
Therefore the name_idx might change depending on
- host of removable device
- removable card present or not

This makes it difficult to hard code the root device, if it is on the
non-removable device. E.g. if SD card is present eMMC will be mmcblk1,
if SD card is not present at boot, eMMC will be mmcblk0.

If the aliases-node is not found, the driver will act as before.

The original patch is from here:
https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html

The patch requires additional alias_id fix or it won't work.
Because according to function definition the max_idx parameter of idx_alloc
is exclusive, so need add 1 or it will be unable to find the proper idx
within an invalid range.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 35928d6c6a76a24a16edfa636f4c08293614a1e0)

9 years agoof: Add helper for getting the maximum alias index for a stem
Sascha Hauer [Thu, 22 May 2014 15:30:22 +0000 (17:30 +0200)]
of: Add helper for getting the maximum alias index for a stem

of_alias_max_index will return the maximum number for which an
alias of a given stem exists. This is useful for frameworks
whishing to reserve a number of device slots from dynamic
allocation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
(cherry picked from commit 5ce2ad39b36fd48b9f77249198655da7cbcc7ee5)

9 years agoENGR00323682 MMC: Fixed boot_config overwritten by switch partition
Ye.Li [Mon, 21 Jul 2014 13:53:50 +0000 (21:53 +0800)]
ENGR00323682 MMC: Fixed boot_config overwritten by switch partition

In MMC driver, two variables: boot_config and part_config  are used to
keep eCSD(179) PARTITION_CONFIG. The part_config is not updated when
set new boot_config, which causes the eCSD(179) is overwritten by
any following partition switching, so the new boot_config is lost.

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit e66d21ade29855299ce048c97830a4bb79373761)

9 years agoENGR00329475-5 ARM: imx: make sure OCOTP clk is enabled in MSL
Anson Huang [Mon, 1 Sep 2014 08:19:17 +0000 (16:19 +0800)]
ENGR00329475-5 ARM: imx: make sure OCOTP clk is enabled in MSL

As some modules need to access ocotp in MSL, so we need to
make sure it is enabled during MSL, after kernel boot up,
clk dirver will disable it in late init.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00329475-4 ARM: imx: support perclk and uart clk parent to OSC on i.mx6sx
Anson Huang [Mon, 1 Sep 2014 08:08:07 +0000 (16:08 +0800)]
ENGR00329475-4 ARM: imx: support perclk and uart clk parent to OSC on i.mx6sx

change perclk parent to OSC instead of IPG, as IPG clock may
be changed by busfreq.

when kernel command line has "uart_from_osc" defined, uart clk will
select OSC as its parent, this is to make PLL3 be able to be off
for low power purpose, as we need all PLLs off in low power idle
mode.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00329475-3 ARM: imx: enable CONFIG_DEBUG_FS by default
Anson Huang [Mon, 1 Sep 2014 08:01:09 +0000 (16:01 +0800)]
ENGR00329475-3 ARM: imx: enable CONFIG_DEBUG_FS by default

enable CONFIG_DEBUG_FS by default for kernel debugging.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00329475-2 ARM: imx: correct gpu2d_axi and gpu3d_axi clock setting
Anson Huang [Mon, 1 Sep 2014 07:34:08 +0000 (15:34 +0800)]
ENGR00329475-2 ARM: imx: correct gpu2d_axi and gpu3d_axi clock setting

On i.MX6Q, gpu2d_axi and gpu3d_axi are either from AXI or
AHB clock, but on i.MX6DL, gpu2d_axi and gpu3d_axi are
from mmdc_ch0_axi_podf, and they can NOT be gated by mmdc_ch0_axi
's clock gate, the mux option register field(CCM_CBCMR)
is marked as "Reserved" now on i.MX6DL RM, so correct these
two clks setting.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00329475-1 ARM: dts: imx6sx-sdb: add gpio key support
Anson Huang [Mon, 1 Sep 2014 07:24:53 +0000 (15:24 +0800)]
ENGR00329475-1 ARM: dts: imx6sx-sdb: add gpio key support

This patch adds support for imx6sx-sdb board's gpio keys:

SW4(FUNC1): KEY_VOLUMEUP
SW5(FUNC2): KEY_VOLUMEDOWN

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoclk: Support for clock parents and rates assigned from device tree
Sylwester Nawrocki [Wed, 18 Jun 2014 15:29:32 +0000 (17:29 +0200)]
clk: Support for clock parents and rates assigned from device tree

This patch adds helper functions to configure clock parents and rates
as specified through 'assigned-clock-parents', 'assigned-clock-rates'
DT properties for a clock provider or clock consumer device.
The helpers are now being called by the bus code for the platform, I2C
and SPI busses, before the driver probing and also in the clock core
after registration of a clock provider.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
[shawn.guo: cherry-pick commit 86be408bfbd8 from upstream]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoclk: Add of_clk_get_by_clkspec() helper
Sylwester Nawrocki [Mon, 19 May 2014 17:22:50 +0000 (19:22 +0200)]
clk: Add of_clk_get_by_clkspec() helper

This patch adds of_clk_get_by_clkspec() helper function, which does only
a struct clk lookup from the clock providers. It is used in the subsequent
patch where parsing of a clock from device tree and the lookup from
providers needed to be split.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
[shawn.guo: cherry-pick commit 7f05e28f9dd3 from upstream]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00329774-3 ARM: dts: imx6qdl: Add dts support on i.MX6Q/DL-ARD.
Luwei Zhou [Wed, 3 Sep 2014 06:06:21 +0000 (14:06 +0800)]
ENGR00329774-3 ARM: dts: imx6qdl: Add dts support on i.MX6Q/DL-ARD.

Add device tree support on i.MX6Q/DL-ARD platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00329774-2 mxc: mlb: Remove the unnecessary code out.
Luwei Zhou [Wed, 3 Sep 2014 06:24:50 +0000 (14:24 +0800)]
ENGR00329774-2 mxc: mlb: Remove the unnecessary code out.

The regulator is not used by MLB driver. Remove the related code out.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00329774-1 ARM: imx_v7_defconfig: Compile MLB to module
Luwei Zhou [Wed, 3 Sep 2014 06:18:46 +0000 (14:18 +0800)]
ENGR00329774-1 ARM: imx_v7_defconfig: Compile MLB to module

Modify the compile MLB driver as a module.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoENGR00314144 mxc: mlb: Rename the mxc_mlb150 to mxc_mlb.
luweizhou [Tue, 24 Jun 2014 04:15:00 +0000 (12:15 +0800)]
ENGR00314144 mxc: mlb: Rename the mxc_mlb150 to mxc_mlb.

Since i.MX6SX doesn't supports MLB150 , it is not strictly explicit to
name driver module as mxc_mlb150.ko. Rename it to mxc_mlb.ko.It would be
more common.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from commit feaf9522a759863c58e47a00f0a070ced8f9e749)

9 years agoENGR00311027 gpu:Limit the memory consumption for webgl
Loren Huang [Thu, 3 Jul 2014 09:54:04 +0000 (17:54 +0800)]
ENGR00311027 gpu:Limit the memory consumption for webgl

-When system memory is less than 200M, we will block further
memory allocation for webgl.
It's for pass webgl 1.0.2 conformance case conformance/rendering/multisample-cor
ruption.html
It's a temperory patch from vivante, should be removed in 5.0.11p2.
Original patch name:5x_crash_patch.diff

Date: Jul 03, 2014
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Shawn Guo
(cherry picked from commit 0d83d7e87d8d16a097c3c8bec6fa6ac25da225be)

9 years agoENGR00317558 gpu:5.0.11p1 gpu driver kernel part integration
Shawn Xiao [Mon, 1 Sep 2014 05:03:15 +0000 (13:03 +0800)]
ENGR00317558 gpu:5.0.11p1 gpu driver kernel part integration

(cherry picked from commit a6f5349968e494d67f9da339dad433b528ce52fe)

Conflict:
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
Revert "ENGR00317981: gpu-viv: use runtime pm for VDDPU management" and
move the same change logic to file gc_hal_kernel_platform_imx6q14.c for
following p1 framework change.

Date: Jun 16, 2014
Signed-off-by: Loren Huang <b02279@freescale.com>
Signed-off-by: Shawn Xiao <b49994@freescale.com>
Acked-by: Shawn Guo
9 years agoENGR00317981 ARM: imx: remove imx_scu_standby_enable()
Shawn Guo [Mon, 1 Sep 2014 01:46:25 +0000 (09:46 +0800)]
ENGR00317981 ARM: imx: remove imx_scu_standby_enable()

With commit 4ed95424c715 ("ARM: 8122/1: smp_scu: enable SCU standby
support"), the STANDBY bit of SCU is handled by core function
scu_enable().  So imx_scu_standby_enable() can be removed now.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00329330 ARM: IMX6SX: PXP: thread wait queue should be init before thread creation
Fancy Fang [Fri, 29 Aug 2014 07:21:54 +0000 (15:21 +0800)]
ENGR00329330 ARM: IMX6SX: PXP: thread wait queue should be init before thread creation

Since the thread function will use the thread wait queue
as soon as the thread is created.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit 325544504ea2bd73749ef65064be0b4ab885b987)

9 years agoENGR00329334 ARM: IMX6SX: PXP: add dtb support for PXP in 3.14 kernel branch
Fancy Fang [Fri, 29 Aug 2014 07:41:55 +0000 (15:41 +0800)]
ENGR00329334 ARM: IMX6SX: PXP: add dtb support for PXP in 3.14 kernel branch

Add the dtb support for PXP to the new kernel branch
3.14.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
9 years agoENGR00329278-03 dtsi: imx6sx: sdb: enable lcdif driver
Sandor Yu [Fri, 29 Aug 2014 08:05:15 +0000 (16:05 +0800)]
ENGR00329278-03 dtsi: imx6sx: sdb: enable lcdif driver

-Enable lcdif driver
-Enable pwm backlight driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00329278-02 dtsi: imx6sl: evk: enable lcdif driver
Sandor Yu [Fri, 29 Aug 2014 03:14:45 +0000 (11:14 +0800)]
ENGR00329278-02 dtsi: imx6sl: evk: enable lcdif driver

-Enable lcdif driver
-Enable pwm backlight driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00329278-01 lcdif: merge code from imx_3.10.y branch
Sandor Yu [Fri, 29 Aug 2014 03:10:57 +0000 (11:10 +0800)]
ENGR00329278-01 lcdif: merge code from imx_3.10.y branch

Merge code from imx_3.10.y branch.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00322015 dts: imx6qdl: dcic: set dcic1 as disp-axi clock for dcic2
Sandor Yu [Wed, 9 Jul 2014 08:54:39 +0000 (16:54 +0800)]
ENGR00322015 dts: imx6qdl: dcic: set dcic1 as disp-axi clock for dcic2

On imx6dl dcic2 clock gate depend on dcic1,
so setting dcic1 as disp-axi clock for dcic2 in imx6qdl dts.

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

9 years agoENGR00329096-03 dts: Enable dcic driver for imx6sx
Sandor Yu [Thu, 28 Aug 2014 06:01:07 +0000 (14:01 +0800)]
ENGR00329096-03  dts: Enable dcic driver for imx6sx

Enable dcic driver for imx6sx SDB board.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00329096-02 dts: Enable dcic driver for imx6q/dl
Sandor Yu [Thu, 28 Aug 2014 05:51:50 +0000 (13:51 +0800)]
ENGR00329096-02 dts: Enable dcic driver for imx6q/dl

Enable dcic driver for imx6q/dl SabreSD and SabreAI

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00317086-3 dcic: Add dcic driver source code
Sandor Yu [Tue, 1 Jul 2014 07:51:20 +0000 (15:51 +0800)]
ENGR00317086-3 dcic: Add dcic driver source code

Add dcic driver source code.
Support two instance dcic1 and dcic2.

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

9 years agoENGR00317086-2 gpr: Add dcic mux define in gpr head file
Sandor Yu [Tue, 1 Jul 2014 07:48:57 +0000 (15:48 +0800)]
ENGR00317086-2 gpr: Add dcic mux define in gpr head file

Add dcic mux bit define in gpr head file for both imx6q and imx6sx.

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

9 years agoENGR00329096 clk: Add dcic clock define for imx6q
Sandor Yu [Thu, 28 Aug 2014 05:38:15 +0000 (13:38 +0800)]
ENGR00329096 clk: Add dcic clock define for imx6q

Add dcic1 and dcic define in imx6q clock tree.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoARM: 8122/1: smp_scu: enable SCU standby support
Shawn Guo [Thu, 31 Jul 2014 01:07:37 +0000 (02:07 +0100)]
ARM: 8122/1: smp_scu: enable SCU standby support

With SCU standby enabled, SCU CLK will be turned off when all processors
are in WFI mode.  And the clock will be turned on when any processor
leaves WFI mode.

This behavior should be preferable in terms of power efficiency of
system idle.  So let's set the SCU standby bit to enable the support in
function scu_enable().

Cortex-A9 earlier than r2p0 has no standby bit in SCU, so we need to
skip setting the bit for those.

shawn.guo: cherry-pick commit c716483c3db1 from upstream

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: 8121/1: smp_scu: use macro for SCU enable bit
Shawn Guo [Thu, 31 Jul 2014 01:07:00 +0000 (02:07 +0100)]
ARM: 8121/1: smp_scu: use macro for SCU enable bit

Use macro instead of magic number for SCU enable bit.

shawn.guo: cherry-pick commit f8f3d4ed0d64 from upstream

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoARM: 8103/1: save/restore Cortex-A9 CP15 registers on suspend/resume
Shawn Guo [Wed, 16 Jul 2014 06:40:53 +0000 (07:40 +0100)]
ARM: 8103/1: save/restore Cortex-A9 CP15 registers on suspend/resume

The CP15 diagnostic register holds ARM errata bits on Cortex-A9, so it
needs to be saved/restored on suspend/resume.  Otherwise, the
effectiveness of errata workaround gets lost together with diagnostic
register bit across suspend/resume cycle.  And the CP15 power control
register of Cortex-A9 shares the same problem.

The patch adds a couple of Cortex-A9 specific suspend/resume functions
to save/restore these two Cortex-A9 CP15 registers across the
suspend/resume cycle.

shawn.guo: cherry-pick commit ddd0c5301822 from upstream

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
9 years agoENGR00317981: ARM: dts: add dumb dts for enetirq and ldo
Shawn Guo [Wed, 27 Aug 2014 15:51:39 +0000 (23:51 +0800)]
ENGR00317981: ARM: dts: add dumb dts for enetirq and ldo

Add a couple of dumb dts files for enetirq and ldo cases, which are
asked by Yocto build for 3.14 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoi2c: imx: fix the i2c bus hang issue when do repeat restart
Fugang Duan [Wed, 30 Apr 2014 06:24:58 +0000 (14:24 +0800)]
i2c: imx: fix the i2c bus hang issue when do repeat restart

Test i2c device Maxim max44009, datasheet is located at:
http://www.maximintegrated.com/datasheet/index.mvp/id/7175

The max44009 support repeat operation like:
read -> repeat restart -> read/write

The current i2c imx host controller driver don't support this
operation that causes i2c bus hang due to "MTX" is cleared in
.i2c_imx_read(). If "read" is the last message there have no problem,
so the current driver supports all SMbus operation like:
write -> repeat restart -> read/write

IMX i2c controller for master receiver has some limitation:
- If it is the last byte for one operation, it must generate STOP
  signal before read I2DR to prevent controller from generating another
  clock cycle.
- If it is the last byte in the read, and then do repeat restart, it must
  set "MTX" before read I2DR to prevent controller from generating another
  extra clock cycle.

The patch is to fix the issue.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 054b62d9f25c903958749e4cea25261324a7a2a4)

Signed-off-by: haibo.chen <haibo.chen@freescale.com>
9 years agoENGR00328912: dts hdmi: Add hdmi item to imx6 dts file
Sandor Yu [Wed, 27 Aug 2014 07:04:32 +0000 (15:04 +0800)]
ENGR00328912: dts hdmi: Add hdmi item to imx6 dts file

Code merger from imx_3.10_y branch
-Add hdmi core driver, hdmi video and hdmi audio item to dts file
-Add hdcp and cec item

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agodmaengine: imx-sdma: Save imx_dma_data into sdmac
Nicolin Chen [Mon, 16 Jun 2014 03:32:29 +0000 (11:32 +0800)]
dmaengine: imx-sdma: Save imx_dma_data into sdmac

The filter() function is currently called by xlate() while it transfers
imx_dma_data as a local variable to the filter() but releases the data
right after returning a DMA channel pointer, which results chan->private
pointing an invalid memory space.

So this patch just stores the imx_dma_data into sdmac to make usre the
private pointer valid as long as the channel exists.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit 0b3518652c596b00c1592b5adb2544db75b5ef57)

9 years agoASoC: fsl-esai: Revert .xlate_tdm_slot_mask() support
Shengjiu Wang [Fri, 8 Aug 2014 06:47:22 +0000 (14:47 +0800)]
ASoC: fsl-esai: Revert .xlate_tdm_slot_mask() support

This reverts commit a603c8ee526f5ea9ad9b40710308766299ad8a69.

fsl_asoc_xlate_tdm_slot_mask() is different with snd_soc_xlate_tdm_slot_mask().
fsl_asoc_xlate_tdm_slot_mask() will set the enabled bit to 0, disabled bit
to 1. snd_soc_xlate_tdm_slot_mask() will set the enabled bit to 1, disabled
bit to 0.
For esai when the bit value is 1, the slot is enabled, when the bit value is 0,
the slot is disabled. If using fsl_asoc_xlate_tdm_slot_mask(), the esai will
work abnormally. So revert this patch, make the esai use default function.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 769091ee18056b3aa35b415d9768fb23f361e598)

9 years agoASoC: imx-audmux: Use uintptr_t for port numbers
Mark Brown [Fri, 1 Aug 2014 16:55:55 +0000 (17:55 +0100)]
ASoC: imx-audmux: Use uintptr_t for port numbers

Since we pass the port number through file private data for debugfs we cast
it to and from a pointer so use uintptr_t in order to ensure that the
types are compatible, avoiding warnings on 64 bit platforms where pointers
are 64 bit and unsigned integers 32 bit.

Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e5f89768e9bc1f441d18e2299518a2907e5017c9)

9 years agoASoC: fsl_asrc: Don't access members of config before checking it
Nicolin Chen [Mon, 4 Aug 2014 04:19:49 +0000 (12:19 +0800)]
ASoC: fsl_asrc: Don't access members of config before checking it

sound/soc/fsl/fsl_asrc.c:250 fsl_asrc_config_pair()
warn: variable dereferenced before check 'config' (see line 243)

git remote add next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout 3117bb3109dc223e186302f5dc8ce9ed04adca90
vim +/config +250 sound/soc/fsl/fsl_asrc.c

  237   */
  238  static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair)
  239  {
  240   struct asrc_config *config = pair->config;
  241   struct fsl_asrc *asrc_priv = pair->asrc_priv;
  242   enum asrc_pair_index index = pair->index;
 @243   u32 inrate = config->input_sample_rate, indiv;
  244   u32 outrate = config->output_sample_rate, outdiv;
  245   bool ideal = config->inclk == INCLK_NONE;
  246   u32 clk_index[2], div[2];
  247   int in, out, channels;
  248   struct clk *clk;
  249
 @250   if (!config) {
  251           pair_err("invalid pair config\n");
  252           return -EINVAL;
  253   }

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4e13eb722153a5ad66edd80bc26c3028d96a7b93)

9 years agoASoC: fsl_sarc_dma: Check pair before using it
Nicolin Chen [Mon, 4 Aug 2014 04:19:48 +0000 (12:19 +0800)]
ASoC: fsl_sarc_dma: Check pair before using it

The patch 3117bb3109dc: "ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and
platform drivers" from Jul 29, 2014, leads to the following Smatch
complaint:

sound/soc/fsl/fsl_asrc_dma.c:304 fsl_asrc_dma_shutdown()
warn: variable dereferenced before check 'pair' (see line 302)

sound/soc/fsl/fsl_asrc_dma.c
301          struct fsl_asrc_pair *pair = runtime->private_data;
302          struct fsl_asrc *asrc_priv = pair->asrc_priv;
                                          ^^^^^^^^^^^^^^^
                                            Dereference.

303
304          if (pair && asrc_priv->pair[pair->index] == pair)
                 ^^^^
                Check.

305                  asrc_priv->pair[pair->index] = NULL;
306

So we just let the driver check pair before using it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6ccf62c7bea561cca7ffbd50839f883327080800)

9 years agoASoC: fsl_ssi: Add stream names for DPCM usage
Nicolin Chen [Wed, 30 Jul 2014 03:10:29 +0000 (11:10 +0800)]
ASoC: fsl_ssi: Add stream names for DPCM usage

DPCM needs extra dapm routes in the machine driver to route audio
between Front-End and Back-End. In order to differ the stream names
in the route map from CODECs, we here add specific stream names to
SSI driver so that we can implement ASRC via DPCM to it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e365500459095276d19a920d5be1a65d0ef9999c)

9 years agoASoC: fsl_spdif: Add stream names for DPCM usage
Nicolin Chen [Wed, 30 Jul 2014 03:10:28 +0000 (11:10 +0800)]
ASoC: fsl_spdif: Add stream names for DPCM usage

DPCM needs extra dapm routes in the machine driver to route audio
between Front-End and Back-End. In order to differ the stream names
in the route map from CODECs, we here add specific stream names to
SPDIF driver so that we can implement ASRC via DPCM to it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 756409320bcb366aa5954b4162612aa4be7e37a4)

9 years agoASoC: fsl_sai: Add stream names for DPCM usage
Nicolin Chen [Wed, 30 Jul 2014 03:10:27 +0000 (11:10 +0800)]
ASoC: fsl_sai: Add stream names for DPCM usage

DPCM needs extra dapm routes in the machine driver to route audio
between Front-End and Back-End. In order to differ the stream names
in the route map from CODECs, we here add specific stream names to
SAI driver so that we can implement ASRC via DPCM to it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 20d5b76fb2c7070c70fc91b666f5395e5d16e197)

9 years agoASoC: fsl_esai: Add stream names for DPCM usage
Nicolin Chen [Wed, 30 Jul 2014 03:10:26 +0000 (11:10 +0800)]
ASoC: fsl_esai: Add stream names for DPCM usage

DPCM needs extra dapm routes in the machine driver to route audio
between Front-End and Back-End. In order to differ the stream names
in the route map from CODECs, we here add specific stream names to
ESAI driver so that we can implement ASRC via DPCM to it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 74ccb27c35c799a14933c282c4e3c864886fc429)

9 years agoASoC: fsl_asrc: fix an error code in fsl_asrc_probe()
Dan Carpenter [Thu, 31 Jul 2014 09:32:09 +0000 (12:32 +0300)]
ASoC: fsl_asrc: fix an error code in fsl_asrc_probe()

There is a cut and paste bug so it returns success instead of the error
code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d387dd08e444b22f844475780fe12a1ad1c6fffd)

9 years agoASoC: fsl_asrc: Fix sparse warnings in FSL_ASRC_FORMATS due to typo
Nicolin Chen [Thu, 31 Jul 2014 04:07:40 +0000 (12:07 +0800)]
ASoC: fsl_asrc: Fix sparse warnings in FSL_ASRC_FORMATS due to typo

reproduce: make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> sound/soc/fsl/fsl_asrc.c:563:28: sparse: restricted snd_pcm_format_t degrades to integer
>> sound/soc/fsl/fsl_asrc.c:570:28: sparse: restricted snd_pcm_format_t degrades to integer

vim +563 sound/soc/fsl/fsl_asrc.c

  557          .probe = fsl_asrc_dai_probe,
  558          .playback = {
  559                  .stream_name = "ASRC-Playback",
  560                  .channels_min = 1,
  561                  .channels_max = 10,
  562                  .rates = FSL_ASRC_RATES,
> 563                  .formats = FSL_ASRC_FORMATS,
  564          },
  565          .capture = {
  566                  .stream_name = "ASRC-Capture",
  567                  .channels_min = 1,
  568                  .channels_max = 10,
  569                  .rates = FSL_ASRC_RATES,
> 570                  .formats = FSL_ASRC_FORMATS,
  571          },
  572          .ops = &fsl_asrc_dai_ops,
  573  };

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d526416c4fb23a48ed2547138c43e96fa3901124)

9 years agoASoC: fsl: fsl_asrc: Select SND_SOC_GENERIC_DMAENGINE_PCM
Fabio Estevam [Wed, 30 Jul 2014 14:27:06 +0000 (11:27 -0300)]
ASoC: fsl: fsl_asrc: Select SND_SOC_GENERIC_DMAENGINE_PCM

Building a kernel with SND_SOC_GENERIC_DMAENGINE_PCM=n leads to the following
error:

ERROR: "snd_dmaengine_pcm_prepare_slave_config" [sound/soc/fsl/snd-soc-fsl-asrc.ko] undefined!

Let SND_SOC_FSL_ASRC select SND_SOC_GENERIC_DMAENGINE_PCM in order to fix such
error.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit bdb9eb49671566afb9ca2025752f57d0e1a6b2a3)

9 years agoASoC: fsl_asrc: Use 'ifdef' for config options
Fabio Estevam [Tue, 29 Jul 2014 19:10:16 +0000 (16:10 -0300)]
ASoC: fsl_asrc: Use 'ifdef' for config options

Fix the following build errors that were observed by building with
make ARCH=microblaze allyesconfig:

>> sound/soc/fsl/fsl_asrc.c:906:5: warning: "CONFIG_PM_RUNTIME" is not defined [-Wundef]
    #if CONFIG_PM_RUNTIME
        ^
>> sound/soc/fsl/fsl_asrc.c:934:5: warning: "CONFIG_PM_SLEEP" is not defined [-Wundef]
    #if CONFIG_PM_SLEEP
        ^
>> sound/soc/fsl/fsl_asrc.c:906:5: warning: "CONFIG_PM_RUNTIME" is not defined [-Wundef]
    #if CONFIG_PM_RUNTIME
        ^
>> sound/soc/fsl/fsl_asrc.c:934:5: warning: "CONFIG_PM_SLEEP" is not defined [-Wundef]
    #if CONFIG_PM_SLEEP

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit d3dacda9390b936a1c341d868f548944cc1c70de)

9 years agoASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers
Nicolin Chen [Tue, 29 Jul 2014 10:08:53 +0000 (18:08 +0800)]
ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers

The Asynchronous Sample Rate Converter (ASRC) converts the sampling rate of a
signal associated with an input clock into a signal associated with a different
output clock. The driver currently works as a Front End of DPCM with other Back
Ends DAI links such as ESAI<->CS42888 and SSI<->WM8962 and SAI. It converts the
original sample rate to a common rate supported by Back Ends for playback while
converts the common rate of Back Ends to a desired rate for capture. It has 3
pairs to support three different substreams within totally 10 channels.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Varka Bhadram <varkabhadram@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3117bb3109dc223e186302f5dc8ce9ed04adca90)

9 years agoASoC: fsl_sai: Improve enable flow in fsl_sai_trigger()
Nicolin Chen [Wed, 23 Jul 2014 11:23:40 +0000 (19:23 +0800)]
ASoC: fsl_sai: Improve enable flow in fsl_sai_trigger()

The previous enable flow:
1, Enable TE&RE (SAI starts to consume tx FIFO and feed rx FIFO)
2, Mask IRQ of Tx/Rx to enable its interrupt.
3, Enable DMA request of Tx/Rx.

As this flow would enable DMA request later than TERE, the Tx FIFO
would be easily emptied into underrun while Rx FIFO would be easily
stuffed into overrun due to the delayed DMA transfering.

This issue happened merely occational before the patch 'ASoC: fsl_sai:
Reset FIFOs after disabling TE/RE' because there were useless data
remaining in the FIFO for the gap. However, it manifested after FIFO
reset's implemented.

After this patch, the new flow:
1, Enable DMA request of Tx/Rx.
2, Enable TE&RE (SAI starts to consume tx FIFO and feed rx FIFO)
3, Mask IRQ of Tx/Rx to enable its interrupt.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a3fdc6749edf4dcb07df3a10bbdd9850ed5fd01a)

9 years agoASoC: fsl_sai: Don't reset FIFO until TE/RE bit is unset
Nicolin Chen [Wed, 23 Jul 2014 11:23:39 +0000 (19:23 +0800)]
ASoC: fsl_sai: Don't reset FIFO until TE/RE bit is unset

TE/RE bit of T/RCSR will remain set untill the current frame is physically
finished. The FIFO reset operation should wait this bit's totally cleared
rather than ignoring its status which might cause TE/RE disabling failed.

This patch adds delay and timeout to wait for its completion before FIFO
reset.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit c44b56af9ca3a6f135d8f22b9a240f53909b371e)

9 years agoASoC: fsl_sai: Reduce race condition during TE/RE enabling
Nicolin Chen [Wed, 23 Jul 2014 11:23:38 +0000 (19:23 +0800)]
ASoC: fsl_sai: Reduce race condition during TE/RE enabling

For trigger start, we don't need to check if it's the first time to
enable TE/RE or second time. It doesn't hurt to enable them any way,
which in the meantime can reduce race condition for TE/RE enabling.

For trigger stop, we will definitely clear FRDE of current direction.
Thus the driver only needs to read the opposite one's.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f4075a8f452aff5465c6522c92da9db71ed11b7f)

9 years agoASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr()
Nicolin Chen [Thu, 17 Jul 2014 13:21:38 +0000 (21:21 +0800)]
ASoC: fsl_sai: Fix incorrect register writing in fsl_sai_isr()

In the rx irq handling part, we should clear the flags in RCSR not TCSR.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4800f88b615f194ae3c1577038a7ccd871c907c9)

9 years agoASoC: fsl_sai: Reset FIFOs after disabling TE/RE
Nicolin Chen [Thu, 17 Jul 2014 13:21:37 +0000 (21:21 +0800)]
ASoC: fsl_sai: Reset FIFOs after disabling TE/RE

SAI will not clear their FIFOs after disabling TE/RE. Therfore, the driver
should take care the task so as not to let useless data remain in the FIFO.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit eff952b733d4c1ff3a6b35accce940b223372978)

9 years agoUpdate imx-sdma cyclic handling to report residue
Russell King - ARM Linux [Wed, 25 Jun 2014 12:00:33 +0000 (13:00 +0100)]
Update imx-sdma cyclic handling to report residue

I received a report this morning from one of the Novena developers that
the behaviour of the iMX6 ASoC codec driver (using imx-pcm-dma.c) was
sub-optimal under high system load.

While there are issues relating to system load remaining, upon reviewing
the ASoC imx-pcm-dma.c driver, it was noticed that it not using the
residue support, because SDMA doesn't support it.  This has the effect
that SDMA has to make multiple calls into the ASoC and ALSA code, one
for each period.

Since ALSA's snd_pcm_elapsed() does not need to be called multiple times
and it is entirely sufficient to call it once to update ALSA with the
current buffer position via the pointer method, we can do better here.
We can also avoid stopping the DMA entirely, just like real cyclic DMA
implementations behave.  While this means that we replay some old samples,
this is a nicer behaviour than having audio stop and restart.

The changes to achieve this are relatively minor - imx-sdma.c can track
where the DMA is to the nearest descriptor boundary - it does this
already when deciding how many callbacks to issue.  In doing this,
buf_tail always points at the descriptor which will complete next.

The residue is defined by the bytes remaining to the end of the buffer,
when the buffer is viewed as a single block of memory [start...end].
So, when we start out, there's a full buffer worth of residue, and this
counts down as we approach the end of the buffer, eventually becoming
zero at the end, before returning to the full buffer worth when we
wrap back to the start.

Moving the walking of the descriptors into the interrupt handler means
that we can update the BD_DONE flag at interrupt time, thus avoiding
a delayed tasklet stopping the cyclic DMA.

This means that the residue can be calculated from (total descriptors -
buf_tail) * descriptor size.  This is what the change below does.  We
update imx-pcm-dma.c to remove the NO_RESIDUE flag since we now provide
the residue.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit d1a792f3b4072bfac4150bb62aa34917b77fdb6d)

9 years agoASoC: fsl: refine DMA/FIQ dependencies
Arnd Bergmann [Tue, 3 Jun 2014 12:11:56 +0000 (14:11 +0200)]
ASoC: fsl: refine DMA/FIQ dependencies

Commit 31ee2bfd724ab ("ASoC: fsl: select SND_SOC_IMX_PCM_DMA
where needed") started selecting SND_SOC_IMX_PCM_DMA and
SND_SOC_IMX_PCM_FIQ for two drivers when building for i.MX.
This has turned out too aggressive, as FIQ is only available
for i.mx2 through i.mx5, but not i.mx6 or vybrid.

Further, two more drivers have become user-selectable in the
meantime, and they both depend on DMA for the imx platform
as well.

This changes the selection of FIQ to depend on the TZIC or
AVIC interrupt controllers that actually export the imx
specific FIQ interfaces, and adds the missing select statements
for SAI and ESAI.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ff40260f79dc0436604452bccd449bffd25ebafb)

9 years agoASoC: Export devm_snd_soc_register_platform()
Lars-Peter Clausen [Tue, 22 Apr 2014 20:58:41 +0000 (22:58 +0200)]
ASoC: Export devm_snd_soc_register_platform()

devm_snd_soc_register_platform() is used in drivers which can be build as
modules, so it needs to be exported to avoid linkers errors like:

ERROR: "devm_snd_soc_register_platform" [sound/soc/omap/snd-soc-omap.ko] undefined!
ERROR: "devm_snd_soc_register_platform" [sound/soc/davinci/snd-soc-davinci.ko] undefined!

Fixes: 8931bf620 ("ASoC: Add resource managed snd_soc_register_platform()")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 1f23380b803a670a9eb53f63fd0c662d20ab1b66)

9 years agoASoC: Add resource managed snd_soc_register_platform()
Peter Ujfalusi [Wed, 16 Apr 2014 12:46:11 +0000 (15:46 +0300)]
ASoC: Add resource managed snd_soc_register_platform()

Simplify error handling and remove repetitive (and rarely executed) code
for unregistration by providing a devm_snd_soc_register_platform()
platform.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8931bf6208776292b1b888dd8534229f63e2eaa2)

9 years agoARM: imx: Add the secondary request into the structure for imx-sdma
Nicolin Chen [Tue, 29 Jul 2014 10:08:52 +0000 (18:08 +0800)]
ARM: imx: Add the secondary request into the structure for imx-sdma

SDMA supports device to device (per_2_per) scripts to handle DMA transfering
between two peripheral devices. The per_2_per script, however, needs two dma
requests from two sides while the current structure only defined one request.

So this patch just simply adds the secondary request so as to let SDMA and
its user to add its implementation later.

[ Both change in the SDMA driver and its users like Freescale ASRC ASoC driver
  should be taken along with this change in order to truly support per_2_per
  sciprts. However, we here make an expediency by adding this first so that
  we can add either side later since this patch won't break any function and
  meanwhile it can make merge window more smoothly: we don't need to apply the
  change inside dmaengine branch via ASoC tree any more. -- Nicolin ]

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 94b912e42829b25d97b6b1f2be66c6aa81ac125f)

9 years agodmaengine: imx-sdma: Add a new DMATYPE for Shared Peripheral ASRC
Nicolin Chen [Mon, 16 Jun 2014 03:31:05 +0000 (11:31 +0800)]
dmaengine: imx-sdma: Add a new DMATYPE for Shared Peripheral ASRC

Shared Peripheral ASRC, running on SPBA, needs to use shp sciprts for
DMA transfer. So this patch just adds a new DMATYPE for it.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit f892afb07eeecf575179c4747952644a82a92a36)

9 years agoENGR00275483-1 ARM: imx6q: clk: add video 27m clock
Liu Ying [Fri, 16 Aug 2013 05:44:42 +0000 (13:44 +0800)]
ENGR00275483-1 ARM: imx6q: clk: add video 27m clock

This patch adds the fixed factor video 27m clock in
the imx6q clock driver. This clock's parent clock
is the pll3_pfd1_540m clock.

Conflicts:

Documentation/devicetree/bindings/clock/imx6q-clock.txt
arch/arm/mach-imx/clk-imx6q.c

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

9 years agoENGR00319487-2 ARM: dts: imx6dl: Add LDB support
Liu Ying [Fri, 20 Jun 2014 08:57:45 +0000 (16:57 +0800)]
ENGR00319487-2 ARM: dts: imx6dl: Add LDB support

It's a device tree source porting from imx_3.10.y regarding to LDB
support for i.MX6DL.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agoENGR00319487-1 ARM: dts: imx6qdl: correct "ldb_di1" clk source for IPU1
Liu Ying [Fri, 20 Jun 2014 08:56:08 +0000 (16:56 +0800)]
ENGR00319487-1 ARM: dts: imx6qdl: correct "ldb_di1" clk source for IPU1

This patch fixes a typo to correct "ldb_di1" clk source for IPU1.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agoENGR00319456-2 cpufreq: imx6: correct regulator API
Anson Huang [Fri, 20 Jun 2014 06:01:46 +0000 (14:01 +0800)]
ENGR00319456-2 cpufreq: imx6: correct regulator API

for PU regulator, if we do NOT want a dummy regulator
returned when there is no PU regulator available,
devm_regulator_get_optional should be used instead
of devm_regulator_get.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00319456-1 regulator: core: remove incorrect change of regulator_get
Anson Huang [Fri, 20 Jun 2014 05:59:55 +0000 (13:59 +0800)]
ENGR00319456-1 regulator: core: remove incorrect change of regulator_get

If user do NOT want a dummy regulator returned when
there is no matching regulator found, then they should use
regulator_get_optional instead of regulator_get. So remove
incorrect change.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00319243-1 ARM: imx: add DSM support for i.mx6sx
Anson Huang [Thu, 19 Jun 2014 06:07:26 +0000 (14:07 +0800)]
ENGR00319243-1 ARM: imx: add DSM support for i.mx6sx

Add DSM support for i.MX6SX.

To enter DSM, echo mem > /sys/power/state.
To exit DSM, using RTC alarm or enable debug UART wakeup.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years ago[media] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call
Ma Haijun [Thu, 27 Mar 2014 11:07:06 +0000 (08:07 -0300)]
[media] videobuf-dma-contig: fix incorrect argument to vm_iomap_memory() call

The second argument should be physical address rather than virtual address.

Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[shawn.guo: cherry-pick commit 29f1cdb0d0f2 from upstream]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00273974-2 ARM: dts: imx6qdl-sabresd: enable mxc vout
Liu Ying [Mon, 5 Aug 2013 07:48:11 +0000 (15:48 +0800)]
ENGR00273974-2 ARM: dts: imx6qdl-sabresd: enable mxc vout

Enable the mxc vout for imx6q{dl}-sabresd boards.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
[shawn.guo: cherry-pick commit d95a5ef6bbca from imx_3.10.y]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
9 years agoENGR00318913-7 ARM: imx: add cpufreq support for i.mx6sx
Anson Huang [Thu, 19 Jun 2014 02:36:47 +0000 (10:36 +0800)]
ENGR00318913-7 ARM: imx: add cpufreq support for i.mx6sx

Enable cpufreq support for i.MX6SX, currently three setpoints
are supported, the freq/volt table are as below:

        VDDARM_CAP      VDDSOC_CAP
996M:   1.250V          1.175V
792M:   1.175V          1.175V
396M:   1.075V          1.175V

All upper voltages are 25mV higher then the minimum value defined
in datasheet, this 25mV is to cover board level IR drop.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-6 regulator: get_regulator should return fail if no device found
Anson Huang [Thu, 19 Jun 2014 02:34:31 +0000 (10:34 +0800)]
ENGR00318913-6 regulator: get_regulator should return fail if no device found

If there is no device matched, get_regulator should just return
fail instead of using a dummy regulator.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-5 cpufreq: imx6: remove pu regulator dependency
Anson Huang [Thu, 19 Jun 2014 01:01:58 +0000 (09:01 +0800)]
ENGR00318913-5 cpufreq: imx6: remove pu regulator dependency

PU regulator is not a necessary regulator for cpufreq, not all
i.MX6 SoCs have PU regulator, so remove the dependency to support
i.MX6SX which has NO PU regulator.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-4 thermal: imx: enable devfreq cooling
Anson Huang [Wed, 18 Jun 2014 08:59:39 +0000 (16:59 +0800)]
ENGR00318913-4 thermal: imx: enable devfreq cooling

Enable devfreq cooling to trigger GPU freq change when
hot trip is reached.

Make sure thermal driver loaded after cpufreq is loaded,
otherwise, cpu_cooling will not get valid cpufreq table,
hence cpu_cooling will be not working.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-3 thermal: imx: enable thermal support for i.mx6sx
Anson Huang [Wed, 18 Jun 2014 05:04:23 +0000 (13:04 +0800)]
ENGR00318913-3 thermal: imx: enable thermal support for i.mx6sx

i.MX6SX has some new feature of thermal interrupt function,
there is LOW, HIGH and PANIC irq for thermal sensor, so add
platform data to separate different thermal version;

The reset value of LOW ALARM is 0 which means the highest
temp, so the LOW ALARM will be triggered once irq is enabled,
so we need to set them to correct setting before enabling
thermal irq;

Enable PANIC ALARM as critical trip point, it will trigger
system reset via SRC module once PANIC IRQ is triggered.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318913-2 thermal: imx: make thermal trip temp changeable
Anson Huang [Wed, 18 Jun 2014 03:21:45 +0000 (11:21 +0800)]
ENGR00318913-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>
9 years agoENGR00318913-1 thermal: imx: update trip temp using default setting
Anson Huang [Wed, 18 Jun 2014 03:09:47 +0000 (11:09 +0800)]
ENGR00318913-1 thermal: imx: update trip temp using default setting

Previously, the critical and passive trip temp settings are from
calibration data of hot point, but the lastest chips are only
calibrated at 25C and use an universal formula to get real temp,
so there is no longer a hot point value in calibration data, need
to set the critical and passive trip temp manually instead of
getting them from calibration data.

Currently the default setting for passive trip temp is 85 C, and
critical trip temp is 20 C higher than passive trip temp, which
is 105 C.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00318931-2 Enable VPU driver on kernel 3.14
Hongzhang Yang [Wed, 18 Jun 2014 05:50:40 +0000 (13:50 +0800)]
ENGR00318931-2 Enable VPU driver on kernel 3.14

- Add vpu node
- Add "power-domains" property instead of "pu-supply"

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
9 years agoENGR00318931-1 Enable VPU driver on kernel 3.14
Hongzhang Yang [Wed, 18 Jun 2014 05:40:44 +0000 (13:40 +0800)]
ENGR00318931-1 Enable VPU driver on kernel 3.14

Kernel 3.14 manages regulator using generic power domain which is covered by
pm_runtime API.

- Don't use PU regulator API
- Use pm_runtime API only

Signed-off-by: Hongzhang Yang <Hongzhang.Yang@freescale.com>
9 years agoENGR00318895-13 ARM: dts: imx6sx-sdb: enable the qspi2
Huang Shijie [Wed, 18 Jun 2014 01:57:26 +0000 (09:57 +0800)]
ENGR00318895-13 ARM: dts: imx6sx-sdb: enable the qspi2

By adding the pinctrl_qspi2_1 and the DT node "qspi2", this patch enables
the qspi2 for imx6sx-sdb board.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-12 mtd: spi-nor: add DDR quad read flag for s25fl128s
Huang Shijie [Wed, 18 Jun 2014 02:01:50 +0000 (10:01 +0800)]
ENGR00318895-12 mtd: spi-nor: add DDR quad read flag for s25fl128s

This patch adds the DDR quad read flag for s25fl128s.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-11 mtd: fsl-quadspi: add DDR quad read support for Micron
Huang Shijie [Fri, 25 Apr 2014 05:51:15 +0000 (13:51 +0800)]
ENGR00318895-11 mtd: fsl-quadspi: add DDR quad read support for Micron

Add DDR quad read opcode and LUT sequence for Micron N25Q256A.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-10 mtd: spi-nor: add DDR quad read support for Micron
Huang Shijie [Fri, 25 Apr 2014 05:40:19 +0000 (13:40 +0800)]
ENGR00318895-10 mtd: spi-nor: add DDR quad read support for Micron

This patch adds the DDR(or DTR) quad read support for the Micron
SPI NOR flash.

Tested with n25q256a.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-9 mtd: spi-nor: add more read transfer flags for n25q256a
Huang Shijie [Fri, 25 Apr 2014 05:24:55 +0000 (13:24 +0800)]
ENGR00318895-9 mtd: spi-nor: add more read transfer flags for n25q256a

The NOR flash can supports dual/quad/ddr-quad read.
Add more flags for these read transfers.

From the datasheet, the chip support the 64K sector erase operation.
So remove the SECT_4K for the chip which makes the flash_erase faster.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-8 mtd: fsl-quadspi: add the DDR quad read support for Spansion NOR
Huang Shijie [Wed, 23 Apr 2014 02:20:35 +0000 (10:20 +0800)]
ENGR00318895-8 mtd: fsl-quadspi: add the DDR quad read support for Spansion NOR

Add the DDR quad read support for the fsl-quadspi driver.

Check the "spi-nor,ddr-quad-read-dummy" DT property, if the DT node is exit,
it means we could enable the DDR quad read.

 (1) Test this patch with imx6sx-sdb board (Spansion s25fl128s)
     The clock rate is 66MHz.

 (2) The information of NOR flash:
     -----------------------------------------------
     root@imx6qdlsolo:~# mtdinfo /dev/mtd0
     mtd0
     Name:                           21e4000.qspi
     Type:                           nor
     Eraseblock size:                65536 bytes, 64.0 KiB
     Amount of eraseblocks:          256 (16777216 bytes, 16.0 MiB)
     Minimum input/output unit size: 1 byte
     Sub-page size:                  1 byte
     Character device major/minor:   90:0
     Bad blocks are allowed:         false
     Device is writable:             true
     -----------------------------------------------

 (3) Test this patch set with UBIFS & bonnie++:
     -----------------------------------------------
ubiattach /dev/ubi_ctrl -m 0
ubimkvol /dev/ubi0 -N test -m
mount -t ubifs ubi0:test tmp
bonnie++ -d tmp -u 0 -s 10 -r 5
     -----------------------------------------------

 (4) Test this patch with mtd_speedtest.ko

     root@imx6qdlsolo:~# insmod mtd_speedtest.ko dev=0
     =================================================
     mtd_speedtest: MTD device: 0
     mtd_speedtest: not NAND flash, assume page size is 512 bytes.
     mtd_speedtest: MTD device size 16777216, eraseblock size 65536, page size 512,
                    count of eraseblocks 256, pages per eraseblock 128, OOB size 0
     mtd_speedtest: testing eraseblock write speed
     mtd_speedtest: eraseblock write speed is 665 KiB/s
     mtd_speedtest: testing eraseblock read speed
     mtd_speedtest: eraseblock read speed is 49799 KiB/s
     mtd_speedtest: testing page write speed
     mtd_speedtest: page write speed is 662 KiB/s
     mtd_speedtest: testing page read speed
     mtd_speedtest: page read speed is 24236 KiB/s
     mtd_speedtest: testing 2 page write speed
     mtd_speedtest: 2 page write speed is 657 KiB/s
     mtd_speedtest: testing 2 page read speed
     mtd_speedtest: 2 page read speed is 32637 KiB/s
     mtd_speedtest: Testing erase speed
     mtd_speedtest: erase speed is 518 KiB/s
     mtd_speedtest: Testing 2x multi-block erase speed
     mtd_speedtest: 2x multi-block erase speed is 506 KiB/s
     mtd_speedtest: Testing 4x multi-block erase speed
     mtd_speedtest: 4x multi-block erase speed is 503 KiB/s
     mtd_speedtest: Testing 8x multi-block erase speed
     mtd_speedtest: 8x multi-block erase speed is 501 KiB/s
     mtd_speedtest: Testing 16x multi-block erase speed
     mtd_speedtest: 16x multi-block erase speed is 498 KiB/s
     mtd_speedtest: Testing 32x multi-block erase speed
     mtd_speedtest: 32x multi-block erase speed is 496 KiB/s
     mtd_speedtest: Testing 64x multi-block erase speed
     mtd_speedtest: 64x multi-block erase speed is 495 KiB/s
     mtd_speedtest: finished
     =================================================

  (5) Conclusion:
     The DDR quad read could be 49799 KiB/s.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-7 mtd: fsl-quadspi: use the information stored in spi-nor{}
Huang Shijie [Tue, 22 Apr 2014 09:47:14 +0000 (17:47 +0800)]
ENGR00318895-7 mtd: fsl-quadspi: use the information stored in spi-nor{}

We can get the read/write/erase opcode from the spi nor framework now.
What's more is that we can get the correct dummy cycles.

This patch uses the information stored in the spi_nor{} to remove the
hardcode in the fsl_qspi_init_lut().

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-6 Documentation: fsl-quadspi: update the document
Huang Shijie [Wed, 23 Apr 2014 03:59:26 +0000 (11:59 +0800)]
ENGR00318895-6 Documentation: fsl-quadspi: update the document

The patch updates the document by adding more information to describe the
DT proporties used by the Freescale Quadspi driver and the childs nodes.

For the child node for SPI NOR flash, we add the required property
("spi-max-frequency"), and refer to spi-nor-flash.txt for the optional
properties.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-5 Documentation: mtd: add a new document for SPI NOR flash
Huang Shijie [Wed, 23 Apr 2014 05:54:40 +0000 (13:54 +0800)]
ENGR00318895-5 Documentation: mtd: add a new document for SPI NOR flash

We need a DT property to store the dummy cycles for DDR Quad read.
This is a common feature for the SPI NOR flash, such as Spansion and Micron
chips.

Add this file to describe this specific SPI NOR flash features which will
be referred by the SPI NOR flash drivers.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-4 mtd: spi-nor: add DDR quad read support
Huang Shijie [Tue, 22 Apr 2014 07:37:30 +0000 (15:37 +0800)]
ENGR00318895-4 mtd: spi-nor: add DDR quad read support

This patch adds the DDR quad read support by the following:

  [1] add SPI_NOR_DDR_QUAD read mode.

  [2] add DDR Quad read opcodes:
       SPINOR_OP_READ_1_4_4_D / SPINOR_OP_READ4_1_4_4_D

  [3] add set_ddr_quad_mode() to initialize for the DDR quad read.
      Currently it only works for Spansion NOR.

  [3] about the dummy cycles.
      We set the dummy with 8 for DDR quad read by default.
      The m25p80.c can not support the DDR quad read, but the SPI NOR controller
      can set the dummy value in its child DT node, and the SPI NOR framework
      can parse it out.

Test this patch for Spansion s25fl128s NOR flash.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-3 mtd: spi-nor: add a new field for spi_nor{}
Huang Shijie [Thu, 24 Apr 2014 09:53:52 +0000 (17:53 +0800)]
ENGR00318895-3 mtd: spi-nor: add a new field for spi_nor{}

We need the SPI NOR child node to store some specific features, such as the
dummy cycles for the DDR Quad read.

But now, we only have the @dev field in the spi_nor{}. The @dev may points to a
spi_device{} for m25p80, while it may points to a platform_deivice{} for the
SPI NOR controller, such as fsl_quadspi.c.

It is not convenient for us to get come information from the SPI NOR flash.

This patch adds a new field @np to spi_nor{}, it points to the child node for
the SPI NOR flash.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-2 mtd: spi-nor: fix the wrong dummy value
Huang Shijie [Wed, 16 Apr 2014 08:18:19 +0000 (16:18 +0800)]
ENGR00318895-2 mtd: spi-nor: fix the wrong dummy value

For the DDR Quad read, the dummy cycles maybe 3 or 6 which is less then 8.
The dummy cycles is actually 8 for SPI fast/dual/quad read.

This patch makes preparations for the DDR quad read, it fixes the wrong dummy
value for both the spi-nor.c and m25p80.c.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoENGR00318895-1 mtd: spi-nor: read 6 bytes for the ID
Huang Shijie [Mon, 14 Apr 2014 10:09:34 +0000 (18:09 +0800)]
ENGR00318895-1 mtd: spi-nor: read 6 bytes for the ID

Currently, we read 5 bytes for ID, but s25fl128s has the same ext_id(0x4d01)
with s25fl129p1. The s25fl128s can support the DDR Quad read, while s25fl129p1
does not. So we have to distinguish the two NOR flashs.

This patch reads out 6 bytes for the ID, and use the 6 bytes ID to search the
right flash_info.

The detail of the patch is:
  [1] change the "ext_id" from u16 to u32.
      We can store two bytes or three bytes with the @ext_id now.

  [2] search the right flash_info with the 6byte ID and the new @ext_id.
      We use "matched" variable to track the legacy two bytes @ext_id.
      If the flash_info's @ext_id is three bytes, we will use the
      sixth byte of the ID to check it.

  [3] add the new item to spi_nor_ids for s25fl128s.

Signed-off-by: Huang Shijie <b32955@freescale.com>
9 years agoASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()
Timur Tabi [Fri, 13 Jun 2014 12:42:40 +0000 (07:42 -0500)]
ASoC: fsl-ssi: fix do_div build warning in fsl_ssi_set_bclk()

do_div() requires that the first parameter is a 64-bit integer,
which but clkrate was defined as an unsigned long.  This caused
the following warnings:

 CC      sound/soc/fsl/fsl_ssi.o
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_set_bclk':
sound/soc/fsl/fsl_ssi.c:593:3: warning: comparison of distinct pointer types lacks a cast
sound/soc/fsl/fsl_ssi.c:593:3: warning: right shift count >= width of type
sound/soc/fsl/fsl_ssi.c:593:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type
include/asm-generic/div64.h:35:17: note: expected 'uint64_t *' but argument is of type 'long unsigned int *'

Signed-off-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit acf2c60a60b3d6d7080854b9483f37d99ded9b23)
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>