aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)AuthorFilesLines
2013-10-11spi/s3c64xx: Use prepare_message() and unprepare_message()Mark Brown1-8/+28
This is of very little value in itself but will be useful once the loop iterating over the transfers is also factored out into the core. Signed-off-by: Mark Brown <[email protected]>
2013-10-11spi: Provide per-message prepare and unprepare operationsMark Brown1-0/+22
Many SPI drivers perform setup and tear down on every message, usually doing things like DMA mapping the message. Provide hooks for them to use to provide such operations. This is of limited value for drivers that implement transfer_one_message() but will be of much greater utility with future factoring out of standard implementations of that function. Signed-off-by: Mark Brown <[email protected]>
2013-10-11spi: attach/detach SPI device to the ACPI power domainMika Westerberg1-2/+16
If the SPI device is enumerated from ACPI namespace (it has an ACPI handle) it might have ACPI methods that needs to be called in order to transition the device to different power states (such as _PSx). We follow what has been done for platform and I2C buses here and attach the SPI device to the ACPI power domain if the device has an ACPI handle. This makes sure that the device is powered on when its ->probe() is called. For non-ACPI devices this patch is a no-op. Signed-off-by: Mika Westerberg <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-10-10spi: Fix modalias for ACPI enumerated SPI devicesJarkko Nikula1-1/+1
There is a minor fault about ACPI enumerated SPI devices with their modalias attribute. Now modalias is set by device instance not by hardware ID. For example "spi:INTABCD:00", "spi:INTABCD:01" etc. This means each device instance gets different modalias which does match with generated modules.alias. Currently this is not problem as matching can happen also with "acpi:INTABCD" modalias. Fix this by using ACPI hardware ID. Signed-off-by: Jarkko Nikula <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-10spi/rspi: Fix 8bit data access, clear bufferHiep Cao Minh1-2/+93
The R8A7790 has QSPI module which added into RSPI together. The transmit or receive data should be read from or written to with the longword-, word-, or byte-access width. Modify word- access to byte-access. In 16-bit data register, QSPI send or receive datas access from high 8-bit while RSPI send or receive datas access from low 8-bit on single mode. Modify to reset transmit-receive buffer data and reading dummy after data are transmited. RSPI has a TXMD bit on control register(SPCR) to set transmit-only mode when transmit data or Full-duplex synchronous mode when receive data. In QSPI the TXMD bit is not supported, so after transmit data, dummy should be read and before transmit or receive data the bufer register should be reset. This driver is the implementation of send and receive pio only, DMA is not supported at this time. Without this patch, it will occur error when transmit and receive Signed-off-by: Hiep Cao Minh <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-09drivers: clean-up prom.h implicit includesRob Herring3-0/+4
Powerpc is a mess of implicit includes by prom.h. Add the necessary explicit includes to drivers in preparation of prom.h cleanup. Signed-off-by: Rob Herring <[email protected]> Acked-by: Grant Likely <[email protected]>
2013-10-09spi: omap2-mcspi: Fix FIFO support for transmit-and-receive modeIllia Smyrnov1-3/+9
This patch fixes MCSPI FIFO buffer support when transmit-and-receive (full duplex) mode is used. In this mode FIFO can be used for RX or for TX or for both directions. If FIFO used for both directions the buffer is split into two 32-byte buffers - one for each direction. Also for full duplex mode both AEL and AFL need to be set in CHCONF0 register. Signed-off-by: Illia Smyrnov <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-09spi: spi-txx9: replace platform_driver_probe to support deferred probingWolfram Sang1-1/+2
Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-09spi: spi-omap-uwire: replace platform_driver_probe to support deferred probingWolfram Sang1-2/+3
Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-09spi: spi-bfin5xx: replace platform_driver_probe to support deferred probingWolfram Sang1-1/+2
Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-09Merge remote-tracking branch 'spi/topic/devm' into spi-bfinMark Brown20-65/+54
2013-10-09spi: efm32: drop unused struct and fix size checkUwe Kleine-König1-5/+1
The variable efm32_spi_pdata_default origins from an earlier revision of the patch introducing the driver, its use was dropped because of review comments but I forgot to also drop the variable itself. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-09spi: spi-au1550: replace platform_driver_probe to support deferred probingWolfram Sang1-1/+2
Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-08spi: convert bus code to use dev_groupsGreg Kroah-Hartman1-4/+6
The dev_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the spi bus code to use the correct field. Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-07spi/s3c64xx: Factor transfer start out of enable/disable_cs()Mark Brown1-0/+3
The hardware level /CS handling is tied to the start of the data path so is rolled into the same function as we use to manipulate GPIO /CS. In order to support factoring out the /CS handling into the core separate the two and explicitly start transfers separately to the /CS handling. Signed-off-by: Mark Brown <[email protected]>
2013-10-07spi: Provide trace points for message processingMark Brown1-1/+15
Provide tracepoints for the lifecycle of a message from submission to completion and for the active time for masters to help with performance analysis of SPI I/O. Signed-off-by: Mark Brown <[email protected]>
2013-10-07spi/tegra20-slink: Remove unused is_single_xfer checkMark Brown1-6/+2
Currently transfer_one_message() checks to see if the message consists of a single spi_transfer and tells _start_transfer_one() but it just ignores this. Don't bother. Signed-off-by: Mark Brown <[email protected]> Acked-by: Laxman Dewangan <[email protected]>
2013-10-07Merge remote-tracking branch 'spi/fix/s3c64xx' into spi-linusMark Brown1-2/+2
2013-10-07Merge remote-tracking branch 'spi/fix/pxa' into spi-linusMark Brown1-1/+10
2013-10-07Merge remote-tracking branch 'spi/fix/mpc512x' into spi-linusMark Brown1-1/+3
2013-10-07Merge remote-tracking branch 'spi/fix/hspi' into spi-linusMark Brown1-2/+2
2013-10-07Merge remote-tracking branch 'spi/fix/dspi' into spi-linusMark Brown1-8/+2
2013-10-07Merge remote-tracking branch 'spi/fix/clps711x' into spi-linusMark Brown1-3/+0
2013-10-07spi: efm32: add spi_bitbang_stop to device remove callbackUwe Kleine-König1-0/+2
This call is needed to cleanup the resources requested by spi_bitbang_start in the probe callback. Noticed-by: Axel Lin <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-07Merge remote-tracking branch 'spi/topic/bitbang' into HEADMark Brown18-26/+33
2013-10-07spi: bitbang: Let spi_bitbang_start() take a reference to masterAxel Lin18-26/+33
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 <[email protected]> Suggested-by: Uwe Kleine-Koenig <[email protected]> Acked-by: Uwe Kleine-Koenig <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-07spi: atmel: Fix incorrect error pathSachin Kamat1-1/+2
'irq' was not released when clk_prepare_enable failed. Fix it. Signed-off-by: Sachin Kamat <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-07Merge remote-tracking branch 'spi/topic/devm' into spi-qspiMark Brown20-57/+55
Conflicts: drivers/spi/spi-ti-qspi.c
2013-10-07spi: ti-qspi: one only one interrupt handlerSebastian Andrzej Siewior1-33/+6
The here used irq and threaded irq handler is a complete non-sense. After the status register is read and the source disabled it schedules a thread (the irq thread) to read the status from the variable, invoke complete() and then renable the interrupt. Again: schedule a thread which invokes _only_ complete(). This patch removes this non-sense and we remain with one handler which invokes complete() if needed. The device remove path should now disable the interupts. This has been compile time tested. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Tested-by: Sourav Poddar <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-03Merge remote-tracking branch 'spi/fix/clps711x' into spi-clps711xMark Brown1-3/+0
Conflicts: drivers/spi/spi-clps711x.c
2013-10-03spi: clps711x: Remove redundant labelSachin Kamat1-2/+1
Remove empty label. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-10-03spi/hspi: fixup Runtime PM enable timingKuninori Morimoto1-2/+2
3e00a09d2fbd64f0ad98e7c8c29dbf9e038fc746 (spi/hspi: Convert to core runtime PM) enabled master->auto_runtime_pm. Then, pm_runtime_enable() is required *before* spi_register_master() calling. This patch fixed it up. Kernel will hang up with "spi_master spi0: Failed to power device: -13" message without this patch. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-30spi/s3c64xx: Enable GPIO /CS prior to starting hardwareMark Brown1-3/+3
To help with bisection of future refactoring to share more of the code for handling a spi_message pull the enabling of GPIO based /CS prior to all the hardware setup for starting a transfer. Signed-off-by: Mark Brown <[email protected]>
2013-09-30spi/s3c64xx: Factor transfer start out of enable/disable_cs()Mark Brown1-8/+11
The hardware level /CS handling is tied to the start of the data path so is rolled into the same function as we use to manipulate GPIO /CS. In order to support factoring out the /CS handling into the core separate the two and explicitly start transfers separately to the /CS handling. Signed-off-by: Mark Brown <[email protected]>
2013-09-30spi/s3c64xx: Use core cs_gpio fieldMark Brown1-14/+10
Rather than using the driver custom platform data to store the chip select GPIO use the cs_gpio field provided by the SPI core, supporting future refectoring. Signed-off-by: Mark Brown <[email protected]>
2013-09-30spi/s3c64xx: Remove unused gpios field from driver dataMark Brown1-1/+0
Signed-off-by: Mark Brown <[email protected]>
2013-09-30spi/s3c64xx: Check that clock enables succeed on runtime resumeMark Brown1-2/+10
Signed-off-by: Mark Brown <[email protected]>
2013-09-30spi/s3c64xx: Flush FIFOs prior to cleaning up transferMark Brown1-2/+2
Ensure that the FIFOs are fully drained before we deassert /CS or do any delays that have been requested in order to ensure that the behaviour visible on the bus matches that which was requested by the caller. Signed-off-by: Mark Brown <[email protected]>
2013-09-27spi: Use of_property_read_u32Trent Piepho1-26/+23
Instead of getting the raw property, checking the length, and doing endian conversion each time, use the OF function of_property_read_u32() that does all that. Error messages are slightly improved with error codes from of_property_read_u32() for different ways the property may be invalid (missing, too short, etc.) Signed-off-by: Trent Piepho <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-27spi: simplify call to request_module()Mathias Krause1-4/+1
request_module() can handle format strings on its own, no need to create the full module name ourself. Signed-off-by: Mathias Krause <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-27Merge remote-tracking branch 'spi/fix/s3c64xx' into spi-s3c64xxMark Brown1-2/+2
Conflicts: drivers/spi/spi-s3c64xx.c
2013-09-27spi/s3c64xx: Ensure runtime PM is enabled prior to registrationMark Brown1-2/+2
Otherwise we may try to start transfers immediately and then fail to runtime resume the device causing us not to have clocks enabled. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Sylwester Nawrocki <[email protected]> Conflicts: drivers/spi/spi-s3c64xx.c
2013-09-27spi/tegra114: Correct support for cs_changeRhyland Klein1-17/+68
The tegra114 driver wasn't currently handling the cs_change functionality. cs_change is meant to invert the decisions of whether or not to deactivate CS after each transfer. Without cs_change, after every transfer (other than the last in the message) the normal behavior is to leave CS active. For the last transfer, normally CS is deactivated when the transfer is complete. With cs_change set on a transfer (other than last one) CS would be deactivated and the next transfer would need to activate it again. If cs_change was set on the last tranfer in a message, then CS would be left active when the message compeleted. Also, this builds in logic so that if a different device tries to start a transfer while CS is active from a different device, it will abort the previous transfer and start a new one for the new device. This splits tegra_spi_start_transfer_one into 2 functions, the new one being tegra_spi_setup_transfer_one. The setup function is safe to call on all transfers, sets up for the transfer, and handles the special case of the first transfer in a message. In this special case, it needs to know whether or not it needs to activate CS. This work was based on the spi-atmel driver. Signed-off-by: Rhyland Klein <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-27spi/clps711x: drop clk_put for devm_clk_get in spi_clps711x_probe()Wei Yongjun1-1/+0
devm_clk_get() is used so there is no reason to explicitly call clk_put() in probe or remove functions. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-26spi/qspi: Add dual/quad read mode bit.Sourav Poddar1-1/+1
Add dual/quad read mode bit flag for the master controller. These check will be used in the spi framework to determine whether the master controller can do dual/quad read respectively. Signed-off-by: Sourav Poddar <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-26spi: s3c64xx: Allow build on all Samsung platformsMateusz Krawczuk1-1/+1
Replace all symbols by simple dependency PLAT_SAMSUNG. Signed-off-by: Mateusz Krawczuk <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-26spi: txx9: use devm_spi_register_master()Jingoo Han1-3/+1
Use devm_spi_register_master() to make cleanup paths simpler, and remove a duplicate put. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-26spi: ti-qspi: use devm_spi_register_master()Jingoo Han1-11/+1
Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-26spi: tegra20-slink: use devm_spi_register_master()Jingoo Han1-2/+1
Use devm_spi_register_master() to make cleanup paths simpler. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-09-26spi: tegra20-sflash: use devm_spi_register_master()Jingoo Han1-2/+1
Use devm_spi_register_master() to make cleanup paths simpler. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Mark Brown <[email protected]>