]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agousb: phy: propagate __of_usb_find_phy()'s error on failure
Arjun Sreedharan [Thu, 20 Nov 2014 15:53:36 +0000 (21:23 +0530)]
usb: phy: propagate __of_usb_find_phy()'s error on failure

When __of_usb_find_phy() fails, it returns -ENODEV - its
error code has to be returned by devm_usb_get_phy_by_phandle().
Only when the former function succeeds and try_module_get()
fails should -EPROBE_DEFER be returned.

[ balbi@ti.com : remove trailing whitespace ]

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 1290a958d48e30d60262a33acb5f068e87834ce4)

9 years agousb: phy: fsl: Fix build errors
Felipe Balbi [Wed, 12 Nov 2014 14:31:40 +0000 (08:31 -0600)]
usb: phy: fsl: Fix build errors

commit e47d925 (usb: move the OTG state from
the USB PHY to the OTG structure) moved the
OTG state from struct usb_phy to struct usb_otg.

Unfortunately, even though I fixed quite a few
build regressions with that patch already, this
one was still missing.

Note that this driver still has other randconfig
build problems which I'll leave for driver author
to fix, as that's less trivial.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit e5ba1c024aa0c21ef1755402fd94fabfd6e18c16)

9 years agousb: core: notify disconnection when core detects disconnect
Peter Chen [Tue, 4 Nov 2014 03:14:31 +0000 (11:14 +0800)]
usb: core: notify disconnection when core detects disconnect

It is safe to call notify disconnect when the usb core
thinks the device is disconnected.

This commit also fixes one bug found at below situation:
we have not enabled usb wakeup, we do system suspend when
there is an usb device at the port, after suspend, we plug out
the usb device, then plug in device again. At that time,
the nofity disconnect was not called at current code, as
the controller doesn't know the usb device was disconnected
during the suspend, but USB core knows the port has changed
during that periods.

So to fix this problem, and let the usb core call notify disconnect.

Cc: 3.17+ <stable@vger.kernel.org>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b2108f1e519e983e5dd5712b3a44f7366ab509e4)

9 years agousb: core: need to call usb_phy_notify_connect after device setup
Tony Zheng [Fri, 17 Oct 2014 11:43:02 +0000 (19:43 +0800)]
usb: core: need to call usb_phy_notify_connect after device setup

Since we notify disconnecting based on the usb device is existed
(port_dev->child, the child device at roothub is not NULL), we
need to notify connect after device has been registered.

This fixes a bug that do fast plug in/out test, and the notify_disconnect
is not called due to roothub child is NULL and the enumeration has failed.

Cc: v3.17+ <stable@vger.kernel.org>
Signed-off-by: Tony Zheng <Tony.Zheng@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 01ed67dc70834d00d62b6e754ee0f76301fbc140)

Conflicts:

drivers/usb/core/hub.c

9 years agousb: chipidea: otg_fsm: delete unnecessary 'out of memory' messages
Li Jun [Tue, 6 Jan 2015 09:11:24 +0000 (17:11 +0800)]
usb: chipidea: otg_fsm: delete unnecessary 'out of memory' messages

The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agousb: chipidea: host: add portpower override
Michael Grzeschik [Mon, 13 Oct 2014 01:53:04 +0000 (09:53 +0800)]
usb: chipidea: host: add portpower override

This patch adds an external portpower override callback, only single
port regulator control is supported now.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c8679a2fb8decc949c848ca58f93ff7fb619931a)

9 years agousb: ehci: add ehci_port_power interface
Michael Grzeschik [Mon, 13 Oct 2014 01:53:03 +0000 (09:53 +0800)]
usb: ehci: add ehci_port_power interface

The current EHCI implementation is prepared to toggle the
PORT_POWER bit to enable or disable a USB-Port. In some
cases this port power can not be just toggled by the PORT_POWER
bit, and the gpio-regulator is needed to be toggled too.

This patch defines a port power control interface ehci_port_power for
ehci core use, it toggles PORT_POWER bit as well as calls platform
defined .port_power if it is defined.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 11a7e59405148c855e0a9d13588930ccec02c150)

9 years agousb: chipidea: add support to the generic PHY framework
Antoine Tenart [Thu, 30 Oct 2014 17:41:19 +0000 (18:41 +0100)]
usb: chipidea: add support to the generic PHY framework

This patch adds support of the PHY framework for ChipIdea drivers.
Changes are done in both the ChipIdea common code and in the drivers
accessing the PHY. This is done by adding a new PHY member in
ChipIdea's structures and by taking care of it in the code.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 1e5e2d3d055436c114e2f16145b83339aed024ff)

9 years agousb: allow to supply the PHY in the drivers when using HCD
Antoine Tenart [Thu, 30 Oct 2014 17:41:16 +0000 (18:41 +0100)]
usb: allow to supply the PHY in the drivers when using HCD

This patch modify the generic code handling PHYs to allow them to be
supplied from the drivers. This adds checks to ensure no PHY was already
there when looking for one in the generic code. This also makes sure we
do not modify its state in the generic HCD functions, it was provided by
the driver.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit ef44cb4226d132146e44f8ea562a16b27ff61126)

9 years agousb: add support to the generic PHY framework in OTG
Antoine Tenart [Thu, 30 Oct 2014 17:41:15 +0000 (18:41 +0100)]
usb: add support to the generic PHY framework in OTG

This patch adds support of the PHY framework in OTG and keeps the USB
PHY compatibility. Here the only modification is to add PHY member in
the OTG structure, along with the USB PHY one.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 48bcc18076df4e07ef86226ac6ce795f64c84f7f)

9 years agousb: rename phy to usb_phy in OTG
Antoine Tenart [Thu, 30 Oct 2014 17:41:14 +0000 (18:41 +0100)]
usb: rename phy to usb_phy in OTG

This patch prepares the introduction of the generic PHY support in the
USB OTG common functions. The USB PHY member of the OTG structure is
renamed to 'usb_phy' and modifications are done in all drivers accessing
it. Renaming this pointer will allow to keep the compatibility for USB
PHY drivers.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 19c1eac2685b62640ca2386a0a885ac2152668c8)

Conflicts:

drivers/phy/phy-omap-usb2.c
drivers/usb/phy/phy-msm-usb.c

9 years agousb: move the OTG state from the USB PHY to the OTG structure
Antoine Tenart [Thu, 30 Oct 2014 17:41:13 +0000 (18:41 +0100)]
usb: move the OTG state from the USB PHY to the OTG structure

Before using the PHY framework instead of the USB PHY one, we need to
move the OTG state into another place, since it won't be available when
USB PHY isn't used. This patch moves the OTG state into the OTG
structure, and makes all the needed modifications in the drivers
using the OTG state.

[ balbi@ti.com : fix build regressions with phy-tahvo.c, musb_dsps.c,
phy-isp1301-omap, and chipidea's debug.c ]

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit e47d92545c2972bcf3711e7db80f481e402163c7)

Conflicts:

drivers/usb/musb/musb_gadget.c
drivers/usb/phy/phy-msm-usb.c

9 years agousb: hcd: add generic PHY support
Sergei Shtylyov [Wed, 24 Sep 2014 19:09:44 +0000 (23:09 +0400)]
usb: hcd: add generic PHY support

Add the generic PHY support, analogous to the USB PHY support. Intended it to be
used with the PCI EHCI/OHCI drivers and the xHCI platform driver.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0043325495222139daa0696db736f67658dc7770)

9 years agousb: rename phy to usb_phy in HCD
Antoine Tenart [Wed, 24 Sep 2014 19:05:50 +0000 (23:05 +0400)]
usb: rename phy to usb_phy in HCD

