aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-imx.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-01-22spi: imx: fix spi resource leak with dma transferGao Pan1-3/+5
In spi_imx_dma_transfer(), when desc_rx = dmaengine_prep_slave_sg() fails, the context goes to label no_dma and then return. However, the memory allocated for desc_tx has not been freed yet, which leads to resource leak. Signed-off-by: Gao Pan <pandy.gao@nxp.com> Reviewed-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15spi: imx: defer spi initialization, if DMA engine isAnton Bondarenko1-0/+3
If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15spi: imx: return error from dma channel requestAnton Bondarenko1-11/+16
On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15spi: imx: enable loopback only for ECSPI controller familyAnton Bondarenko1-5/+6
Limit SPI_LOOP mode to ECSPI controller (iMX.51, iMX53 and i.MX6) only since there is no support in other families specific code for now. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-15spi: imx: fix loopback mode setup after controller resetAnton Bondarenko1-1/+3
If controller hold in reset it's not possible to write any register except CTRL. So all other registers must be updated only after controller bring out from reset. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-07spi: imx: add function to check for IMX51 family controllerAnton Bondarenko1-3/+8
Similar to other controller type checks add check function for IMX51. It includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-07spi: imx: replace multiple watermarks with single for RX, TX and RXTAnton Bondarenko1-16/+13
There is no need to have different watermarks levels since they are the same. Merge them into one WML parameter. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-07spi: imx: reorder HW operations enable order to avoid possible RX data lossAnton Bondarenko1-2/+10
The overflow may happen due to rescheduling for another task and/or interrupt if we enable SPI HW before starting RX DMA. So RX DMA enabled first to make sure data would be read out from FIFO ASAP. TX DMA enabled next to start filling TX FIFO with new data. And finaly SPI HW enabled to start actual data transfer. The risk rise in case of heavy system load and high SPI clock. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-07spi: imx: terminate RX DMA transaction in case of TX DMA timeoutAnton Bondarenko1-0/+1
Not only TX DMA should be terminated, but RX DMA also. It's required to avoid accidential DMA memory writes from RX DMA channel and properly terminate transaction. Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-04spi: imx: Add loopback mode supportFabio Estevam1-2/+13
Loopback mode can be activated by setting bit LBC (LoopBack Control) of register ECSPI_TESTREG. Add support for it. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-23spi: imx: fix ecspi mode setupAndrew Y. Kuksov1-0/+7
Fixed problem with setting spi mode 0 or 1 after setting mode 2 or 3 SPI_MODE_0 and SPI_MODE_1 requires clock low when inactive. SPI_MODE_2 and SPI_MODE_3 requires clk high when inactive. Currently driver can just set bits in fields SCLK_PHA (SPI Clock/Data Phase Control), SCLK_POL (SPI Clock Polarity Control), SCLK_CTL (controls the inactive state of SCLK) ans SS_POL (SPI SS Polarity Select) of ECSPIx_CONFIGREG register. This patch allows driver to clear corresponding bits in these fields. Signed-off-by: Andrew Y. Kuksov <qxovxp@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24spi: imx: Fix small DMA transfersSascha Hauer1-2/+3
DMA transfers must be greater than the watermark level size. spi_imx->rx_wml and spi_imx->tx_wml contain the watermark level in 32bit words whereas struct spi_transfer contains the transfer len in bytes. Fix the check if DMA is possible for a transfer accordingly. This fixes transfers with sizes between 33 and 128 bytes for which previously was claimed that DMA is possible. Fixes: f62caccd12c17e4 (spi: spi-imx: add DMA support) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: stable@vger.kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-01spi: imx: Constify platform_device_idKrzysztof Kozlowski1-1/+1
The platform_device_id is not modified by the driver and core uses it as const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-11Merge remote-tracking branches 'spi/topic/fsl-cspi', 'spi/topic/fsl-dspi', 'spi/topic/imx' and 'spi/topic/of-id' into spi-nextMark Brown1-2/+2
2015-04-01spi: imx: read back the RX/TX watermark levels earlierLucas Stach1-2/+2
They are used to decide if the controller can do DMA on a buffer of a specific length and thus are needed before any transfer is attempted. This fixes a memory leak where the SPI core uses the drivers can_dma() callback to determine if a buffer needs to be mapped. As the watermark levels aren't correct at that point the driver falsely claims to be able to DMA the buffer when it fact it isn't. After the transfer has been done the core uses the same callback to determine if it needs to unmap the buffers. As the driver now correctly claims to not being able to DMA the buffer the core doesn't attempt to unmap the buffer which leaves the SGT leaking. Fixes: f62caccd12c17e4 (spi: spi-imx: add DMA support) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-03-03spi: spi-imx: use correct enumeration typeStefan Agner1-2/+2
The fourth argument of dmaengine_prep_slave_sg needs to be of the enumeration type dma_transfer_direction instead of dma_data_direction. Since the used enumeration values actually stay the same, this is not an actual issue at runtime. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-08Merge remote-tracking branches 'spi/topic/img-spfi', 'spi/topic/imx', 'spi/topic/inline', 'spi/topic/meson' and 'spi/topic/mxs' into spi-nextMark Brown1-14/+14
2015-02-04spi: spi-imx: cleanup wait_for_completion handlingNicholas Mc Guire1-7/+8
return type of wait_for_completion_timeout is unsigned long not int and always returns >=0 , this patch adds a suitable return variable and simplifies the return value checking as there is no < 0 case. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-03spi: imx: use pio mode for i.mx6dlRobin Gong1-0/+4
For TKT238285 hardware issue which may cause txfifo store data twice can only be caught on i.mx6dl, we use pio mode instead of DMA mode on i.mx6dl. Fixes: f62caccd12c17e4 (spi: spi-imx: add DMA support) Signed-off-by: Robin Gong <b38343@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-12-30spi: spi-imx: Do not store the irq number in the private structureFabio Estevam1-7/+6
The irq number is only used inside the probe function, so there is really no need to store it in the private structure. Use a local 'irq' variable to hold the the irq number instead. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-20spi: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-09-17spi: spi-imx: add DMA supportRobin Gong1-6/+280
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>
2014-03-30Merge remote-tracking branches 'spi/topic/imx', 'spi/topic/init', 'spi/topic/mpc512x-psc', 'spi/topic/mpc52xx', 'spi/topic/mxs', 'spi/topic/nuc900', 'spi/topic/oc-tiny' and 'spi/topic/octeon' into spi-nextMark Brown1-3/+2
2014-03-30Merge remote-tracking branches 'spi/topic/bus-num', 'spi/topic/cleanup', 'spi/topic/clps711x', 'spi/topic/coldfire', 'spi/topic/completion' and 'spi/topic/davinci' into spi-nextMark Brown1-1/+1
2014-02-28spi: spi-imx: spi_imx_remove: do not disable disabled clocksPhilippe De Muyter1-2/+2
Currently, at module removal, one gets the following warnings: ------------[ cut here ]------------ WARNING: at drivers/clk/clk.c:780 clk_disable+0x18/0x24() Modules linked in: spi_imx(-) [last unloaded: ev76c560] CPU: 1 PID: 16337 Comm: rmmod Tainted: G W 3.10.17-80548-g90191eb-dirty #33 [<80013b4c>] (unwind_backtrace+0x0/0xf8) from [<800115dc>] (show_stack+0x10/0x14) [<800115dc>] (show_stack+0x10/0x14) from [<800257b8>] (warn_slowpath_common+0x4c/0x68) [<800257b8>] (warn_slowpath_common+0x4c/0x68) from [<800257f0>] (warn_slowpath_null+0x1c/0x24) [<800257f0>] (warn_slowpath_null+0x1c/0x24) from [<803f60ec>] (clk_disable+0x18/0x24) [<803f60ec>] (clk_disable+0x18/0x24) from [<7f02c9cc>] (spi_imx_remove+0x54/0x9c [spi_imx]) [<7f02c9cc>] (spi_imx_remove+0x54/0x9c [spi_imx]) from [<8025868c>] (platform_drv_remove+0x18/0x1c) [<8025868c>] (platform_drv_remove+0x18/0x1c) from [<80256f60>] (__device_release_driver+0x70/0xcc) [<80256f60>] (__device_release_driver+0x70/0xcc) from [<80257770>] (driver_detach+0xcc/0xd0) [<80257770>] (driver_detach+0xcc/0xd0) from [<80256d90>] (bus_remove_driver+0x7c/0xc0) [<80256d90>] (bus_remove_driver+0x7c/0xc0) from [<80068668>] (SyS_delete_module+0x144/0x1f8) [<80068668>] (SyS_delete_module+0x144/0x1f8) from [<8000e080>] (ret_fast_syscall+0x0/0x30) ---[ end trace 1f5df9ad54996300 ]--- ------------[ cut here ]------------ WARNING: at drivers/clk/clk.c:780 clk_disable+0x18/0x24() Modules linked in: spi_imx(-) [last unloaded: ev76c560] CPU: 1 PID: 16337 Comm: rmmod Tainted: G W 3.10.17-80548-g90191eb-dirty #33 [<80013b4c>] (unwind_backtrace+0x0/0xf8) from [<800115dc>] (show_stack+0x10/0x14) [<800115dc>] (show_stack+0x10/0x14) from [<800257b8>] (warn_slowpath_common+0x4c/0x68) [<800257b8>] (warn_slowpath_common+0x4c/0x68) from [<800257f0>] (warn_slowpath_null+0x1c/0x24) [<800257f0>] (warn_slowpath_null+0x1c/0x24) from [<803f60ec>] (clk_disable+0x18/0x24) [<803f60ec>] (clk_disable+0x18/0x24) from [<7f02c9e8>] (spi_imx_remove+0x70/0x9c [spi_imx]) [<7f02c9e8>] (spi_imx_remove+0x70/0x9c [spi_imx]) from [<8025868c>] (platform_drv_remove+0x18/0x1c) [<8025868c>] (platform_drv_remove+0x18/0x1c) from [<80256f60>] (__device_release_driver+0x70/0xcc) [<80256f60>] (__device_release_driver+0x70/0xcc) from [<80257770>] (driver_detach+0xcc/0xd0) [<80257770>] (driver_detach+0xcc/0xd0) from [<80256d90>] (bus_remove_driver+0x7c/0xc0) [<80256d90>] (bus_remove_driver+0x7c/0xc0) from [<80068668>] (SyS_delete_module+0x144/0x1f8) [<80068668>] (SyS_delete_module+0x144/0x1f8) from [<8000e080>] (ret_fast_syscall+0x0/0x30) ---[ end trace 1f5df9ad54996301 ]--- Since commit 9e556dcc55774c9a1032f32baa0e5cfafede8b70, "spi: spi-imx: only enable the clocks when we start to transfer a message", clocks are always disabled except when transmitting messages. There is thus no need to disable them at module removal. Fixes: 9e556dcc55774 (spi: spi-imx: only enable the clocks when we start to transfer a message) Signed-off-by: Philippe De Muyter <phdm@macqel.be> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2014-02-23spi/imx: Use dev_name() for request_irq() to distinguish SPIsAlexander Shiyan1-1/+1
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-14spi: spi-imx: Propagate the real error code on platform_get_irq() failureFabio Estevam1-1/+1
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>
2014-02-10spi: Use reinit_completion at appropriate placesAxel Lin1-1/+1
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>
2014-02-03spi: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
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>
2013-12-20spi: spi-imx: Fix out-of-order CS/SCLK operation at low speedsMarek Vasut1-2/+25
Problem: -------- The problem this patch addresses has the following assumptions about the SPI bus setup: - The hardware used to find this is Freescale i.MX537 @ 1200MHz - The SPI SCLK operate at very low speed, less than 200 kHz - There are two SPI devices attached to the bus - Each device uses different GPIO for chipselect - Each device requires different SCLK signal polarity The observation of the SCLK and GPIO chipselect lines with a logic analyzer shows, that the SCLK polarity change does sometimes happen after the GPIO chipselect is asserted. The SPI slave device reacts on that by counting the SCLK polarity change as a clock pulse, which disrupts the communication with the SPI slave device. Explanation: ------------ We found an interesting correlation, that the maximum delay between the write into the ECSPIx_CONFIGREG register and the change of SCLK polarity at each SCLK frequency of 10 kHz, 20 kHz, 50 kHz and 100 kHz is 100 uS, 50 uS, 20 uS and 10 uS respectively. This lead us to a theory, that at SCLK frequency of 1 Hz, the delay would be 1 S. Therefore, the time it takes for the write to ECSPIx_CONFIGREG to take effect in the hardware is up to the duration of 1 tick of the SCLK clock. During this delay period, if the SCLK frequency is too low, the execution of the spi-imx.c driver can advance so much, that the GPIO chipselect will be asserted. The GPIO chipselect is asserted almost immediatelly. Solution: --------- The solution this patch presents is simple. We calculate the resulting SCLK clock first by dividing the ECSPI block clock by both dividers that are to be programmed into the configuration register. Based on the resulting SCLK clock, we derive the delay it will take for the changes to get really applied. We are extra careful here so we delay twice as long as we should. Note that the patch does not create additional overhead at high speeds as the delay will likely be close to zero there. Signed-off-by: Marek Vasut <marex@denx.de> To: linux-spi@vger.kernel.org Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Huang Shijie <b32955@freescale.com> Cc: Mark Brown <broonie@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-25Merge remote-tracking branch 'spi/topic/imx' into spi-nextMark Brown1-0/+33
2013-10-23spi: spi-imx: only enable the clocks when we start to transfer a messageHuang Shijie1-0/+33
Current code keeps the clocks enabled all the time, it wastes the power when there is no operaiton on the spi controller. In order to save the power, this patch adds the two hooks: spi_imx_prepare_message: enable the clocks for this message spi_imx_unprepare_message: disable the clocks. This patch also disables the clocks in the end of the probe. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-17spi: bitbang: Let spi_bitbang_start() take a reference to masterAxel Lin1-1/+1
Many drivers that use bitbang library have a leak on probe error paths. This is because once a spi_master_get() call succeeds, we need an additional spi_master_put() call to free the memory. Fix this issue by moving the code taking a reference to master to spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on success. With this change, the caller is responsible for calling spi_bitbang_stop() to decrement the reference and spi_master_put() as counterpart of spi_alloc_master() to prevent a memory leak. So now we have below patten for drivers using bitbang library: probe: spi_alloc_master -> Init reference count to 1 spi_bitbang_start -> Increment reference count remove: spi_bitbang_stop -> Decrement reference count spi_master_put -> Decrement reference count (reference count reaches 0) Fixup all users accordingly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Suggested-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Acked-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/imx: expose module alias for loading from device-treeNiels de Vos1-0/+1
Enable auto loading by udev when spi-imx is compiled as a module. Signed-off-by: Niels de Vos <ndevos@redhat.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-15spi: spi-imx: Check the return value from clk_prepare_enable()Fabio Estevam1-4/+10
clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error. While at it, fix the order of clk_disable_unprepare calls: clk_ipg should be disabled first, followed by clk_per. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-15spi: spi-imx: Use devm functionsFabio Estevam1-46/+15
Using devm functions can make the code smaller and cleaner. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-26Merge remote-tracking branch 'spi/topic/imx' into spi-nextMark Brown1-8/+0
2013-06-26Merge remote-tracking branch 'spi/topic/core' into spi-nextMark Brown1-3/+0
2013-05-30spi: spi-imx: Fix compilation errorSachin Kamat1-1/+1
Fix compilation error due to a typo introduced by commit 24778be20f ("spi: convert drivers to use bits_per_word_mask"). Without this patch we get the following build errors: drivers/spi/spi-imx.c: In function ‘spi_imx_setupxfer’: drivers/spi/spi-imx.c:703:2: warning: no return statement in function returning non-void [-Wreturn-type] drivers/spi/spi-imx.c: At top level: drivers/spi/spi-imx.c:705:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘->’ token drivers/spi/spi-imx.c:707:2: error: expected identifier or ‘(’ before ‘return’ drivers/spi/spi-imx.c:708:1: error: expected identifier or ‘(’ before ‘}’ token Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-29spi: convert drivers to use bits_per_word_maskStephen Warren1-3/+3
Fill in the recently added spi_master.bits_per_word_mask field in as many drivers as possible. Make related cleanups, such as removing any redundant error-checking, or empty setup callbacks. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-13spi: spi-imx: Let device core handle pinctrlFabio Estevam1-8/+0
Since commit ab78029 (drivers/pinctrl: grab default handles from device core), we can rely on device core for handling pinctrl. So remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-13spi: remove unnecessary platform_set_drvdata()Jingoo Han1-3/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-05spi/imx: Add MODULE_ALIAS()Fabio Estevam1-0/+1
Add an entry for MODULE_ALIAS(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-12-07spi: Remove HOTPLUG section attributesGrant Likely1-3/+3
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Bill Pemberton has done most of the legwork on this series. I've used his script to purge the attributes from the drivers/gpio tree. Reported-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-10-02Merge tag 'spi-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/miscLinus Torvalds1-2/+4
Pull spi updates from Mark Brown: "No framework work here, only a bunch of driver updates of varying sizes: - Factoring out of the core hardware support from the MXS MMC driver by Marek Vasut to allow the hardware to also be used for SPI. - Lots of error handling cleanups from Guenter Roeck - Removal of the existing Tegra driver which is quite comprehensively broken as detailed in the changelog for the removal. - DT suppport for the PL022 and GPIO drivers. - pinctrl support for OMAP and PL022." Pulling from Mark Brown as Grant Likely is still busy moving. * tag 'spi-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc: (53 commits) spi: remove completely broken Tegra driver spi/imx: set the inactive state of the clock according to the clock polarity spi/pl022: get/put resources on suspend/resume spi/pl022: use more managed resources spi/pl022: Devicetree support w/o platform data spi/s3c64xx: Don't free controller_data on non-dt platforms spi: omap2-mcspi: add pinctrl support spi/pl022: adopt pinctrl support spi: omap2-mcspi: Cleanup the omap2_mcspi_txrx_dma function spi/gpio: Fix stub for spi_gpio_probe_dt() spi/mxs: Make the SPI block clock speed configurable via DT spi: spi-sh-hspi: drop frees of devm_ alloc'd data spi/pl022: Fix chipselects pointer computation spi: spi-tle62x0: Use module_spi_driver macro mxs/spi: Rework the mxs_ssp_timeout to be more readable mxs/spi: Decrement the DMA/PIO border mxs/spi: Increment the transfer length only if transfer succeeded mxs/spi: Fix issues when doing long continuous transfer spi: spi-gpio: Add DT bindings spi: spi-gpio: store chipselect information in private structure ...
2012-10-01Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-1/+1
Pull ARM soc multiplatform enablement from Olof Johansson: "This is a pretty significant branch. It's the introduction of the first multiplatform support on ARM, and with this (and the later branch) merged, it is now possible to build one kernel that contains support for highbank, vexpress, mvebu, socfpga, and picoxcell. More platforms will be convered over in the next few releases. Two critical last things had to be done for this to be practical and possible: * Today each platform has its own include directory under mach-<mach>/include/mach/*, and traditionally that is where a lot of driver/platform shared definitions have gone, such as platform data structures. They now need to move out to a common location instead, and this branch moves a large number of those out to include/linux/platform_data. * Each platform used to list the device trees to compile for its boards in mach-<mach>/Makefile.boot. Both of the above changes will mean that there are some merge conflicts to come (and some to resolve here). It's a one-time move and once it settles in, we should be good for quite a while. Sorry for the overhead." Fix conflicts as per Olof. * tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (51 commits) ARM: add v7 multi-platform defconfig ARM: msm: Move core.h contents into common.h ARM: highbank: call highbank_pm_init from .init_machine ARM: dtb: move all dtb targets to common Makefile ARM: spear: move platform_data definitions ARM: samsung: move platform_data definitions ARM: orion: move platform_data definitions ARM: vexpress: convert to multi-platform ARM: initial multiplatform support ARM: mvebu: move armada-370-xp.h in mach dir ARM: vexpress: remove dependency on mach/* headers ARM: picoxcell: remove dependency on mach/* headers ARM: move all dtb targets out of Makefile.boot ARM: picoxcell: move debug macros to include/debug ARM: socfpga: move debug macros to include/debug ARM: mvebu: move debug macros to include/debug ARM: vexpress: move debug macros to include/debug ARM: highbank: move debug macros to include/debug ARM: move debug macros to common location ARM: make mach/gpio.h headers optional ...
2012-09-28spi/imx: set the inactive state of the clock according to the clock polarityKnut Wohlrab1-2/+4
There are SPI devices which need a SPI clock with active low polarity and high inactive state. Add the setting of the inactive state ECSPIx_CONFIGREG:SCLK CTL according to the clock polarity ECSPIx_CONFIGREG:SCLK POL: DT without "spi-cpol" = 0 = clock active high polarity = inactive state low DT with "spi-cpol" = 1 = clock active low polarity = inactive state high Signed-off-by: Knut Wohlrab <knut.wohlrab@de.bosch.com> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-14ARM: imx: move platform_data definitionsArnd Bergmann1-1/+1
Platform data for device drivers should be defined in include/linux/platform_data/*.h, not in the architecture and platform specific directories. This moves such data out of the imx include directories Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Sascha Hauer <kernel@pengutronix.de> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Dan Williams <djbw@fb.com> Cc: "Ben Dooks (embedded platforms)" <ben-linux@fluff.org> Cc: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de> Cc: Chris Ball <cjb@laptop.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Alan Cox <alan@linux.intel.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Liam Girdwood <lrg@ti.com> Cc: Javier Martin <javier.martin@vista-silicon.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2012-08-03spi/imx: make spi_imx_data.devtype_data member point to const dataUwe Kleine-König1-1/+1
This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/spi/spi-imx.c: In function spi_imx_probe: drivers/spi/spi-imx.c:814:24: warning: assignment discards const qualifier from pointer target type [enabled by default] Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2012-07-13spi/imx: use gpio_is_valid to determine if a gpio is validHui Wang1-6/+6
Use gpio_is_valid() to replace "gpio >= 0" or "gpio < 0". Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Hui Wang <jason77.wang@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>