aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)AuthorFilesLines
2015-12-30spi: s3c64xx: Remove unused platform_device_id entriesSylwester Nawrocki1-6/+0
s5pv210 and exynos4 are now DT only platforms hence these entries can now be safely removed from the match table. Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-23spi: use to_spi_deviceGeliang Tang1-2/+1
Use to_spi_device() instead of open-coding it. Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-23spi: dw: Use SPI_TMOD_TR rather than magic const 0 to set tmodeJisheng Zhang1-1/+1
The TMODE available value is well defined and documented in the header file. Use it and remove the comment. Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-22QE: Move QE from arch/powerpc to drivers/socZhao Qiang1-1/+1
ls1 has qe and ls1 has arm cpu. move qe from arch/powerpc to drivers/soc/fsl to adapt to powerpc and arm Signed-off-by: Zhao Qiang <[email protected]> Signed-off-by: Scott Wood <[email protected]>
2015-12-16Merge remote-tracking branches 'spi/fix/dspi' and 'spi/fix/spidev' into ↵Mark Brown2-7/+7
spi-linus
2015-12-16Merge remote-tracking branch 'spi/fix/core' into spi-linusMark Brown1-1/+1
2015-12-16spi: fix parent-device reference leakJohan Hovold1-1/+1
Fix parent-device reference leak due to SPI-core taking an unnecessary reference to the parent when allocating the master structure, a reference that was never released. Note that driver core takes its own reference to the parent when the master device is registered. Fixes: 49dce689ad4e ("spi doesn't need class_device") Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
2015-12-16spi: spidev: Hold spi_lock over all defererences of spi in release()Mark Brown1-1/+1
We use the spi_lock spinlock to protect against races between the device being removed and file operations on the spidev. This means that in the removal path all references to the device need to be done under lock as in removal we dropping references to the device. Reported-by: Vegard Nossum <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Anton Bondarenko <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-13spi: loopback: added additional non-power of 2 transfer lengthesMartin Sperl1-3/+4
Added additional transfer length to test that are not a power of 2. Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-13spi: loopback: match configuration of test to descriptionMartin Sperl1-1/+1
The test "two tx+rx transfers - alter second" actually modifies the first not the second transfer, which - in conjunction with testing the read data - results also in overwriting data read earlier. Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-13spi: loopback: fix printk format issues with size_tMartin Sperl1-3/+3
Fixes the reported printk format issues reported by kbuild-test-robot. Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-12spi: add spi-loopback-test to build frameworkMartin Sperl2-0/+10
adding the spi-loopback-test module to Kconfig and Makefile Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-12spi: add loopback test driver to allow for spi_master regression testsMartin Sperl2-0/+1130
This driver is submitting lots of distinct spi-messages messages with all kinds of alignments and length pattern. Also distinct kinds of transfer pattern tests are implemented (rx, tx, rx/tx, tx+tx, tx+rx,...) Right now on a raspberry pi 752 distinct spi_messages are executed in 13 different scenarios. Configuration of additional test-pattern is easy, so that when new bugs in drivers get detected the relevant transfer pattern can also get added to the test framework, so that such situations are detected in other drivers as well. The idea behind this driver is to make it possible to also detect regressions in spi_master implementations when changes occur. Potentially these tests could get executed automatically in a test-server-farm. Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-12spi: davinci: use dev_err() for error reportingSekhar Nori1-7/+7
Use dev_err() for reporting errors rather than dev_dbg(). Signed-off-by: Sekhar Nori <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-12spi: davinci: fix spurious i/o errorSekhar Nori1-1/+2
davinci_spi_bufs() uses wait_for_completion_interruptible() without bothering to handle -ERESTARTSYS. Due to this, sometime, it returns prematurely when a signal is received. Since the return value is never checked, userspace eventually receives a spurious -EIO. To fix this, use un-interruptible wait_for_completion_timeout(). Signed-off-by: Sekhar Nori <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-12spi-fsl-dspi: Fix CTAR Register accessBhuvanchandra DV1-6/+6
DSPI instances in Vybrid have a different amount of chip selects and CTARs (Clock and transfer Attributes Register). In case of DSPI1 we only have 2 CTAR registers and 4 CS. In present driver implementation CTAR offset is derived from CS instance which will lead to out of bound access if chip select instance is greater than CTAR register instance, hence use single CTAR0 register for all CS instances. Since we write the CTAR register anyway before each access, there is no value in using the additional CTAR registers. Also one should not program a value in CTAS for a CTAR register that is not present, hence configure CTAS to use CTAR0. Signed-off-by: Bhuvanchandra DV <[email protected]> Acked-by: Stefan Agner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-07spi: lm70llp: remove printkSudip Mukherjee1-4/+4
Using pr_* macros are more prefferable than using printk. Start using pr_* family of macros and define pr_fmt to be used with it. While at it remove DRVNAME from an existing pr_info() as the name is now being printed by pr_fmt. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-07spi: lm70llp: use dev_warnSudip Mukherjee1-4/+3
As we have a struct device available it is better to use dev_warn() instead of printk. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-04spi: lm70llp: use new parport device modelSudip Mukherjee1-4/+8
Modify spi-lm70llp driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-04spi: lm70llp: remove spaceSudip Mukherjee1-1/+1
checkpatch complains about space before closing brace. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-04spi: lm70llp: correct alignmentSudip Mukherjee1-3/+3
checkpatch complains about the allignment with open parenthesis. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-04spi: lm70llp: remove cast to voidSudip Mukherjee1-2/+2
checkpatch was complaining about space after cast. But the cast to void is not required at that place. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-04spi: lm70llp: add blank line after declarationSudip Mukherjee1-0/+4
checkpatch complains about missing blank line after declaration. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-04spi: lm70llp: remove multiple blank linesSudip Mukherjee1-4/+0
checkpatch complains about multiple blank lines. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-02spi: butterfly: use new parport device modelSudip Mukherjee1-4/+6
Modify spi-butterfly driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-02spi: butterfly: correct alignmentSudip Mukherjee1-6/+5
checkpatch complains about the allignment with open parenthesis. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-02spi: butterfly: remove cast to voidSudip Mukherjee1-2/+2
checkpatch was complaining about space after cast. But the cast to void is not required at that place. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-02spi: butterfly: remove multiple blank linesSudip Mukherjee1-9/+0
checkpatch complains about multiple blank lines. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-01spi: Mark instantiated device nodes with OF_POPULATEGeert Uytterhoeven1-2/+17
Mark (and unmark) device nodes with the POPULATE flag as appropriate. This is required to avoid multi probing when enabling and populating SPI buses in DT overlays. Based on commit 4f001fd30145a6a8 ("i2c: Mark instantiated device nodes with OF_POPULATE"). Suggested-by: Mark Brown <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-01spi: Uninline spi_unregister_device()Geert Uytterhoeven1-0/+14
Uninline spi_unregister_device() in preparation of adding more code to it. Add kerneldoc documentation while we're at it. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-12-01spi: omap2-mcspi: Prevent duplicate gpio_requestMichael Welling1-9/+10
Occasionally the setup function will be called multiple times. Only request the gpio the first time otherwise -EBUSY will occur on subsequent calls to setup. Reported-by: Joseph Bell <[email protected]> Signed-off-by: Michael Welling <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-30spi: topcliff-pch: allow build for MIPS platformsPaul Burton1-1/+1
Allow the topcliff-pch driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board. Signed-off-by: Paul Burton <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-30spi: spidev: Use "%u" to format __u32Geert Uytterhoeven1-1/+1
On 64-bit with CONFIG_SPI_DEBUG=y and #define VERBOSE: drivers/spi/spidev.c:287:3: warning: format '%zd' expects argument of type 'signed size_t', but argument 4 has type '__u32' [-Wformat=] Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-30Merge remote-tracking branches 'spi/fix/bcm63xx', 'spi/fix/doc', ↵Mark Brown4-16/+43
'spi/fix/mediatek' and 'spi/fix/pl022' into spi-linus
2015-11-30spi: dw-mid: constify dw_spi_dma_ops structureJulia Lawall2-2/+2
The dw_spi_dma_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-27spi: bugfix: spi_message.transfer_length does not get resetMartin Sperl1-0/+1
When submitting an identical spi_message multiple times via spi_sync the spi_message.frame_length does not get reset to 0 in __spi_validate before adding up all spi_transfer.len resulting in frame_length > actual_length on all but the first spi_sync call. Signed-off-by: Martin Sperl <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-25spi: mediatek: revise mtk_spi_probe() failure flowLeilk Liu1-7/+8
mtk_spi_probe() calls pm_runtime_enable(), after pm_runtime_enable() is called, it should call pm_runtime_disable() in the failure flow. Signed-off-by: Leilk Liu <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-25Merge branch 'fix/mediatek' of ↵Mark Brown1-8/+18
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-mtk
2015-11-23spi: pl022: handle EPROBE_DEFER for dmaRabin Vincent1-6/+22
Handle EPROBE_DEFER explicitly so that we ensure that we get the DMA channel specified in the device tree, instead of depending on the DMA controller getting probed before us. Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-21spi: mediatek: remove needless pair of writel()/readl()[email protected]1-3/+0
It's not need to re-read and re-write SPI_CMD_REG, so remove it. Signed-off-by: Leilk Liu <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-11-20spi: pxa2xx: Remove redundant call to lpss_ssp_setup() in probeMika Westerberg1-3/+0
Commit 8b136baa5892 ("spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals") added a block where lpss_ssp_setup() gets called again for Intel LPSS SPI host controllers before checking number of chip selects from the capabilities register. There is no point in calling the function twice in probe so remove the first call. Reported-by: Aaron Lu <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Signed-off-by: Mark Brown <[email protected]>