The USB PHY member of the HCD structure is renamed to 'usb_phy' and
modifications are done in all drivers accessing it.
This is in preparation to adding the generic PHY support.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
[Sergei: added missing 'drivers/usb/misc/lvstest.c' file, resolved rejects,
updated changelog.]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3d46e73dfdb840f460e5b06416965d132570ec33)

Conflicts:

drivers/usb/core/hub.c
drivers/usb/misc/lvstest.c

9 years agoPM / domains: Turn latency warning into debug message
Philipp Zabel [Thu, 27 Feb 2014 18:26:44 +0000 (19:26 +0100)]
PM / domains: Turn latency warning into debug message

If devices don't provide latency data, this warning can be quite noisy until
the pm domain was enabled and disabled a few times. Turn this warning into
a debug message.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 7d1af287320b41909c070f68ffe1591060a32769)

9 years agoMLK-10079 ARM: dts: imx6q-sabresd-uart: Disabled the LEDS node in the imx6q-sabresd...
Shenwei Wang [Thu, 8 Jan 2015 14:48:47 +0000 (08:48 -0600)]
MLK-10079 ARM: dts: imx6q-sabresd-uart: Disabled the LEDS node in the imx6q-sabresd-uart.dts.

Silex UART BT is using GPIO1_2 as the reset, which is in conflict with
the one used by charging LEDS.

Signed-off-by: Shenwei Wang <shenwei.wang@freescale.com>
9 years agoMLK-10080 serial: imx: Fix imx_flush_buffer()
Fabio Estevam [Thu, 8 Jan 2015 21:17:05 +0000 (19:17 -0200)]
MLK-10080 serial: imx: Fix imx_flush_buffer()

When running an userspace program that does a 'tcflush(fd, TCIOFLUSH)' call
we still see the last received character in the URXD register afterwards.

Clear UCR2_SRST bit so that the FIFO is flushed properly.

Since UCR2_SRST also resets some UART registers, we need to save and restore
some of them.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agoMLK-10078-04 arm: mcc: enable mcc tests in dts
Richard Zhu [Thu, 8 Jan 2015 06:53:29 +0000 (14:53 +0800)]
MLK-10078-04 arm: mcc: enable mcc tests in dts

based on imx_3.14 kernel, add mcc pingpong and tty tests
on imx6sx sdb and ai boards.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10078-03 mcc: tests: add mcc test and tty api
Richard Zhu [Thu, 8 Jan 2015 06:53:05 +0000 (14:53 +0800)]
MLK-10078-03 mcc: tests: add mcc test and tty api

add mcc tests and tty api on imx_3.14.
note:
the device type of the tty device should be
TTY_DRIVER_TYPE_CONSOLE, otherwise the TTY_DRIVER_TYPE_PTY.
link layer stuffs are mandatory requried by
TTY_DRIVER_TYPE_PTY type devices.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10078-02 arm: mcc: platform related codes changes
Richard Zhu [Thu, 8 Jan 2015 07:09:38 +0000 (15:09 +0800)]
MLK-10078-02 arm: mcc: platform related codes changes

The platform related codes changes when enable mcc2.0
on imx_3.14 kernel, and tested on imx6sx sdb board.
- keep imx6sx soc related apis in mcc_imx6sx.c/h
- keep linux os related apis in mcc_linux.c/h
- add some new mcc callback in mu driver, since the
gie3 of mu is used as cpu2cpu interrupter in the mcc
implementation on imx6sx.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10078-01 arm: mcc: platform related header changes
Richard Zhu [Thu, 8 Jan 2015 07:08:42 +0000 (15:08 +0800)]
MLK-10078-01 arm: mcc: platform related header changes

The platform related header changes when enable mcc2.0
on imx_3.14 kernel, and tested on imx6sx sdb board.
- keep imx6sx soc related apis in mcc_imx6sx.c/h
- keep linux os related apis in mcc_linux.c/h
- add some new mcc callback in mu driver, since the
gie3 of mu is used as cpu2cpu interrupter in the mcc
implementation on imx6sx.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-9843-02 arm: mcc: set dual copyright of mcc common header
Richard Zhu [Wed, 19 Nov 2014 07:53:03 +0000 (15:53 +0800)]
MLK-9843-02 arm: mcc: set dual copyright of mcc common header

set the dual bsd/gpl copyright of the mcc common codes
implemented in linux bsp release.
add 2015

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

9 years agoMLK-9843-01 arm: mcc: set dual copyright of mcc common codes
Richard Zhu [Wed, 19 Nov 2014 07:52:18 +0000 (15:52 +0800)]
MLK-9843-01 arm: mcc: set dual copyright of mcc common codes

set the dual bsd/gpl copyright of the mcc common codes
implemented in linux bsp release.
add 2015.

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

9 years agoMLK-9707-3 arm: mcc: mcc 2.0 updates common codes changes
Richard Zhu [Mon, 20 Oct 2014 07:09:11 +0000 (15:09 +0800)]
MLK-9707-3 arm: mcc: mcc 2.0 updates common codes changes

Common codes changes in the mcc 2.0 updates
- common definitions are moved from mcc_config.h to mcc_common.h
because that these definitions are common for the standalone mcc
stack, and shared by different platforms, such as Linux, MQX.
- re-define the common api _psp_core_num(), and _psp_node_num().
Let them to be no platform dependency.
- move the definition of the MCC_OS_USED in mcc_config.h
- new add on mcc_config_linux.h file, contained the platform
related macro definitions contained in mcc_config.h before.
- add the related linux modifications into mcc_api.c/mcc_common.c
when implement the mcc2.0 into linux BSP.
- fix one potential bug that all the share memory operations should
be protected by sema4.

Acked-by: Shawn Guo
Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
(cherry picked from commit 541325a16b6db73a86a5a86049145b0060805c7c)

9 years agoMLK-9707-2 mcc: mcc version 2.0 base common codes
Richard Zhu [Mon, 20 Oct 2014 06:34:34 +0000 (14:34 +0800)]
MLK-9707-2 mcc: mcc version 2.0 base common codes

This is the base line of the mcc version 2.0.

Acked-by: Shawn Guo
Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
(cherry picked from commit cfd44c266e3b8a833ac624b86be627efbda6aaa9)

9 years agommc: sdhci: use pipeline mmc requests to improve performance
Haibo Chen [Tue, 9 Dec 2014 09:04:05 +0000 (17:04 +0800)]
mmc: sdhci: use pipeline mmc requests to improve performance

This patch is based on the patches by Per Forlin, Tony Lin and Ryan QIAN.

This patch complete the API 'post_req' and 'pre_req' in sdhci host side,

Test Env:
1. i.MX6Q-SABREAUTO board, CPU @ 996MHz, use ADMA in uSDHC controller.
2. Test command:
$ echo 1 > /proc/sys/vm/drop_caches
write to sd card:
$ dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=2000 conv=fsync
read the sd card:
$ dd if=/dev/mmcblk0 of=/dev/null bs=1M count=2000

3. TOSHIBA 16GB SD3.0 card, running at 4 bit, SDR104 @ 198MHZ
Performance with and without this patch:
      -------------------------------------------------
  |                    | read speed | write speed |
  |------------------------------------------------
  | with this patch    | ~76.7 MB/s |  ~23.3 MB/s |
  |------------------------------------------------
  |without this patch  | ~60.5 MB/s |  ~22.5 MB/s |
  -------------------------------------------------

