summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-atmel.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'spi/fix/grant' into spi-linusMark Brown2013-05-131-2/+2
|\
| * spi/atmel: fix speed_hz check in atmel_spi_transfer()Joachim Eastwood2013-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | atmel_spi_transfer() would check speed_hz and fail if the speed was changed in the transfer. After commit "spi: make sure all transfer has proper speed set" this would happen on all transfers. Change speed_hz check to only fail if a lower speed than max is requested. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* | spi/spi-atmel: BUG: fix doesn' support 16 bits transfers using PIORichard Genoud2013-05-021-9/+38
| | | | | | | | | | | | | | | | | | Fix using PIO transfer mode only support 8 bits transfer, doesn't support 16 bits. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> [wenyou.yang@atmel.com: submit the patch] Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: add dmaengine supportNicolas Ferre2013-04-241-21/+566
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dmaengine support. Using "has_dma_support" member of struct is used to select the transfer mode: dmaengine or pdc. For the dmaengine transfer mode, it supports both 8 bits and 16 bits transfer. For the dmaengine transfer mode, if it fails to config dmaengine, or if the message length is less than 16 bytes, it will use the PIO transfer mode. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> [wenyou.yang@atmel.com: using "has_dma_support" to select dmaengine as the spi xfer mode] [wenyou.yang@atmel.com: fix DMA: OOPS if buffer > 4096 bytes] [wenyou.yang@atmel.com: submit the patch] Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Richard Genoud <richard.genoud@gmail.com> [richard.genoud@gmail.com: update with dmaengine interface] [richard.genoud@gmail.com: fix __init/__devinit sections mismatch] [richard.genoud@gmail.com: adapt to slave_config changes] [richard.genoud@gmail.com: add support t0 16 bits transfer] Tested-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: add flag to controller data for lock operationsNicolas Ferre2013-04-231-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Will allow to drop the lock during DMA operations. Replacing non-irqsave versions with irqsave versions of the lock to make it correct in both pdc and dmaengine transfer mode Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> [wenyou.yang@atmel.com: submit the patch] Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: add physical base addressNicolas Ferre2013-04-231-0/+2
| | | | | | | | | | | | | | | | | | | | Needed for future use with dmaengine enabled driver. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> [wenyou.yang@atmel.com: submit the patch] Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: status information passed through controller dataNicolas Ferre2013-04-011-5/+8
| | | | | | | | | | | | | | | | | | | | The status of transfer is stored in controller data structure so that it can be used not only by atmel_spi_msg_done() function. This will be useful for upcoming dmaengine enabled driver. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: call unmapping on transfers buffersNicolas Ferre2013-04-011-3/+5
| | | | | | | | | | | | Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0Wenyou Yang2013-04-011-13/+12
| | | | | | | | | | | | Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | spi/spi-atmel: detect the capabilities of SPI core by reading the VERSION ↵Wenyou Yang2013-04-011-16/+50
|/ | | | | | | | | | | | register. The "has_dma_support" needed for future use with dmaengine driver. [Fixed some unneded ternery operators -- broonie] Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi: Remove erroneous __init, __exit and __exit_p() references in driversGrant Likely2013-02-051-1/+1
| | | | | | | | | | | | | | | Some of the spi driver module remove hooks were annotated with __exit and referenced with __exit_p(). Presumably these were supposed to be __devinit, __devexit and __devexit_p() since __init/__exit for a probe/remove hook has never been correct. They also got missed during the big __devinit/__devexit purge since they didn't match the pattern. Remove then now to be rid of it. v2: purge __init also Reported-by: Arnd Bergmann <arnd@arndb.de> [Arnd set a patch cleaning up one, and then I found more] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi/atmel: add DT supportJean-Christophe PLAGNIOL-VILLARD2012-12-171-1/+16
| | | | | | | | | | Use the newly introduce cs-gpios dt support on atmel. We do not use the hardware cs as it's wired and has bugs and limitations. As the controller believes that only active-low devices/systems exists. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds2012-12-131-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull SPI updates from Grant Likely: "Primarily SPI device driver bug fixes, one removal of an old driver, and some new tegra support. There is some core code change too, but all in all pretty small stuff. The new features to note are: - Common code for describing GPIO CS lines in the device tree - Remove the SPI_BUFSIZ limitation on spi_write_the_read() - core spi ensures bits_per_word is set correctly - SPARC can now use SPI" * tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6: (36 commits) spi/sparc: Allow of_register_spi_devices for sparc spi: Remove HOTPLUG section attributes spi: Add support for specifying 3-wire mode via device tree spi: Fix comparison of different integer types spi/orion: Add SPI_CHPA and SPI_CPOL support to kirkwood driver. spi/sh: Add SH Mobile series as dependency to MSIOF controller spi/sh-msiof: Remove unneeded clock name spi: Remove SPI_BUFSIZ restriction on spi_write_then_read() spi/stmp: remove obsolete driver spi/clps711x: New SPI master driver spi: omap2-mcspi: remove duplicate inclusion of linux/err.h spi: omap2-mcspi: Fix the redifine warning spi/sh-hspi: add CS manual control support of_spi: add generic binding support to specify cs gpio spi: omap2-mcspi: remove duplicated include from spi-omap2-mcspi.c spi/bitbang: (cosmetic) simplify list manipulation spi/bitbang: avoid needless loop flow manipulations spi/omap: fix D0/D1 direction confusion spi: tegra: add spi driver for sflash controller spi: Dont call master->setup if not populated ...
| * spi: Remove HOTPLUG section attributesGrant Likely2012-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | arm: at91: move platfarm_data to include/linux/platform_data/atmel.hJean-Christophe PLAGNIOL-VILLARD2012-11-061-1/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
* atmel/spi: fix missing probeJean-Christophe PLAGNIOL-VILLARD2011-11-091-2/+3
| | | | | | | | | | | | | | | | | | Commit 940ab889 "drivercore: Add helper macro for platform_driver boilerplate" converted this driver to use module_platform_driver, but due to the use of platform_driver_probe(), this resulted in the call to atmel_spi_probe being lost. Place the call to this function into the driver structure. fix section missmatch atmel_spi_probe is marked __init where it's supposed to be __devinit atmel_spi_remove is marked __exit where it's supposed to be __devexit Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Russell King - ARM Linux <linux@arm.linux.org.uk> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
* Merge branch 'spi/next' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds2011-10-291-12/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'spi/next' of git://git.secretlab.ca/git/linux-2.6: drivercore: Add helper macro for platform_driver boilerplate spi: irq: Remove IRQF_DISABLED OMAP: SPI: Fix the trying to free nonexistent resource error spi/spi-ep93xx: add module.h include spi/tegra: fix compilation error in spi-tegra.c spi: spi-dw: fix all sparse warnings spi/spi-pl022: Call pl022_dma_remove(pl022) only if enable_dma is true spi/spi-pl022: calculate_effective_freq() must set rate <= requested rate spi/spi-pl022: Don't allocate more sg than required. spi/spi-pl022: Use GFP_ATOMIC for allocation from tasklet spi/spi-pl022: Resolve formatting issues
| * drivercore: Add helper macro for platform_driver boilerplateGrant Likely2011-10-251-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For simple modules that contain a single platform_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_platform_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Reviewed-by: Magnus Damm <magnus.damm@gmail.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
* | ARM: gpio: at91: convert drivers to use asm/gpio.h rather than mach/gpio.hRussell King2011-08-081-1/+1
|/ | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* spi: reorganize driversGrant Likely2011-06-061-0/+1093
Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers. This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file. v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be be the predominant pattern for subsystem prefixes. - Clean up filenames in Kconfig and header comment blocks Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@linaro.org>