aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)AuthorFilesLines
2023-08-07spi: switch to use modern nameMark Brown23-624/+624
Merge series from Yang Yingliang <[email protected]>: After introducing devm_spi_alloc_host/spi_alloc_host(), the legacy named function devm_spi_alloc_master/spi_alloc_master() can be replaced. And also change other legacy name master/slave to modern name host/target or controller.
2023-08-07spi: omap2-mcspi: remove redundant dev_err_probe()Zhu Wang1-3/+1
When platform_get_irq() is called, the error message has been printed, so it need not to call dev_err_probe() to print error, we remove the redundant platform_get_irq(). Signed-off-by: Zhu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: spi-mpc52xx-psc: Fix an unsigned comparison that can never be negativeRajeshwar R Shinde1-1/+1
In struct mpc52xx_psc_spi, the variable 'irq' is declared as an unsigned int. The comparison of variable 'irq' with signed int operand is incorrect. Also, the return value from the call to platform_get_irq(pdev,0) is int and it is assigned to an unsigned int variable 'irq', thus redeclaring the type of variable 'irq' to signed int. This fixes warning such as: drivers/spi/spi-mpc52xx-psc.c:332:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0 Signed-off-by: Rajeshwar R Shinde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: cadence-quadspi: switch to use modern nameYang Yingliang1-22/+22
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: Do not check for 0 return after calling platform_get_irq()Ruan Jinjie4-8/+8
It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> # Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: spi-zynq: Do not check for 0 return after calling platform_get_irq()Ruan Jinjie2-4/+4
It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: npcm-fiu: switch to use modern nameYang Yingliang1-10/+10
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: hisi-kunpeng: switch to use modern nameYang Yingliang1-42/+42
Change legacy name master to modern name host. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: dw: switch to use modern nameYang Yingliang4-74/+74
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: dln2: switch to use modern nameYang Yingliang1-47/+47
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: davinci: switch to use modern nameYang Yingliang1-38/+38
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: coldfire-qspi: switch to use modern nameYang Yingliang1-33/+33
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: spi-cavium-thunderx: switch to use modern nameYang Yingliang1-16/+16
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: octeon: switch to use modern nameYang Yingliang1-16/+16
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: clps711x: switch to use modern nameYang Yingliang1-21/+21
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: cadence: switch to use modern nameYang Yingliang1-35/+35
Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: cadence-xspi: switch to use modern nameYang Yingliang1-15/+15
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: butterfly: switch to use modern nameYang Yingliang1-9/+9
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: bcm63xx: switch to use modern nameYang Yingliang1-34/+34
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: bcm63xx-hsspi: switch to use modern nameYang Yingliang1-43/+43
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: bcm2835aux: switch to use modern nameYang Yingliang1-42/+42
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: bcm2835: switch to use modern nameYang Yingliang1-56/+56
Change legacy name master/slave to modern name host/target. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: bcm-qspi: switch to use modern nameYang Yingliang1-32/+32
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: spi-axi-spi-engine: switch to use modern nameYang Yingliang1-29/+29
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: aspeed: switch to use modern nameYang Yingliang1-7/+7
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-07spi: amd: switch to use modern nameYang Yingliang1-25/+25
Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-04spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPIWilliam Qiu1-0/+67
Add JH7110's clock initialization code to the driver. Signed-off-by: William Qiu <[email protected]> Reviewed-by: Hal Feng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-03spi: mpc5xxx-psc: Fix unsigned expression compared with zeroLi Zetao1-1/+1
There is two warnings reported by coccinelle: ./drivers/spi/spi-mpc512x-psc.c:493:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0 ./drivers/spi/spi-mpc52xx-psc.c:332:5-13: WARNING: Unsigned expression compared with zero: mps -> irq < 0 The commit "208ee586f862" ("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable") was to check whether the IRQ resource is unavailable. When the IRQ resource is unavailable, an error code is returned, however, the type of "mps->irq" is "unsigned int", causing the error code to flip. Modify the type of "mps->irq" to solve this problem. Fixes: 208ee586f862 ("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable") Signed-off-by: Li Zetao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-08-03spi: fsl-spi: Do not check 0 for platform_get_irq()Zhu Wang1-2/+2
Since platform_get_irq() never returned zero, so it need not to check whether it returned zero, and we use the return error code of platform_get_irq() to replace the current return error code, for that platform_get_irq() may return -EINVAL or -ENXIO. Signed-off-by: Zhu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-31spi-geni-qcom: Add SPI device mode support for GENIMark Brown1-6/+47
Merge series from Praveen Talari <[email protected]>: This series adds spi device mode functionality to geni based Qupv3. The common header file contains spi slave related registers and masks. Praveen Talari (2): soc: qcom: geni-se: Add SPI Device mode support for GENI based QuPv3 spi: spi-geni-qcom: Add SPI Device mode support for GENI based QuPv3 --- v6 -> v7: - Corrected author mail v5 -> v6: - Added code comments - Dropped get_spi_master api v4 -> v5: - Addressed review comments in driver v3 -> v4: - Used existing property spi-slave - Hence dropped dt-binding changes v2 -> v3: - Modified commit message - Addressed comment on dt-binding v1 -> v2: - Added dt-binding change for spi slave - Modified commit message - Addressed review comments in driver drivers/spi/spi-geni-qcom.c | 53 ++++++++++++++++++++++++++++---- include/linux/soc/qcom/geni-se.h | 9 ++++++ 2 files changed, 56 insertions(+), 6 deletions(-) -- 2.17.1
2023-07-31spi: loongson: add bus driver for the loongson spi controllerYinbo Zhu6-0/+459
This bus driver supports the Loongson SPI hardware controller in the Loongson platforms and supports the use DTS and PCI framework to register SPI device resources. Signed-off-by: Yinbo Zhu <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Mark Brown <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-31spi: spi-geni-qcom: Add SPI Device mode support for GENI based QuPv3Praveen Talari1-6/+47
Currently spi geni driver supports only master mode operation. Add spi device mode support to GENI based QuPv3. Signed-off-by: Praveen Talari <[email protected]> Reviewed-by: Vijaya Krishna Nivarthi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-31spi: Use dev_err_probe instead of dev_errWang Ming1-4/+4
It is possible that dma_request_chan will return EPROBE_DEFER, which means that dev is not ready yet. In this case, dev_err(dev), there will be no output. This patch fixes the bug. Signed-off-by: Wang Ming <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-30spi: Merge up fixes from Linus' treeMark Brown1-5/+49
Gets us pine64plus back if nothing else.
2023-07-28spi: microchip-core: Clean up redundant dev_err_probe()Chen Jiahao1-4/+2
Refering to platform_get_irq()'s definition, the return value has already been checked if ret < 0, and printed via dev_err_probe(). Calling dev_err_probe() one more time outside platform_get_irq() is obviously redundant. Furthermore, platform_get_irq() will never return irq equals 0, removing spi->irq == 0 checking to clean it up. Signed-off-by: Chen Jiahao <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-27spi: s3c64xx: Clean up redundant dev_err_probe()Chen Jiahao1-1/+1
Referring to platform_get_irq()'s definition, the return value has already been checked if ret < 0, and printed via dev_err_probe(). Calling dev_err_probe() one more time outside platform_get_irq() is obviously redundant. Removing dev_err_probe() outside platform_get_irq() to clean up above problem. Signed-off-by: Chen Jiahao <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-27spi: stm32: Remove redundant dev_err_probe()Ruan Jinjie1-2/+1
There is no need to call the dev_err_probe() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-26spi: tegra20-sflash: fix to check return value of platform_get_irq() in ↵Zhang Shurong1-1/+5
tegra_sflash_probe() The platform_get_irq might be failed and return a negative result. So there should have an error handling code. Fixed this by adding an error handling code. Fixes: 8528547bcc33 ("spi: tegra: add spi driver for sflash controller") Signed-off-by: Zhang Shurong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-26spi: spi-qcom-qspi: Add mem_ops to avoid PIO for badly sized readsDouglas Anderson1-0/+25
In the patch ("spi: spi-qcom-qspi: Fallback to PIO for xfers that aren't multiples of 4 bytes") we detect reads that we can't handle properly and fallback to PIO mode. While that's correct behavior, we can do better by adding "spi_controller_mem_ops" for our controller. Once we do this then the caller will give us a transfer that's a multiple of 4-bytes so we can DMA. Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Vijaya Krishna Nivarthi <[email protected]> Link: https://lore.kernel.org/r/20230725110226.2.Id4a39804e01e4a06dae9b73fd2a5194c4c7ea453@changeid Signed-off-by: Mark Brown <[email protected]>
2023-07-26spi: spi-qcom-qspi: Fallback to PIO for xfers that aren't multiples of 4 bytesDouglas Anderson1-0/+12
The Qualcomm QSPI driver appears to require that any reads using DMA are a mutliple of 4 bytes. If this isn't true then the controller will clobber any extra bytes in memory following the last word. Let's detect this and falback to PIO. This fixes problems reported by slub_debug=FZPUA, which would complain about "kmalloc Redzone overwritten". One such instance said: 0xffffff80c29d541a-0xffffff80c29d541b @offset=21530. First byte 0x0 instead of 0xcc Allocated in mtd_kmalloc_up_to+0x98/0xac age=36 cpu=3 pid=6658 Tracing through what was happening I saw that, while we often did DMA tranfers of 0x1000 bytes, sometimes we'd end up doing ones of 0x41a bytes. Those 0x41a byte transfers were the problem. NOTE: a future change will enable the SPI "mem ops" to help avoid this case, but it still seems good to add the extra check in the transfer. Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Vijaya Krishna Nivarthi <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/20230725110226.1.Ia2f980fc7cd0b831e633391f0bb1272914d8f381@changeid Signed-off-by: Mark Brown <[email protected]>
2023-07-25spi: spi-qcom-qspi: Add DMA_CHAIN_DONE to ALL_IRQSVijaya Krishna Nivarthi1-1/+1
Add latest added DMA_CHAIN_DONE irq to QSPI_ALL_IRQS that encompasses all of the qspi IRQs. Signed-off-by: Vijaya Krishna Nivarthi <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-25spi: spi-qcom-qspi: Call dma_wmb() after setting up descriptorsVijaya Krishna Nivarthi1-1/+3
After setting up dma descriptors and before initiaiting dma transfer, call dma_wmb() to ensure all writes go through. This doesn't fix any reported problem but is added for safety. Signed-off-by: Vijaya Krishna Nivarthi <[email protected]> Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-25spi: spi-qcom-qspi: Use GFP_ATOMIC flag while allocating for descriptorVijaya Krishna Nivarthi1-3/+5
While allocating for DMA descriptor, GFP_KERNEL flag is being used and this allocation happens within critical section with spinlock acquired. This generates a static checker warning. Use GFP_ATOMIC to prevent sleeping; and since this increases chances of allocation failure, add handling accordingly. Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Vijaya Krishna Nivarthi <[email protected]> Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Reviewed-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-25spi: spi-qcom-qspi: Ignore disabled interrupts' status in isrVijaya Krishna Nivarthi1-0/+3
During FIFO/DMA modes dynamic switching, only corresponding interrupts are enabled. However its possible that FIFO related interrupt status registers get set during DMA mode. For example WR_FIFO_EMPTY bit is set during DMA TX. Ignore such status bits so that they don't trip unwanted operations. Suggested-by: Douglas Anderson <[email protected]> Signed-off-by: Vijaya Krishna Nivarthi <[email protected]> Fixes: b5762d95607e ("spi: spi-qcom-qspi: Add DMA mode support") Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-25spi: fsl: Remove unused extern declarationsYueHaibing1-3/+0
commit b36ece832512 ("spi/mpc8xxx: refactor the common code for SPI/eSPI controller") left mpc8xxx_spi_bufs() behind. And since commit 3c5395b66ff6 ("spi: fsl-(e)spi: simplify cleanup code") mpc8xxx_spi_remove() is not used anymore. Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-25spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()Minjie Du1-4/+3
It is possible for dma_request_chan() to return EPROBE_DEFER, which means dev is not ready yet. At this point dev_err() will have no output. Signed-off-by: Minjie Du <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-23spi: Merge up fixes from mainlineMark Brown2-1/+3
There's several things here that will really help my CI.
2023-07-20spi: use devm_clk_get_enabled() in mcfqspi_probe()Yuanjun Gong1-7/+4
in mcfqspi_probe(), the return value of function clk_prepare_enable() should be checked, since it may fail. using devm_clk_get_enabled() instead of devm_clk_get() and clk_prepare_enable() can avoid this problem. Signed-off-by: Yuanjun Gong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-20spi: fix return value check in bcm2835_spi_probe()Yuanjun Gong1-1/+3
in bcm2835_spi_probe(), clk_prepare_enable() may fail, therefore, the return value of clk_prepare_enable() should be checked, and the function should return error if clk_prepare_enable() fails. Signed-off-by: Yuanjun Gong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2023-07-19spi: rzv2m-csi: Make use of device_set_nodeFabrizio Castro1-1/+3
Use device_set_node instead of assigning controller->dev.of_node directly because it also sets the firmware node. Signed-off-by: Fabrizio Castro <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>