4. SanDisk 8GB SD3.0 card, running at 4 bit, DDR50 @ 50MHZ
Performance with and without this patch:
      -------------------------------------------------
  |                    | read speed | write speed |
  |------------------------------------------------
  | with this patch    | ~40.5 MB/s |  ~15.6 MB/s |
  |------------------------------------------------
  |without this patch  | ~36.1 MB/s |  ~14.1 MB/s |
  -------------------------------------------------

5. Kingston 8GB SD2.0 card, running at 4 bit, High-speed @ 50MHZ
Performance with and without this patch:
      -------------------------------------------------
  |                    | read speed | write speed |
  |------------------------------------------------
  | with this patch    | ~22.7 MB/s |  ~8.2 MB/s  |
  |------------------------------------------------
  |without this patch  | ~21.3 MB/s |  ~8.0 MB/s  |
  -------------------------------------------------

6. About eMMC, Sandisk 8GB eMMC on i.MX6DL-sabresd board, CPU @ 792MHZ,
   eMMC running at 8 bit, DDR52 @ 52MHZ.
Performance with and without this patch:
      -------------------------------------------------
  |                    | read speed | write speed |
  |------------------------------------------------
  | with this patch    | ~37.3 MB/s |  ~10.5 MB/s |
  |------------------------------------------------
  |without this patch  | ~33.4 MB/s |  ~10.5 MB/s |
  -------------------------------------------------

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit a0a60bf36806be9528d4011563e9367bddeff762)

9 years agoMLK-9986-4 dma: imx-sdma: add new ecspi tx script
Robin Gong [Thu, 18 Dec 2014 04:41:16 +0000 (12:41 +0800)]
MLK-9986-4 dma: imx-sdma: add new ecspi tx script

Current ecspi rom script didn't take care of rxfifo overflow risk. Add new
ecspi tx script to check the rxfifo status, if it is near to full(>=48 bytes),
do not copy data to txfifo which will trigger data push into rxfifo. Because
rx script may not read rxfifo in time, we have to consider it.

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

9 years agospi: Fix mapping from vmalloc-ed buffer to scatter list
Charles Keepax [Mon, 17 Nov 2014 09:14:31 +0000 (09:14 +0000)]
spi: Fix mapping from vmalloc-ed buffer to scatter list

We can only use page_address on memory that has been mapped using kmap,
when the buffer passed to the SPI has been allocated by vmalloc the page
has not necessarily been mapped through kmap. This means sometimes
page_address will return NULL causing the pointer we pass to sg_set_buf
to be invalid.

As we only call page_address so that we can pass a virtual address to
sg_set_buf which will then immediately call virt_to_page on it, fix this
by calling sg_set_page directly rather then relying on the sg_set_buf
helper.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
(cherry picked from commit c1aefbdd050e1fb15e92bcaf34d95b17ea952097)

9 years agoMLK-9986-5 spi: spi-imx: decrease tx fifo wartermark level
Robin Gong [Thu, 18 Dec 2014 04:51:28 +0000 (12:51 +0800)]
MLK-9986-5 spi: spi-imx: decrease tx fifo wartermark level

We set both wartermark of txfifo and rxfifo 32 as half of fifo length 64.
That will cause easy rxfifo overflow:
If there is 31 bytes in rxfifo, rx script will wait the next dma request
(the 32th data come into the rxfifo) and schedule out to tx script. Once
tx script start to run, the rx script need to wait tx script finish even
if its priority higher than tx. Meanwhile, spi slave device may input
data continous, plus the rx data which triggered by new tx script(32 bytes).
That will quickly consume whole 64 bytes fifo, so we keep 16bytes availbale
even in the worst case new tx script triggered during two rx transfer. That
may slow down tx slightly, but better than overflow and RX DMA timeout.

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

9 years agoMLK-9986-3 imx-sdma: add new ecspi tx sdma script
Robin Gong [Thu, 18 Dec 2014 04:39:13 +0000 (12:39 +0800)]
MLK-9986-3 imx-sdma: add new ecspi tx sdma script

Add new ecspi tx sdma script in the head file.

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

9 years agoMLK-9986-2 spi: spi-imx: use pio mode for the tail data in DMA mode
Robin Gong [Sat, 13 Dec 2014 13:55:25 +0000 (21:55 +0800)]
MLK-9986-2 spi: spi-imx: use pio mode for the tail data in DMA mode

Sometimes the tail data can't trigger SDMA to read from rxfifo, or
SDMA miss the last dma request, in this case, DMA report RX timeout
and the rest tail data kept in rxfifo. Whatever, use pio read for the
tail rx data.

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

9 years agoMLK-9986-1 spi: spi-imx: change dma timeout value with transfer length
Robin Gong [Sat, 13 Dec 2014 04:46:31 +0000 (12:46 +0800)]
MLK-9986-1 spi: spi-imx: change dma timeout value with transfer length

Change dma timeout value with the transfer length if the length bigger than
1 MB.

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

9 years agoMLK-9699: ARM: dts: imx6: enable spi dma support
Robin Gong [Thu, 16 Oct 2014 02:30:46 +0000 (10:30 +0800)]
MLK-9699: ARM: dts: imx6: enable spi dma support

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

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

9 years agospi: spi-imx: add DMA support
Robin Gong [Thu, 11 Sep 2014 01:18:44 +0000 (09:18 +0800)]
spi: spi-imx: add DMA support

Enable DMA support on i.mx6. The read speed can increase from 600KB/s
to 1.2MB/s on i.mx6q. You can disable or enable dma function in dts.
If not set "dma-names" in dts, spi will use PIO mode. This patch only
validate on i.mx6, not i.mx5, but encourage ones to apply this patch
on i.mx5 since they share the same IP.

Note:
  Sometime, there is a weid data in rxfifo after one full tx/rx
transfer finish by DMA on i.mx6dl, so we disable dma functhion on
i.mx6dl.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit f62caccd12c17e4cb516d43a6e4dd8a3abc1f7e0)
(cherry picked from commit b87c98a8944c76840ed1375ed4792ef608de5c01)

9 years agospi/imx: Use dev_name() for request_irq() to distinguish SPIs
Alexander Shiyan [Sat, 22 Feb 2014 13:23:46 +0000 (17:23 +0400)]
spi/imx: Use dev_name() for request_irq() to distinguish SPIs

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8fc39b516623f3beed18be701d2acfe0e50b8d86)
(cherry picked from commit fac24d90c8b851179d46aee6f9229f4665c14395)

9 years agospi: spi-imx: Propagate the real error code on platform_get_irq() failure
Fabio Estevam [Fri, 14 Feb 2014 03:19:22 +0000 (01:19 -0200)]
spi: spi-imx: Propagate the real error code on platform_get_irq() failure

No need to return a 'fake' return value on platform_get_irq() failure.

Just return the error code itself instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 82106e0e39c455957888dd44d43790306b30f73e)
(cherry picked from commit a4c564cb1206158a91678af2029dac7a3fbeb945)

9 years agospi: Use reinit_completion at appropriate places
Axel Lin [Sun, 9 Feb 2014 03:06:04 +0000 (11:06 +0800)]
spi: Use reinit_completion at appropriate places

Calling init_completion() once is enough.
For the rest of the iterations, call reinit_completion() instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit aa0fe82629f19efba5c870bc9be089a4f8056a75)
(cherry picked from commit fd20fe148977afbdda2f3d90eb6226b436ab9e09)

