summaryrefslogtreecommitdiffstats
path: root/drivers/spi
AgeCommit message (Collapse)Author
2013-08-14spi/spi-{bcm63xx.c,bfin-v3.c}: simplify use of devm_ioremap_resourceJulia Lawall
Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. Move the call to platform_get_resource adjacent to the call to devm_ioremap_resource to make the connection between them more clear. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@ - res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-14spi/s3c64xx: Take runtime PM reference even if DMA is not supportedMark Brown
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>
2013-08-14Merge tag 'v3.11-rc5' into spi-s3c64xxMark Brown
Linux 3.11-rc5
2013-08-13spi-topcliff-pch: Add MODULE_DEVICE_TABLEAlexander Stein
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-11spi: s3c64xx: Use dmaengine_prep_slave_single() to prepare DMA transfersTomasz Figa
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>
2013-08-11spi: s3c64xx: Do not request CS GPIO on subsequent calls to .setup()Tomasz Figa
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>
2013-08-11spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()Tomasz Figa
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>
2013-08-09spi: new controller driver for efm32 SoCsUwe Kleine-König
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-09spi/bitbang: Drop empty setup() functionsMark Brown
Now that the bitbang core does not require a setup() function we can drop the check in the altera, nuc900 and xilinx drivers. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-09spi/bitbang: don't error out if there is no setup callback providedUwe Kleine-König
It's perfectly valid not to have a setup callback when the probe routine does all the needed things. So don't even check for this case and trust the caller. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-09Merge tag 'v3.11-rc4' into spi-bitbangMark Brown
Linux 3.11-rc4
2013-08-06spi: spi-mxs: Remove unused bits_per_word variableAxel Lin
The bits_per_word variable is not used after commit 24778be20f8 "spi: convert drivers to use bits_per_word_mask". Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06spi/build: Remove SPI_SIRF from compile testMark Brown
It now needs the architecture dependant DMA driver. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06spi/sirf: Depends on SIRF_DMAMark Brown
Now that DMA support has been added to the driver it needs the architecture DMA driver to be built in order to link. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-06spi: sirf: use DMA if both buffer address and length are alignedBarry Song
this patch enables DMA support for SiRFSoC SPI driver, if both buffers and length are aligned with DMA controller's hardware limitation, use generic SiRF generic dmaengine driver. for PIO, SiRF SPI controller actually is using rx to trigger rx, that means if we write any word to tx fifo, we will get a word from rx fifo. for DMA, we use two different channel for tx and rx, and issue them both for every transfer. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-05spi: octeon: Remove my_master pointer from struct octeon_spiAxel Lin
Pass master to platform_set_drvdata() then we can remove my_master pointer. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-05spi: bcm2835: Use SPI_BPW_MASK macro for bits_per_word_mask settingAxel Lin
We have a SPI_BPW_MASK macro defined in spi.h, use it instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-02spi: rspi: provide port addresses to dmaengine driver via slave configurationGuennadi Liakhovetski
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>
2013-07-31spi/ep93xx: Fix format specifier warningEmil Goode
This patch fixes the following sparse warning by changing the the format specifier for size_t to %zu. drivers/spi/spi-ep93xx.c:512:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat] Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-31spi/atmel: Fix format specifier warningsEmil Goode
This patch fixes the following sparse warnings. dma_addr_t can be either u32 or u64 so we should cast to the largest type and use the format specifier %llx. drivers/spi/spi-atmel.c: In function ‘atmel_spi_next_xfer_dma_submit’: drivers/spi/spi-atmel.c:631:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat] drivers/spi/spi-atmel.c:631:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat] drivers/spi/spi-atmel.c: In function ‘atmel_spi_pdc_next_xfer’: drivers/spi/spi-atmel.c:734:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat] drivers/spi/spi-atmel.c:734:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat] drivers/spi/spi-atmel.c:773:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat] drivers/spi/spi-atmel.c:773:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat] Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-30spi/txx9: Use linux/gpio.h not asm/gpio.hMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi: spi-davinci: Fix direction in dma_map_single()Christian Eggers
Commit 048177ce3b3962852fd34a7e04938959271c7e70 (spi: spi-davinci: convert to DMA engine API) introduced a regression: dma_map_single() is called with direction DMA_FROM_DEVICE for rx and for tx. Signed-off-by: Christian Eggers <ceggers@gmx.de> Acked-by: Matt Porter <mporter@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org # v3.7.x+
2013-07-29spi/tegra20-slink: Use core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2013-07-29spi/tegra20-sflash: Use core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2013-07-29spi/tegra114: Use core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2013-07-29spi/s3c64xx: Use core for runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/hspi: Convert to core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/pxa2xx: Convert to core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/pl022: Convert to core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2013-07-29spi/omap2: Covert to core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Felipe Balbi <balbi@ti.com>
2013-07-29spi/coldfire-qspi: Convert to core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/bcm63xx: Convert to core runtime PMMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi: Provide core support for runtime PM during transfersMark Brown
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>
2013-07-29spi/tegra-slink: Factor runtime PM out into transfer prepare/unprepareMark Brown
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>
2013-07-29spi/tegra-sflash: Factor runtime PM out into transfer prepare/unprepareMark Brown
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>
2013-07-29spi/tegra114: Factor runtime PM out into transfer prepare/unprepareMark Brown
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>
2013-07-29spi/orion: Convert to devm_ioremap_resource()Mark Brown
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Andrew Lunn <andrew@lunn.ch>
2013-07-29spi/imx: expose module alias for loading from device-treeNiels de Vos
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-29spi/drivers: Enable build of drivers with COMPILE_TESTMark Brown
Enable the build of drivers which don't have any real build time dependency on their architecture or platform with COMPILE_TEST, providing better build time coverage. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29spi/orion: Directly include linux/size.hMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-28spi/atmel: Annotate lock/unlock functionsMark Brown
Let checkers like sparse know that the locking imbalances are intentional in these functions. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-28spi/sh-msiof: Remove unneeded empty runtime PM callbacksMark Brown
Previously the runtime PM API insisted on having callbacks for everything but this requirement was removed a while ago so the empty callbacks can also be removed. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-28spi/sh-hspi: Remove noisy printMark Brown
This adds no meaningful value. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-25spi: davinci: Update configs to make it selectable on KeystoneSantosh Shilimkar
Keystone2 SOCs share the SPI IP block with DaVinci based SOCs. Update the config bits so that its usable on Keystone2 based SOCs. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-24spi: s3c64xx: fix casting warningJingoo Han
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>
2013-07-24spi: s3c64xx: fix printk warningsJingoo Han
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>
2013-07-24spi: s3c64xx: fix checkpatch error and warningsJingoo Han
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>
2013-07-24spi/s3c64xx: Remove unused message queueMark Brown
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>
2013-07-24spi: bcm2835: don't check resource with devm_ioremap_resourceWolfram Sang
devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-22spi: spi-mxs: Remove unneeded check for platform_get_resource()Fabio Estevam
As devm_ioremap_resource() is used on probe, there is no need to explicitly check the return value from platform_get_resource(), as this is something that devm_ioremap_resource() takes care by itself. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>