summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'spi/topic/s3c64xx' into spi-nextMark Brown2013-09-011-69/+43
|\
| * spi/s3c64xx: Take runtime PM reference even if DMA is not supportedMark Brown2013-08-141-20/+19
| | | | | | | | | | | | | | We always need the device to be runtime PM enabled to use it so just skip the DMA initialisation not the entire prepare when polling. Signed-off-by: Mark Brown <broonie@linaro.org>
| * Merge tag 'v3.11-rc5' into spi-s3c64xxMark Brown2013-08-144-1/+42
| |\ | | | | | | | | | Linux 3.11-rc5
| * | spi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfersTomasz Figa2013-08-111-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the driver supports only contiguous buffers, there is no need to manually construct a scatterlist with just a single entry, when there is a dedicated helper for this purpose. This patch modifies prepare_dma() function to use available helper instead of manually creating a scatterlist. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: s3c64xx: Do not request CS GPIO on subsequent calls to .setup()Tomasz Figa2013-08-111-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comments in linux/spi/spi.h and observed behavior show that .setup() callback can be called multiple times without corresponding calls to .cleanup(), what was incorrectly assumed by spi-s3c64xx driver, leading to failures trying to request CS GPIO multiple times. This patch modifies the behavior of spi-s3c64xx driver to request CS GPIO only on first call to .setup() after last .cleanup(). Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()Tomasz Figa2013-08-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all fields of dma_slave_config struct are being initialized by prepare_dma() function, leaving those which are not in undefined state, which can confuse DMA drivers using them. This patch adds call to memset() to zero the struct before initializing a subset of its fields. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: s3c64xx: fix casting warningJingoo Han2013-07-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sdd->ops->request is unsigned int, not unsigned long. Also, sdd->rx_dma.ch is a 'struct dma_chan *'. Thus, (void *) is converted to (struct dma_chan *)(unsigned long), in order to fix possible sparse warnings. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: s3c64xx: fix printk warningsJingoo Han2013-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following build warnings when LPAE is enabled: drivers/spi/spi-s3c64xx.c:1466:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat] drivers/spi/spi-s3c64xx.c:1466:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat] Use vsprintf extension %pR to format resource. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi: s3c64xx: fix checkpatch error and warningsJingoo Han2013-07-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following checkpatch error and warnings: ERROR: "(foo*)" should be "(foo *)" WARNING: line over 80 characters WARNING: quoted string split across lines Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | spi/s3c64xx: Remove unused message queueMark Brown2013-07-241-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the driver has been converted to use the core message pump code the only use of the messsage queue in the driver is a check to see if it is empty which will always succeed since nothing ever adds to the queue. Just remove the queue. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
| * | spi: s3c64xx: add missing check for polling modeGirish K S2013-07-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Due to changes in mainline prior to submission the spi device detection in polling mode breaks. This revealed the missing check for polling during dma prepare. This patch adds the missing check. Signed-off-by: Girish K S <ks.giri@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge remote-tracking branch 'spi/topic/rspi' into spi-nextMark Brown2013-09-011-1/+1
|\ \ \
| * | | spi: rspi: Add spi_master_get() call to prevent use after freeAxel Lin2013-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In rspi_remove(), current code dereferences rspi after spi_unregister_master(), thus add an extra spi_master_get() call is necessary to prevent use after free. Current code already has an extra spi_master_put() call in rspi_remove(), so this patch just adds a spi_master_get() call rather than a spi_master_get() with spi_master_put() calls. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | | Merge remote-tracking branch 'spi/topic/quad' into spi-nextMark Brown2013-09-011-40/+37
|\ \ \ \
| * | | | spi: quad: fix the name of DT propertywangyuhang2013-09-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spi: quad: fix the name of DT property in patch The previous property name spi-tx-nbits and spi-rx-nbits looks not human-readable. To make it consistent with other devices, using property name spi-tx-bus-width and spi-rx-bus-width instead of the previous one specify the number of data wires that spi controller will work in. Add the specification in spi-bus.txt. Signed-off-by: wangyuhang <wangyuhang2014@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | spi: quad: Make DT properties optionalMark Brown2013-08-311-38/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addition SPI quad support made the DT properties mandatory, breaking compatibility with existing systems. Fix that by making them optional, also improving the error messages while we're at it. Signed-off-by: Mark Brown <broonie@linaro.org> Tested-by: Stephen Warren <swarren@nvidia.com>
| * | | | spi: quad: Fix missing returnwangyuhang2013-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete a "return" when commit the patch to a new kernel version by mistake. So recover it. Signed-off-by: wangyuhang <wangyuhang2014@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | | | Merge remote-tracking branch 'spi/topic/qspi' into spi-nextMark Brown2013-09-0114-134/+710
|\ \ \ \ \
| * | | | | spi/qspi: fix missing unlock on error in ti_qspi_start_transfer_one()Wei Yongjun2013-09-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the missing unlock before return from function ti_qspi_start_transfer_one() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/qspi: Add compatible string for am4372.Sourav Poddar2013-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a compatible string for am4372. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/qspi: Fix device table entrySourav Poddar2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix module device table entry. Without this, there will be a build failure while trying to build qspi as a module. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/qspi: Add dual/quad spi read supportSourav Poddar2013-08-231-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for multiple lines in SPI framework has been picked[1]. [1]: http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420 Hence, adapting ti qspi driver to support multiple data lines for read. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | Merge remote-tracking branch 'spi/topic/quad' into spi-qspiMark Brown2013-08-231-1/+118
| |\| | | |
| | * | | | spi: conditional checking of mode and transfer bits.Sourav Poddar2013-08-221-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a bug in the following patch: http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420 spi: DUAL and QUAD support fix the previous patch some mistake below: 1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the previous way to get the property in @of_register_spi_devices(). 2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires. 3. Add the following check (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the single, dual and quad. (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set to QUAD(SPI_NBITS_QUAD) (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in single(SPI_NBITS_SINGLE) Checking of the tx/rx transfer bits and mode bits should be done conditionally based on type of buffer filled else EINVAL condition will always get hit either for rx or tx. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | | | spi: DUAL and QUAD supportwangyuhang2013-08-221-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix the previous patch some mistake below: 1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the previous way to get the property in @of_register_spi_devices(). 2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires. 3. Add the following check (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the single, dual and quad. (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set to QUAD(SPI_NBITS_QUAD) (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in single(SPI_NBITS_SINGLE) Signed-off-by: wangyuhang <wangyuhang2014@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/qspi: Add qspi flash controllerSourav Poddar2013-08-223-0/+570
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch add basic support for the quad spi controller. QSPI is a kind of spi module that allows single, dual and quad read access to external spi devices. The module has a memory mapped interface which provide direct interface for accessing data form external spi devices. The patch will configure controller clocks, device control register and for defining low level transfer apis which will be used by the spi framework to transfer data to the slave spi device(flash in this case). Test details: ------------- Tested this on dra7 board. Test1: Ran mtd_stesstest for 40000 iterations. - All iterations went through without failure. Test2: Use mtd utilities: - flash_erase to erase the flash device - mtd_debug read to read data back. - mtd_debug write to write to the data flash. diff between the write and read data shows zero. Acked-by: Felipe Balbi<balbi@ti.com> Reviewed-by: Felipe Balbi<balbi@ti.com> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/tegra20-slink: Use core runtime PMMark Brown2013-07-291-25/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
| * | | | | spi/tegra20-sflash: Use core runtime PMMark Brown2013-07-291-25/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
| * | | | | spi/tegra114: Use core runtime PMMark Brown2013-07-291-25/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
| * | | | | spi/s3c64xx: Use core for runtime PMMark Brown2013-07-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/hspi: Convert to core runtime PMMark Brown2013-07-291-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/pxa2xx: Convert to core runtime PMMark Brown2013-07-291-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/pl022: Convert to core runtime PMMark Brown2013-07-291-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
| * | | | | spi/omap2: Covert to core runtime PMMark Brown2013-07-291-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Felipe Balbi <balbi@ti.com>
| * | | | | spi/coldfire-qspi: Convert to core runtime PMMark Brown2013-07-291-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi/bcm63xx: Convert to core runtime PMMark Brown2013-07-291-20/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi: Provide core support for runtime PM during transfersMark Brown2013-07-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most SPI drivers that implement runtime PM support use identical code to do so: they acquire a runtime PM lock in prepare_transfer_hardware() and then they release it in unprepare_transfer_hardware(). The variations in this are mostly missing error checking and the choice to use autosuspend. Since these runtime PM calls are normally the only thing in the prepare and unprepare callbacks and the autosuspend API transparently does the right thing on devices with autosuspend disabled factor all of this out into the core with a flag to enable the behaviour. Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
| * | | | | spi/tegra-slink: Factor runtime PM out into transfer prepare/unprepareMark Brown2013-07-291-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the tegra slink driver acquires a runtime PM reference for the duration of each transfer. This may result in the IP being powered down between transfers which would be at best wasteful. Instead it is better to do this in the callbacks that are generated before and after starting a series of transfers, keeping the IP powered throughout. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
| * | | | | spi/tegra-sflash: Factor runtime PM out into transfer prepare/unprepareMark Brown2013-07-291-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the tegra sflash driver acquires a runtime PM reference for the duration of each transfer. This may result in the IP being powered down between transfers which would be at best wasteful. Instead it is better to do this in the callbacks that are generated before and after starting a series of transfers, keeping the IP powered throughout. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
| * | | | | spi/tegra114: Factor runtime PM out into transfer prepare/unprepareMark Brown2013-07-291-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the tegra114 driver acquires a runtime PM reference for the duration of each transfer. This may result in the IP being powered down between transfers which would be at best wasteful. Instead it is better to do this in the callbacks that are generated before and after starting a series of transfers, keeping the IP powered throughout. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
* | | | | | Merge remote-tracking branch 'spi/topic/pxa' into spi-nextMark Brown2013-09-011-1/+8
|\ \ \ \ \ \
| * | | | | | spi/pxa2xx: enable DMA on newer Intel LPSS siliconMika Westerberg2013-07-151-1/+8
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an additional bit in the Intel LPSS SPI private registers that needs to be set in order to be able to use DMA with the SPI controller. Enable this as well. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | | | | Merge remote-tracking branch 'spi/topic/pl022' into spi-nextMark Brown2013-09-011-2/+2
|\ \ \ \ \ \
| * | | | | | spi: spi-pl022: Fix warning when CONFIG_ARM_LPAE=yFabio Estevam2013-08-221-2/+2
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_ARM_LPAE=y the following build warning is generated: drivers/spi/spi-pl022.c:2178:9: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' [-Wformat] According to Documentation/printk-formats.txt '%pa' can be used to properly print 'resource_size_t'. Reported-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | | | | Merge remote-tracking branch 'spi/topic/pdata' into spi-nextMark Brown2013-09-0130-160/+125
|\ \ \ \ \ \
| * \ \ \ \ \ Merge remote-tracking branch 'spi/topic/rspi' into spi-pdataMark Brown2013-08-295-5/+56
| |\ \ \ \ \ \ | | | |_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | Conflicts: drivers/spi/spi-rspi.c
| | * | | | | spi: spi-rspi: fix inconsistent spin_lock_irqsaveShimoda, Yoshihiro2013-08-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following Smatch warning: CHECK drivers/spi/spi-rspi.c drivers/spi/spi-rspi.c:606 rspi_work() warn: inconsistent returns spin_lock:&rspi->lock: locked (602) unlocked (606) drivers/spi/spi-rspi.c:606 rspi_work() warn: inconsistent returns irqsave:flags: locked (602) unlocked (606) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | | | | spi: rspi: provide port addresses to dmaengine driver via slave configurationGuennadi Liakhovetski2013-08-021-1/+6
| | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't rely on shdma dhaengine driver getting DMA slave addresses from its slave configuration. Instead provide those addresses, using a dmaengine_slave_config() call. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi: Use dev_get_drvdata at appropriate placesAxel Lin2013-08-294-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use dev_get_drvdata() instead of platform_get_drvdata(to_platform_device(dev)). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | spi: use dev_get_platdata()Jingoo Han2013-08-2929-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>