9 years agospi: delete non-required instances of include <linux/init.h>
Paul Gortmaker [Tue, 21 Jan 2014 21:22:47 +0000 (16:22 -0500)]
spi: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3a44623d5e1404b29786f1afd225d1aa04a4ae90)
(cherry picked from commit 324b6d43b9199eca4723c161be8b842397b58a9c)

9 years agospi: core: Pass correct device to dma_map_sg()
Geert Uytterhoeven [Thu, 10 Jul 2014 13:29:33 +0000 (15:29 +0200)]
spi: core: Pass correct device to dma_map_sg()

According to Documentation/dmaengine.txt, scatterlists must be mapped
using the DMA struct device.

However, "dma_chan.dev->device" is the sysfs class device's device.
Use "dma_chan.device->dev" instead, which is the real DMA device's device.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 3fc25421f55e36426f5e5cc227cacc840493a943)
(cherry picked from commit ff593afabbe51959293cf8434bbe72a3db24dda5)

9 years agospi: core: Fix check for dma_map_sg() failures
Geert Uytterhoeven [Thu, 10 Jul 2014 13:29:32 +0000 (15:29 +0200)]
spi: core: Fix check for dma_map_sg() failures

According to Documentation/DMA-API.txt, dma_map_sg() returns 0 on failure.
As spi_map_buf() returns an error code, convert zero into -ENOMEM.
Keep the existing check for negative numbers just in case.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 89e4b66a2e34744615c79349aa936df1b4204faf)
(cherry picked from commit d176f970196ecc2c0f0c30116061fdeba3461556)

9 years agospi: Remove unused variable
Mark Brown [Sat, 21 Jun 2014 10:40:40 +0000 (11:40 +0100)]
spi: Remove unused variable

Reported-by: kbuild test robot
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 840e9c354f3492259a65ae235351cde1089a409e)
(cherry picked from commit df473b0daee67eae1ebc1b76c1f5c3a1358ac7c6)

9 years agospi: Remove redundant OOM message in spi.c
Sachin Kamat [Fri, 13 Jun 2014 04:47:42 +0000 (10:17 +0530)]
spi: Remove redundant OOM message in spi.c

Let memory subsystem handle the error logging.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Reviewed-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8331acb3a5515c01a1b73424a56f44c50ad7f1b4)
(cherry picked from commit 6cd6a0353c0f8e294f1372d436faba5d229a3aa0)

9 years agospi: core: Ignore unsupported spi-[tr]x-bus-width property values
Geert Uytterhoeven [Mon, 26 May 2014 12:05:25 +0000 (14:05 +0200)]
spi: core: Ignore unsupported spi-[tr]x-bus-width property values

Rejecting unsupported values of spi-tx-bus-width and spi-rx-bus-width
may break compatibility with future DTs. Just ignore them, falling back
to Single SPI Transfers.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 80874d8c9e9cbfa195572dfea46f2314098b3869)
(cherry picked from commit 391db8d1218fa531d6769dc69c89af48b0c4b60d)

9 years agospi: core: Don't destroy master queue if we fail to create it
Mark Brown [Thu, 1 May 2014 17:47:52 +0000 (10:47 -0700)]
spi: core: Don't destroy master queue if we fail to create it

If we fail to create the master queue for some reason we should not attempt
to clean it up since attempting to stop a kthread that was not created will
hang and it's just generally bad practice. Unfortunately at present we call
spi_destroy_queue() even in cases where the creation fails.

Fix this by fixing the error handling in spi_master_initialize_queue() so
that we only flag the master as queued or destroy the queue if creation
succeeded. The change to the flag is done since the general master
cleanup uses this to destroy the queue.

Reported-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
(cherry picked from commit c3676d5ceff213cba35af5ee5f320d2e8dc48cdf)
(cherry picked from commit 849521899b7906b6c4e2894b82a730d08e9bbbe8)

9 years agospi: core: Protect DMA code by #ifdef CONFIG_HAS_DMA
Geert Uytterhoeven [Fri, 2 May 2014 04:29:34 +0000 (06:29 +0200)]
spi: core: Protect DMA code by #ifdef CONFIG_HAS_DMA

If NO_DMA=y:

drivers/built-in.o: In function `spi_map_buf':
spi.c:(.text+0x21bc60): undefined reference to `dma_map_sg'
drivers/built-in.o: In function `spi_unmap_buf.isra.33':
spi.c:(.text+0x21c32e): undefined reference to `dma_unmap_sg'
make[3]: *** [vmlinux] Error 1

Protect the DMA code by #ifdef CONFIG_HAS_DMA to fix this:
  - Extract __spi_map_msg() from spi_map_msg(),
  - Provide dummy definitions of __spi_map_msg() and spi_unmap_msg() if
    !CONFIG_HAS_DMA.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 2de440f59ca9615c92820d165d5e59756e54026b)
(cherry picked from commit 61d339b48df0672b2f1a7ac4edaf5013d0f445cc)

9 years agospi: add "spi-lsb-first" to devicetree
Zhao Qiang [Tue, 1 Apr 2014 09:10:50 +0000 (17:10 +0800)]
spi: add "spi-lsb-first" to devicetree

add optional property devicetree for SPI slave nodes
into devicetree so that LSB mode can be enabled by devicetree.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit cd6339e6ced387ad67b5551dd2931cfd7e8b970b)
(cherry picked from commit 09623c20b3e6b11a914343d4b0f15b63e683f0d8)

9 years agospi: core: Increase timeout value
Harini Katakam [Fri, 11 Apr 2014 06:36:28 +0000 (12:06 +0530)]
spi: core: Increase timeout value

The existing timeout value in wait_for_completion_timeout is
calculated from the transfer length and speed with tolerance of 10msec.
This is too low because this is used for error conditions such as
hardware hang etc.
The xfer->speed_hz considered may not be the actual speed set
because the best clock divisor is chosen from a limited set such that
the actual speed <= requested speed. This will lead to timeout being
less than actual transfer time.
Considering acceptable latencies, this timeout can be set to a
value double the expected transfer plus 100 msecs.
This patch adds the same in the core.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit eee668a92bc775030178c8a7f0d0abe9cce441d7)
(cherry picked from commit e123573ecd0b16f52998e731a0659fdc89d841e4)

9 years agospi: Fix handling of cs_change in core implementation
Mark Brown [Sat, 29 Mar 2014 23:48:07 +0000 (23:48 +0000)]
spi: Fix handling of cs_change in core implementation

The core implementation of cs_change didn't follow the documentation
which says that cs_change in the middle of the transfer means to briefly
deassert chip select, instead it followed buggy drivers which change the
polarity of chip select.  Use a delay of 10us between deassert and
reassert simply from pulling numbers out of a hat.

Reported-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 0b73aa63c193006c3d503d4903dd4792a26e1d50)
(cherry picked from commit f5ec8bd357c3f3fddb46a9bf17293cc6f77d2563)

9 years agospi: Do not require a completion
Mark Brown [Tue, 25 Mar 2014 19:28:22 +0000 (19:28 +0000)]
spi: Do not require a completion

There is no real reason why we require transfers to have a completion and
the only user of the completion now checks to see if one has been provided
before using it so stop enforcing this. This makes it more convenient for
drivers to chain multiple asynchronous transfers together.

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

9 years agospi: core: Use master->max_speed_hz as transfer speed when xfer->speed_hz > master...
Axel Lin [Mon, 17 Mar 2014 02:08:12 +0000 (10:08 +0800)]
spi: core: Use master->max_speed_hz as transfer speed when xfer->speed_hz > master->max_speed_hz

When xfer->speed_hz is greater than master->max_speed_hz, it's generally safe
to use master->max_speed_hz as transfer speed.
Thus use master->max_speed_hz as transfer speed rather than return error when
xfer->speed_hz > master->max_speed_hz.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a6f87fad7b5132f026592729ccf65b995cdec35d)
(cherry picked from commit fe70982ad2c56031804d56ca8ed5e4f884c50c5b)

9 years agospi: core: make zero length transfer valid again
Atsushi Nemoto [Fri, 28 Feb 2014 14:03:16 +0000 (23:03 +0900)]
spi: core: make zero length transfer valid again

Zero length transfer becomes invalid since
"spi: core: Validate length of the transfers in message" commit,
but it should be valid to support an odd device, for example, which
requires long delay between chipselect and the first transfer, etc.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6ea312936d68b557766dafa9a3c4617e14ffa076)
(cherry picked from commit 2e6324d5d3d41454776a6be0b369c758448242ea)

9 years agospi: core: Replace msleep with usleep_range to get more accurate sleep time
Axel Lin [Fri, 21 Feb 2014 01:15:18 +0000 (09:15 +0800)]
spi: core: Replace msleep with usleep_range to get more accurate sleep time

Fixes below checkpatch warning:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(10);

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f97b26b05b1dcd307b2f79d1f9e9d99551987dbb)
(cherry picked from commit 658bc13e4a2d204479ee1978f32eb0e8f06ef643)

9 years agospi: core: Validate length of the transfers in message
Ivan T. Ivanov [Thu, 20 Feb 2014 10:02:08 +0000 (12:02 +0200)]
spi: core: Validate length of the transfers in message

SPI transfer length should be multiple of SPI word size,
where SPI word size should be power-of-two multiple

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 4d94bd21b333c695eba97746b615e2efb30240cc)
(cherry picked from commit 591b5303f19da193ca20d3434c25797dd8b24b08)

9 years agospi: Clean up probe and remove functions
Jean Delvare [Thu, 13 Feb 2014 14:28:41 +0000 (15:28 +0100)]
spi: Clean up probe and remove functions

While backporting 33cf00e5 ("spi: attach/detach SPI device to the ACPI
power domain"), I noticed that the code changes were suboptimal:

* Why use &spi->dev when we have dev at hand?

* After fixing the above, spi is used only once, so we don't really
  need a local variable for it.

This results in the following clean-up.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit aec35f4ee6eefba616065547e6882c084cc7f5cb)
(cherry picked from commit 9ca113486e72c145c8c448672e0ea2009f6383d7)

9 years agospi: Make max_tx and max_rx the same type
Mark Brown [Wed, 12 Feb 2014 20:31:26 +0000 (20:31 +0000)]
spi: Make max_tx and max_rx the same type

Prevents spurious compiler warnings.

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

9 years agospi: core: Set max_speed_hz of spi_device default to max_speed_hz of controller
Axel Lin [Sun, 9 Feb 2014 16:08:05 +0000 (00:08 +0800)]
spi: core: Set max_speed_hz of spi_device default to max_speed_hz of controller

In __spi_validate(), xfer->speed_hz is set to be spi->max_speed_hz if it is not
set for this transfer. However, if spi->max_speed_hz is also not set,
xfer->speed_hz is 0. Some drivers (e.g. au1550, tegra114, tegra20-sflash,
tegra20-slink, etc.) then use below code to avoid setting xfer->speed_hz to 0.

        /* Set speed to the spi max fequency if spi device has not set */
        spi->max_speed_hz = spi->max_speed_hz ? : tspi->spi_max_frequency;

Let's handle it in spi core.
If spi->max_speed_hz is not set, make it default to spi->master->max_speed_hz.
So In __spi_validate() if both xfer->speed_hz and spi->max_speed_hz are not set,
xfer->speed_hz will be set to spi->master->max_speed_hz.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 052eb2d49006fe53bc5f62a196dce23345d4a907)
(cherry picked from commit 56eec45372118d3d6c2c4203d7ba8444873792aa)

9 years agospi: Make core DMA mapping functions generate scatterlists
Mark Brown [Sun, 2 Feb 2014 13:47:47 +0000 (13:47 +0000)]
spi: Make core DMA mapping functions generate scatterlists

We cannot unconditionally use dma_map_single() to map data for use with
SPI since transfers may exceed a page and virtual addresses may not be
provided with physically contiguous pages. Further, addresses allocated
using vmalloc() need to be mapped differently to other addresses.

Currently only the MXS driver handles all this, a few drivers do handle
the possibility that buffers may not be physically contiguous which is
the main potential problem but many don't even do that. Factoring this
out into the core will make it easier for drivers to do a good job so if
the driver is using the core DMA code then generate a scatterlist
instead of mapping to a single address so do that.

This code is mainly based on a combination of the existing code in the MXS
and PXA2xx drivers. In future we should be able to extend it to allow the
core to concatenate adjacent transfers if they are compatible, improving
performance.

Currently for simplicity clients are not allowed to use the scatterlist
when they do DMA mapping, in the future the existing single address
mappings will be replaced with use of the scatterlist most likely as
part of pre-verifying transfers.

This change makes it mandatory to use scatterlists when using the core DMA
mapping so update the s3c64xx driver to do this when used with dmaengine.
Doing so makes the code more ugly but it is expected that the old s3c-dma
code can be removed very soon.

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

9 years agospi: Provide core support for full duplex devices
Mark Brown [Tue, 28 Jan 2014 20:17:03 +0000 (20:17 +0000)]
spi: Provide core support for full duplex devices

It is fairly common for SPI devices to require that one or both transfer
directions is always active. Currently drivers open code this in various
ways with varying degrees of efficiency. Start factoring this out by
providing flags SPI_MASTER_MUST_TX and SPI_MASTER_MUST_RX. These will cause
the core to provide buffers for the requested direction if none are
specified in the underlying transfer.

Currently this is fairly inefficient since we actually allocate a data
buffer which may get large, support for mapping transfers using a
scatterlist will allow us to avoid this for DMA based transfers.

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

9 years agospi: Provide core support for DMA mapping transfers
Mark Brown [Thu, 16 Jan 2014 12:22:43 +0000 (12:22 +0000)]
spi: Provide core support for DMA mapping transfers

The process of DMA mapping buffers for SPI transfers does not vary between
devices so in order to save duplication of code in drivers this can be
factored out into the core, allowing it to be integrated with the work that
is being done on factoring out the common elements from the data path
including more sharing of dmaengine code.

In order to use this masters need to provide a can_dma() operation and while
the hardware is prepared they should ensure that DMA channels are provided
in tx_dma and rx_dma. The core will then ensure that the buffers are mapped
for DMA prior to calling transfer_one_message().

Currently the cleanup on error is not complete, this needs to be improved.

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

9 years agospi: Add a timeout when waiting for transfers
Mark Brown [Thu, 30 Jan 2014 22:16:41 +0000 (22:16 +0000)]
spi: Add a timeout when waiting for transfers

Don't wait indefinitely for transfers to complete but time out after 10ms
more than we expect the transfer to take on the wire.

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

9 years agoMLK-9987: Input: imx_keypad: Fix suspend/resume while keypad is pressed
Fabio Estevam [Thu, 11 Dec 2014 15:14:22 +0000 (13:14 -0200)]
MLK-9987: Input: imx_keypad: Fix suspend/resume while keypad is pressed

Since commit commit 560a64749d1dd0ff ("ENGR00318936-2 input: keyboard: imx:
remove usless release interrupt enabled) the following problem happens:

- Keep any keypad key pressed
- Enter low power mode via "echo mem > /sys/power/state"
- Then we are no longer able to wake-up the system via the keypad

The reason for this behaviour is that the KRIE (Release Interrupt) is not
enabled.

In order to fix this problem, we should enable KRIE when a key is pressed
(KPKD bit is set) or enable KDIE when no key is pressed (KPKR is set).

This way we will always have a valid source of keypad interrupt no matter if
the system entered low power mode while a keypad key was pressed or not.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
(cherry picked from commit 5a7ab47e67d1045cb2f5d408c112617dff48dee2)

9 years agoMLK-10075: ARM: clk-imx6q: refine esai_ipg's parent
Shengjiu Wang [Tue, 6 Jan 2015 09:28:28 +0000 (17:28 +0800)]
MLK-10075: ARM: clk-imx6q: refine esai_ipg's parent

esai_ipg clock's parent is ahb, not ipg.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10018-02 thermal: imx: notify thermal driver in low_bus_freq_mode
Bai Ping [Fri, 26 Dec 2014 13:40:40 +0000 (21:40 +0800)]
MLK-10018-02 thermal: imx: notify thermal driver in low_bus_freq_mode

As thermal sensor alarm function needs PLL3 to be always on, but low power
idle needs all PLLs to be off, they are exclusive. Low power idle is only enabled
when system staying at low bus mode which means the overall system power consumption
is NOT high, thermal alarm function can be disabled in this mode to allow low power
idle to be entered, and thermal sensor will still use polling mechanism to monitor
the system temperature. Add busfreq notify to achieve this goal.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10018-01 arm: imx: Implement busfreq notifier calls for busfreq
Bai Ping [Fri, 26 Dec 2014 13:37:31 +0000 (21:37 +0800)]
MLK-10018-01 arm: imx: Implement busfreq notifier calls for busfreq

Implement busfreq notifier calls used when busfreq entering low_bus_freq_mode.
When the system lower the bus frequency, some modules can be affected by bus
frequency change. Adding notifier call chains that allow driver affected by bus
frequency can be notified before and after low_bus_freq_mode.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10007-03 arm: imx: fix ARM and IPG clk ratio in low_bus_freq_mode
Bai Ping [Fri, 26 Dec 2014 17:36:42 +0000 (01:36 +0800)]
MLK-10007-03 arm: imx: fix ARM and IPG clk ratio in low_bus_freq_mode

On i.MX6SL, we must make sure ARM:IPG clock ratio is within 12:5 when entering
wait mode. If the system is in low_bus_freq_mode, the IPG is at 12MHz
according the busfreq code. So the max rate of ARM is 28.8MHz when entering
wait mode. As there is no way run at this clk rate, so set ARM to run from
24MHz OSC.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10007-02 arm: imx: enable pll1 when changing arm_podf value
Bai Ping [Fri, 26 Dec 2014 17:00:58 +0000 (01:00 +0800)]
MLK-10007-02 arm: imx: enable pll1 when changing arm_podf value

Before changing the arm_podf, the pll1 must be output enabled according
to the hardware design.

Refer to the clk tree implementation code for i.MX6SL. pll1's output will
be disabled when no clk is sourced from it. In busfreq code, in order to
successfully change the arm_clk rate, we must make sure pll1's output is
enabled before changing this clk rate. add imx6sl_enable_pll_arm() calls
to fulfill this requirement.

Additionally, only a bypassed output clk is ok, so no need to make sure pll1
is powered up.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-10007-01: arm: imx: fix typo in debug message of update_lpddr2_freq
Bai Ping [Fri, 26 Dec 2014 16:36:45 +0000 (00:36 +0800)]
MLK-10007-01: arm: imx: fix typo in debug message of update_lpddr2_freq

Add a space between KERN_DEBUG and the debug message string.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-9826 arm: imx6: Add low power idle support for imx6sl
Bai Ping [Wed, 12 Nov 2014 16:44:24 +0000 (00:44 +0800)]
MLK-9826 arm: imx6: Add low power idle support for imx6sl

Enable low power idle for imx6sl. When the busfreq is either
in ultra_low_bus_freq mode or audio_bus_freq_mode, we Can save
more power by reducing the system frequency further in ldle.
At present, Only two idle(WFI and WAIT) are supported.

     WFI        --> normal ARM ilde (first level idle)
     WAIT mode  --> low power idle (second level idle)

When entered WAIT mode, change the DDR, AHB/AXI and ARM clk frequency
as below if the system is in:

  1. ultra_low_bus_freq:
     DDR freq to 1MHz,
     AHB/AXI freq to 3MHz,
     ARM freq to 3MHz.

  2. audio_low_bus_mode:
     DDR freq to 25Hz,
     AHB freq to 8MHz,
     ARM freq to 8MHz.

Anatop can be put in low power mode when all the PLLs are powered down.
We can enable the low power bandgap and disable the rugulator bandgap,
enable the weak 2p5 LDO and disable the 2p5 LDO.

Signed-off-by: Bai Ping <b51503@freescale.com>
9 years agoMLK-9974: ASoC: fsl_sai: There is underrun detected in the beginning sometimes
Shengjiu Wang [Mon, 29 Dec 2014 05:40:08 +0000 (13:40 +0800)]
MLK-9974: ASoC: fsl_sai: There is underrun detected in the beginning sometimes

Write initial words to SAI FIFO to reduce underrun error

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 7ba8ae883d84540fac5ed4147d124399537bc0b3)

9 years agoMLK-9891: ARM: dts: imx6sx-sabreauto: use WDOG_B pin to reset whole board
Robin Gong [Wed, 17 Dec 2014 11:33:11 +0000 (19:33 +0800)]
MLK-9891: ARM: dts: imx6sx-sabreauto: use WDOG_B pin to reset whole board

For the QSPI byte address not aligned in ROM code and kernel, we have to reset
power cycle to workaroud this issue. Use WDOG_B pin to trigger PWRON of pfuze.

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

9 years agoMLK-9819 ARM: imx6sx: Add WDOG_B reset for i.mx6sx boards.
Robin Gong [Fri, 31 Oct 2014 01:36:28 +0000 (09:36 +0800)]
MLK-9819 ARM: imx6sx: Add WDOG_B reset for i.mx6sx boards.

QSPI-NOR reboot failed in case of larger flash size such as 256M used, because
kernel QSPI-NOR flash use 4-bytes-address mode to visit 16MB+ area but ROM code
use 3-bytes-address mode to access QSPI-NOR. Thus, we have to use WDOG_B to
reset QSPI-NOR flash to workaround this.
Note:
  Please update the u-boot with the below u-boot patch, otherwise system will
reboot endless while kernel boot:
"MLK-9819: ARM: mx6sx: clear WDOG3 Power Down Enable bit for i.mx6sx"

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

9 years agoMLK-10073-4 ARM: dts: imx6sx: add ldo-bypass mode for imx6sx boards
Robin Gong [Sun, 4 Jan 2015 09:26:23 +0000 (17:26 +0800)]
MLK-10073-4 ARM: dts: imx6sx: add ldo-bypass mode for imx6sx boards

Support ldo-bypass mode on imx6sx-17x17/19x19 and imx6sx-sdb-reva board.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10073-3 cpufreq: imx6q-cpufreq: add arm-soc-shared property
Robin Gong [Sun, 4 Jan 2015 08:56:11 +0000 (16:56 +0800)]
MLK-10073-3 cpufreq: imx6q-cpufreq: add arm-soc-shared property

Pfuze200 only provide one power supply for VDDARM_IN and VDDSOC_IN,
for ldo-bypass mode, we have to pretend they are different regulators
otherwise regulator famework will refuse update voltage.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10073-2 ARM: dts: imx6sx-sdb: ldo-bypass mode support
Robin Gong [Sun, 4 Jan 2015 08:48:40 +0000 (16:48 +0800)]
MLK-10073-2 ARM: dts: imx6sx-sdb: ldo-bypass mode support

Support ldo-bypass mode on imx6sx-sdb revb board by default and
add ldo-enable dts file.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10073-1 ARM: dts: imx6sx-sdb: add imx6sx-sdb-revb board support
Robin Gong [Sun, 4 Jan 2015 07:50:23 +0000 (15:50 +0800)]
MLK-10073-1 ARM: dts: imx6sx-sdb: add imx6sx-sdb-revb board support

Add reva board dts file since we use revb board as the default dts file.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10068 pxp: Correct YUV32 format in PXP
Sandor Yu [Sun, 4 Jan 2015 06:53:07 +0000 (14:53 +0800)]
MLK-10068 pxp: Correct YUV32 format in PXP

YUV32 format in PXP actually is VUYA,
so change format define from AYUV to VUYA.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10069: csi: remove fsl_csi.h head file from capture folder
Sandor Yu [Wed, 31 Dec 2014 06:33:57 +0000 (14:33 +0800)]
MLK-10069: csi: remove fsl_csi.h head file from capture folder

fsl csi driver have move to mxc subdev folder,
so remove fsl_csi.h file in mxc capture folder.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoENGR00215489-1 WDOG:add WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT interface
Robin Gong [Mon, 2 Jul 2012 02:41:57 +0000 (10:41 +0800)]
ENGR00215489-1 WDOG:add WDIOC_SETPRETIMEOUT and WDIOC_GETPRETIMEOUT interface

Add these two interface, so than user can set and get pre-timeout value to save
some important data before watchdog reboot.

Signed-off-by: Robin Gong <B38343@freescale.com>
(cherry picked from commit 36d2c03e30f18a34439fdb928ad5bad8d66a1b64)
(cherry picked from commit 19b8c1ed3997e01c108c9b22f5541a28f2b23923)

9 years agoMLK-10072 ARM: dts: imx6sx: add uart5 dte pad set for imx6sx-sabreauto board
Fugang Duan [Sun, 4 Jan 2015 05:38:26 +0000 (13:38 +0800)]
MLK-10072 ARM: dts: imx6sx: add uart5 dte pad set for imx6sx-sabreauto board

Add imx6sx-sdb baord uart5 DTE pad set. To avoid a flood of dts files,
there only comment out DTE pinctrl set. If user want to test DTE mode,
it needs to rebuild the DTB file.

(Cherry-picked and merged from commit 4bd6e1654495e190e61a70c9b2c44fda931e2727)

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoARM: imx: add FEC sleep mode callback function
Fugang Duan [Sun, 4 Jan 2015 02:19:40 +0000 (10:19 +0800)]
ARM: imx: add FEC sleep mode callback function

i.MX6q/dl, i.MX6SX SOCs enet support sleep mode that magic packet can
wake up system in suspend status. For different SOCs, there have some
SOC specifical GPR register to set sleep on/off mode. So add these to
callback function for driver.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoARM: dts: imx6qdl: enable FEC magic-packet feature
Fugang Duan [Sun, 4 Jan 2015 02:14:37 +0000 (10:14 +0800)]
ARM: dts: imx6qdl: enable FEC magic-packet feature

Add FEC magic-packet feature support.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: fec: add Wake-on-LAN support
Fugang Duan [Sun, 4 Jan 2015 02:09:35 +0000 (10:09 +0800)]
net: fec: add Wake-on-LAN support

Support for Wake-on-LAN using Magic Packet. ENET IP supports sleep mode
in low power status, when system enter suspend status, Magic packet can
wake up system even if all SOC clocks are gate. The patch doing below things:
- flagging the device as a wakeup source for the system, as well as
  its Wake-on-LAN interrupt
- prepare the hardware for entering WoL mode
- add standard ethtool WOL interface
- enable the ENET interrupt to wake us

Tested on i.MX6q/dl sabresd, sabreauto boards, i.MX6SX arm2 boards.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMA-6031 tty: serial: imx: reduce the transmit and receive latency
Fugang Duan [Tue, 30 Dec 2014 07:02:58 +0000 (15:02 +0800)]
MA-6031 tty: serial: imx: reduce the transmit and receive latency

Current driver use work queue for tx and rx dma task, which bring some schdule
latency. Remove the work queue since the work task don't cost much cpu loading.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMGS-386 [#1506] Power mutex track is buggy in gckKERNEL_Dispatch
Zhenyong Chen [Mon, 29 Dec 2014 17:27:02 +0000 (01:27 +0800)]
MGS-386 [#1506] Power mutex track is buggy in gckKERNEL_Dispatch

In function gckKERNEL_Dispatch, powerMutexAcquired is used to track
power mutex. It is missing from gcvHAL_WRITE_REGISTER. And in some
places return value of gckOS_AcquireMutex is not checked.

Date: Dec 29, 2014
Signed-off-by: Zhenyong Chen <b07273@freescale.com>
Acked-by: Jason Liu
9 years agoMLK-10064 arm: pci: Revert "MLK-10009-1 ARM: imx6sx: Add syscon into gpc dts"
Richard Zhu [Mon, 29 Dec 2014 02:16:49 +0000 (10:16 +0800)]
MLK-10064 arm: pci: Revert "MLK-10009-1 ARM: imx6sx: Add syscon into gpc dts"

syscon shouldn't be added into gpc dts, otherwise, the gpu
wound't be powered on properly.
remove this commit.

This reverts commit 77ddc73cc9504576942d77813abe559b44f59123.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10063 vadc: Remove code from capture folder
Sandor Yu [Fri, 26 Dec 2014 08:36:24 +0000 (16:36 +0800)]
MLK-10063 vadc: Remove code from capture folder

vadc source code have move to folder
drivers/media/platform/mxc/subdev,
so remove it.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10061 csi: correct YUV444 format in v4l2 driver
Sandor Yu [Fri, 26 Dec 2014 07:37:49 +0000 (15:37 +0800)]
MLK-10061 csi: correct YUV444 format in v4l2 driver

v4l2 define YUV444 and YUV32 format as followed:
V4L2_PIX_FMT_YUV444  /* 16  xxxxyyyy uuuvvvv */
V4L2_PIX_FMT_YUV32   /* 32  YUV-8-8-8-8 */

VADC and PXP defined YUV444 as:
YUV1P444 — 32-bit pixels, 1-plane XYUV

so the format of YUV444 in PXP/VADC should
V4L2_PIX_FMT_YUV32 in v4l2.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10047: hdmi: Add hotplug detect for DVI monitors
Sandor Yu [Fri, 19 Dec 2014 08:27:19 +0000 (16:27 +0800)]
MLK-10047: hdmi: Add hotplug detect for DVI monitors

The patch merger from fsl-arm-yocto-bsp community.
HPD is optional function for DVI spec,
so some DVI only monitor not support HPD.
Add RXSENSE interrupt check in HPD process to handle such case.

Signed-off-by: Robert Winkler <robert.winkler@boundarydevices.com>
Signed-off-by: Sandor Yu <R01008@freescale.com>
(cherry picked from commit f047c45830c4e75c441056c76ded476f04938eac)

9 years agoMLK-10059 arm: imx6sx: correct the num of the pcie regulator
Richard Zhu [Thu, 25 Dec 2014 07:54:26 +0000 (15:54 +0800)]
MLK-10059 arm: imx6sx: correct the num of the pcie regulator

The orignal regulat num of the MPCIE_3V3 regulator is wrong,
change it to the correct one.
Otherwise, there would be the following warning when boot kernel.
WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:52 sysfs_warn_dup+0x6c/0x8c()
sysfs: cannot create duplicate filename
'/devices/soc0/regulators.18/3.regulato'
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.24-01139-g690bd11 #166
[<80014e6c>] (unwind_backtrace) from [<800118ac>] (show_stack+0x10/0x14)
[<800118ac>] (show_stack) from [<806b0018>] (dump_stack+0x78/0xc0)
[<806b0018>] (dump_stack) from [<8002c1ec>]
(warn_slowpath_common+0x68/0x8c) [<8002c1ec>] (warn_slowpath_common)
from [<8002c240>] (warn_slowpath_fmt+0x30/0) [<8002c240>]
(warn_slowpath_fmt) from [<8012de80>] (sysfs_warn_dup+0x6c/0x8c)
[<8012de80>] (sysfs_warn_dup) from [<8012df28>]
(sysfs_create_dir_ns+0x88/0x98) [<8012df28>] (sysfs_create_dir_ns) from
[<80274be8>] (kobject_add_internal+0x9c) [<80274be8>]
(kobject_add_internal) from [<80274fe0>] (kobject_add+0x4c/0x98)
[<80274fe0>] (kobject_add) from [<80317bf0>] (device_add+0xe0/0x51c)
[<80317bf0>] (device_add) from [<804e2dd4>]
(of_platform_device_create_pdata+0x)
[<804e2dd4>] (of_platform_device_create_pdata) from [<804e2edc>]
(of_platform_b) [<804e2edc>] (of_platform_bus_create) from [<804e2f38>]
(of_platform_bus_create) [<804e2f38>] (of_platform_bus_create) from
[<804e3090>] (of_platform_populate+0) [<804e3090>]
(of_platform_populate) from [<80cf2d40>] (imx6sx_init_machine+0x38)
[<80cf2d40>] (imx6sx_init_machine) from [<80cde264>]
(customize_machine+0x1c/0x) [<80cde264>] (customize_machine) from
[<800088cc>] (do_one_initcall+0xe8/0x144) [<800088cc>] (do_one_initcall)
from [<80cdbc04>] (kernel_init_freeable+0x104/0x) [<80cdbc04>]
(kernel_init_freeable) from [<806abfb4>] (kernel_init+0x8/0xec)
[<806abfb4>] (kernel_init) from [<8000e5f8>] (ret_from_fork+0x14/0x3c)
---[ end trace f90dcd76c3b24ac8 ]---

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
9 years agoMLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default
Fugang Duan [Thu, 25 Dec 2014 09:17:49 +0000 (17:17 +0800)]
MLK-10060 ARM: i.MX6: disable ethernet phy AR8031 EEE mode in default

Disable ethernet phy AR8031 EEE mode in default to reduce the IEEE1588
latency.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoASoC: wm8960: Move register initialisation to I2C driver probe()
Zidan Wang [Thu, 27 Nov 2014 08:53:08 +0000 (16:53 +0800)]
ASoC: wm8960: Move register initialisation to I2C driver probe()

We must ensure that the clocking configuration is valid as rapidly as possible.
And do software reset before the others registers updates, or the registers
will be reset to the default state.

Signed-off-by: Zidan Wang <b50113@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 3ad5e861a715cbe932cd145d4612c11e5912a72f)

9 years agoASoC: wm8960: Cleanup manual bias level transitions
Lars-Peter Clausen [Sun, 23 Nov 2014 12:37:33 +0000 (13:37 +0100)]
ASoC: wm8960: Cleanup manual bias level transitions

Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 0a87a6e1c09c3b93d91bf65809e79cf6cf358785)

9 years agoASoC: wm8960: Add device tree support
Zidan Wang [Thu, 20 Nov 2014 11:07:48 +0000 (19:07 +0800)]
ASoC: wm8960: Add device tree support

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

Signed-off-by: Zidan Wang <b50113@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit e2280c9040d8bc5039617af35ccf7b8ac4abb428)

9 years agoMLK-10055-2: mfd: si476x-i2c: sound is registered when no FM module attached
Shengjiu Wang [Wed, 24 Dec 2014 08:51:22 +0000 (16:51 +0800)]
MLK-10055-2: mfd: si476x-i2c: sound is registered when no FM module attached

The si476x_core_get_revision_info will send i2c command to FM module, if it
return error, there is no FM modules attached, so we need't to register the
sound card. otherwise, the pulseaudio will access this sound card, but return
a lot of i2c error.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10055-1: ASoC: imx-cs42888: when codec probe failed, alsa return RETRY error.
Shengjiu Wang [Wed, 24 Dec 2014 08:08:45 +0000 (16:08 +0800)]
MLK-10055-1: ASoC: imx-cs42888: when codec probe failed, alsa return RETRY error.

If there is no codec device, the machine driver will not register the
card. then alsa will not return RETRY error. update the error handling
for machine driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10053 dma: imx-sdma: fix building error
Robin Gong [Tue, 23 Dec 2014 08:07:36 +0000 (16:07 +0800)]
MLK-10053 dma: imx-sdma: fix building error

Caused by cherry-pick 260fe87c1d744d8386057d03013e002352f8b181, current
sdma driver remove 'sdmac->mode'.

Signed-off-by: Robin Gong <b38343@freescale.com>
9 years agoMLK-10048-5: ASoC: fsl_asrc: underrun for playback 192k, 6ch p2p case.
Shengjiu Wang [Mon, 8 Dec 2014 07:20:41 +0000 (15:20 +0800)]
MLK-10048-5: ASoC: fsl_asrc: underrun for playback 192k, 6ch p2p case.

For p2p output, the output divider should align with the output sample
rate, if use the Ideal sample rate, there will be a lot of overload, which
will cause underrun.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-4: ASoC: fsl_asrc: fix dma task timeout issue when use 3 instance
Shengjiu Wang [Mon, 15 Dec 2014 09:28:00 +0000 (17:28 +0800)]
MLK-10048-4: ASoC: fsl_asrc: fix dma task timeout issue when use 3 instance

Merged from 49108fcf7b79ed77d34be33b53a3964b2ac27204
1. Watermark level in sdma use byte as its unit. but asrc driver use
word, there is mismatch between them. Here fix this issue and sdma can
work more efficiency.
2. Enlarge the larst_period_size, when use small size, for some case,
the dma task will timeout, because sdma has no much data for output.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-3: ASoC: fsl_asrc: fix asrc crach when suspend/resume
Shengjiu Wang [Mon, 8 Dec 2014 07:08:27 +0000 (15:08 +0800)]
MLK-10048-3: ASoC: fsl_asrc: fix asrc crach when suspend/resume

merge 7e1a620a030d17f93fdd97d076f1cdd042e79337

The reason of crach is that some variables are not protected in
function mxc_asrc_suspend(), when suspend, there is possibility to
access one NULL pointer.
Refine the spin lock usage, add protecting for pair_hold.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
9 years agoMLK-10048-2: ASoC: fsl_asrc: change the return value
Shengjiu Wang [Mon, 8 Dec 2014 05:04:58 +0000 (13:04 +0800)]
MLK-10048-2: ASoC: fsl_asrc: change the return value

Merge from c086d0151ee3e131b52bef96c5096d1ee603c852

Return value -ERESTARTSYS is not visible for user space according
to include/linux/errno.h. So use -EBUSY replace it.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>