Commit Graph

7056 Commits

Author SHA1 Message Date
Li Zetao ba85f5fad8
spi: bcm2835: Use helper function devm_clk_get_enabled()
Since commit 7ef9651e97 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables (and possibly
prepares) the clocks for the whole lifetime of the device. Moreover, it is
no longer necessary to unprepare and disable the clocks explicitly.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230823133938.1359106-7-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:57 +01:00
Li Zetao a08199b309
spi: spi-axi-spi-engine: Use helper function devm_clk_get_enabled()
Since commit 7ef9651e97 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables (and possibly
prepares) the clocks for the whole lifetime of the device. Moreover, it is
no longer necessary to unprepare and disable the clocks explicitly.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230823133938.1359106-6-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:56 +01:00
Li Zetao b3422ea391
spi: ath79: Use helper function devm_clk_get_enabled()
Since commit 7ef9651e97 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables (and possibly
prepares) the clocks for the whole lifetime of the device. Moreover, it is
no longer necessary to unprepare and disable the clocks explicitly.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230823133938.1359106-5-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:55 +01:00
Li Zetao 9ee8fbc05e
spi: aspeed: Use helper function devm_clk_get_enabled()
Since commit 7ef9651e97 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables (and possibly
prepares) the clocks for the whole lifetime of the device. Moreover, it is
no longer necessary to unprepare and disable the clocks explicitly.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Link: https://lore.kernel.org/r/20230823133938.1359106-4-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:54 +01:00
Li Zetao f918b3a67c
spi: armada-3700: Use helper function devm_clk_get_prepared()
Since commit 7ef9651e97 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare() can now be replaced
by devm_clk_get_prepared() when driver prepares the clocks for the whole
lifetime of the device. Moreover, it is no longer necessary to unprepare
the clocks explicitly.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230823133938.1359106-3-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:53 +01:00
Li Zetao 1d3ea34b7b
spi: ar934x: Use helper function devm_clk_get_enabled()
Since commit 7ef9651e97 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables (and possibly
prepares) the clocks for the whole lifetime of the device. Moreover, it is
no longer necessary to unprepare and disable the clocks explicitly.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230823133938.1359106-2-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:52 +01:00
Andy Shevchenko 764246c7fe
spidev: Simplify SPI_IOC_RD_MODE* cases in spidev_ioctl()
The temporary variable tmp is not used outside of the
SPI_IOC_RD_MODE* cases, hence we can optimize its use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://lore.kernel.org/r/20230824162209.2890440-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:51 +01:00
Andy Shevchenko 193a7f9e1a
spidev: Switch to use spi_get_csgpiod()
spidev_ioctl() checks if there is an SPI chip select is driven by GPIO.
Instead of current code, we can call spi_get_csgpiod().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://lore.kernel.org/r/20230824162209.2890440-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:50 +01:00
Andy Shevchenko 12c8d7a76c
spidev: Decrease indentation level in spidev_ioctl() SPI_IOC_RD_MODE*
Instead of defining a local controller variable inside an indented
block, move the definition to the top of spidev_ioctl() and reuse
it in the SPI_IOC_RD_MODE* and SPI_IOC_WR_MODE* cases.

This drops unneeded indentation and reduces amount of LoCs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://lore.kernel.org/r/20230824162209.2890440-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:49 +01:00
Yang Yingliang ee0f793cc1
spi: omap2-mcspi: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-22-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:47 +01:00
Yang Yingliang 0d81c46e70
spi: omap-uwire: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-21-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:46 +01:00
Yang Yingliang ba0dada2ba
spi: oc-tiny: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-20-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:45 +01:00
Yang Yingliang 8af8a27b78
spi: nxp-fspi: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-19-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:44 +01:00
Yang Yingliang 2b0aa563b3
spi: npcm-pspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-18-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:43 +01:00
Yang Yingliang 7647a16b68
spi: mxs: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-17-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:42 +01:00
Yang Yingliang fc42bb55c0
spi: mxic: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-16-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:42 +01:00
Yang Yingliang 0fc8a1a431
spi: mux: switch to use spi_alloc_host()
Switch to use modern name function spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-15-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:41 +01:00
Yang Yingliang efdf4c9934
spi: mtk-snfi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-14-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:40 +01:00
Yang Yingliang a3a77a4268
spi: mtk-nor: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-13-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:39 +01:00
Yang Yingliang e56e3de003
spi: mt7621: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-12-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:38 +01:00
Yang Yingliang cae1578847
spi: mt65xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-11-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:37 +01:00
Yang Yingliang d6503d1192
spi: mpc52xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-10-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:37 +01:00
Yang Yingliang 171639f845
spi: mpc52xx-psc: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-9-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:36 +01:00
Yang Yingliang a21db73963
spi: mpc512x-psc: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-8-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:35 +01:00
Yang Yingliang 8f8bf52ed5
spi: microchip-core: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-7-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:34 +01:00
Yang Yingliang 5d97a3abbb
spi: microchip-core-qspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-6-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:33 +01:00
Yang Yingliang 55591ac481
spi: meson-spifc: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-5-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:33 +01:00
Yang Yingliang 68bf3288c7
spi: meson-spicc: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-4-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:32 +01:00
Yang Yingliang 48815830a9
spi: lp-8841: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:31 +01:00
Yang Yingliang 7c5d1d9787
spi: lm70llp: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230823033003.3407403-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:31:30 +01:00
Valentin Caron 6de8a70c84
spi: stm32: add a delay before SPI disable
As explained in errata sheet, in section "2.14.5 Truncation of SPI output
signals after EOT event":
On STM32MP1x, EOT interrupt can be thrown before the true end of
communication.

So we add a delay of a half period to wait the real end of the
transmission.

Link: https://www.st.com/resource/en/errata_sheet/es0539-stm32mp131x3x5x-device-errata-stmicroelectronics.pdf
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20230906132735.748174-1-valentin.caron@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:24:00 +01:00
Han Xu 18495676f7
spi: nxp-fspi: reset the FLSHxCR1 registers
Reset the FLSHxCR1 registers to default value. ROM may set the register
value and it affects the SPI NAND normal functions.

Signed-off-by: Han Xu <han.xu@nxp.com>
Link: https://lore.kernel.org/r/20230906183254.235847-1-han.xu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:23:59 +01:00
Linus Torvalds 32904dec06 spi: Fixes for v6.6
A couple of fixes for the sun6i driver, the patch to reduce DMA RX to
 single byte width all the time is *hopefully* excessively cautious but
 it's unclear which SoCs are affected so the fix just covers everything
 for safety.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmT5wQ0ACgkQJNaLcl1U
 h9Bltgf/T7tViGF1+g0fUx7Nlju+h8Hg3qBhlE+VKwRO6/qjBczT4ny4nkiej+CK
 IapuEDul+F56Cy4/dgyFQkICTCm7qGev+r7Oya0OCWqAiXif5fz/zfxc4rHUzRA9
 lZrdWrYNxhlAqcDu80G00nh5Gx5UCpTHEriWJQUQ0oxXGQoPRPW2WczMsksF6QLs
 gnqr7hhIWzSvj0OOHVWi6a1iOMVgw0ICEgUF6TSoDsMOzvi6c1WVnCLZaE6udWhv
 0wwOBzH1YBbwhfK/RdjUcSfHIy/jI2Gs7BnrUWviIfQSCb90V9YvAGlgusJAR4Ks
 Y5UM3d8pVxQg5tW75IFjMt/fic6Rfg==
 =HZqv
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v6.6-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A couple of fixes for the sun6i driver. The patch to reduce DMA RX to
  single byte width all the time is *hopefully* excessively cautious but
  it's unclear which SoCs are affected so the fix just covers everything
  for safety"

* tag 'spi-fix-v6.6-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain
  spi: sun6i: reduce DMA RX transfer width to single byte
2023-09-07 15:49:20 -07:00
Tobias Schramm 1f11f4202c
spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain
Previously the transfer complete IRQ immediately drained to RX FIFO to
read any data remaining in FIFO to the RX buffer. This behaviour is
correct when dealing with SPI in interrupt mode. However in DMA mode the
transfer complete interrupt still fires as soon as all bytes to be
transferred have been stored in the FIFO. At that point data in the FIFO
still needs to be picked up by the DMA engine. Thus the drain procedure
and DMA engine end up racing to read from RX FIFO, corrupting any data
read. Additionally the RX buffer pointer is never adjusted according to
DMA progress in DMA mode, thus calling the RX FIFO drain procedure in DMA
mode is a bug.
Fix corruptions in DMA RX mode by draining RX FIFO only in interrupt mode.
Also wait for completion of RX DMA when in DMA mode before returning to
ensure all data has been copied to the supplied memory buffer.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
Link: https://lore.kernel.org/r/20230827152558.5368-3-t.schramm@manjaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-04 13:55:29 +01:00
Tobias Schramm 171f8a49f2
spi: sun6i: reduce DMA RX transfer width to single byte
Through empirical testing it has been determined that sometimes RX SPI
transfers with DMA enabled return corrupted data. This is down to single
or even multiple bytes lost during DMA transfer from SPI peripheral to
memory. It seems the RX FIFO within the SPI peripheral can become
confused when performing bus read accesses wider than a single byte to it
during an active SPI transfer.

This patch reduces the width of individual DMA read accesses to the
RX FIFO to a single byte to mitigate that issue.

Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
Link: https://lore.kernel.org/r/20230827152558.5368-2-t.schramm@manjaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-04 13:55:29 +01:00
Linus Torvalds 3b6bf5b1f8 spi: Updates for v6.6
There's been quite a lot of generic activity here, but more
 administrative than featuers.  We also have a bunch of new drivers,
 including one that's part of a MFD so we pulled in the core parts of
 that:
 
  - Lots of work from both Yang Yingliang and Andy Shevchenko on moving
    to host/device/controller based terminology for devices.
  - QuadSPI SPI support for Allwinner sun6i.
  - New device support Cirrus Logic CS43L43, Longsoon, Qualcomm GENI
    QuPv3 and StarFive JH7110 QSPI.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTp6KQACgkQJNaLcl1U
 h9BHMQf+Jtvdx8cIhzVyMRBUfmeEzpi5oGiurPiQVBM5RsO0APULbxdy1kBsQ4FO
 5Omv7juG323XiZc1hrtBPNoZfnn83pjjMFZZZYse8Ntd6e5iesHzxRQJaml8NPBA
 0ktJQiB6Eh9WTjYT6LgN8T5j4SLT5F2jiDinBPUj1vHGSy0YXGWpYFq9QIkXwMbE
 8n0jyf5+Neccs4CIiPR3ap8NjIyPE/b761acRFkOmF+iiHWmnFrQYNS4CSxR2kOC
 yL0SlzuoG2feYSfiHyCKIPC0MGT5/Vn1tzNqoEam6B6Ecql24W8BMdU0/No3yKPT
 22LIfRWR9Wb5usFxjDxIs9YaWD4abA==
 =oj/i
 -----END PGP SIGNATURE-----

Merge tag 'spi-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "There's been quite a lot of generic activity here, but more
  administrative than featuers. We also have a bunch of new drivers,
  including one that's part of a MFD so we pulled in the core parts of
  that:

   - Lots of work from both Yang Yingliang and Andy Shevchenko on moving
     to host/device/controller based terminology for devices.

   - QuadSPI SPI support for Allwinner sun6i.

   - New device support Cirrus Logic CS43L43, Longsoon, Qualcomm GENI
     QuPv3 and StarFive JH7110 QSPI"

* tag 'spi-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (151 commits)
  spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
  spi: spi-sn-f-ospi: switch to use modern name
  spi: sifive: switch to use modern name
  spi: sh: switch to use modern name
  spi: sh-sci: switch to use modern name
  spi: sh-msiof: switch to use modern name
  spi: sh-hspi: switch to use modern name
  spi: sc18is602: switch to use modern name
  spi: s3c64xx: switch to use modern name
  spi: rzv2m-csi: switch to use devm_spi_alloc_host()
  spi: rspi: switch to use spi_alloc_host()
  spi: rockchip: switch to use modern name
  spi: rockchip-sfc: switch to use modern name
  spi: realtek-rtl: switch to use devm_spi_alloc_host()
  spi: rb4xx: switch to use modern name
  spi: qup: switch to use modern name
  spi: spi-qcom-qspi: switch to use modern name
  spi: pxa2xx: switch to use modern name
  spi: ppc4xx: switch to use modern name
  spi: spl022: switch to use modern name
  ...
2023-08-29 09:47:33 -07:00
Jinjie Ruan 60ea3db33f
spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230822124643.987079-1-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-22 13:51:35 +01:00
Mark Brown 1c351c236a
spi: switch to use modern name (part4)
Merge series from Yang Yingliang <yangyingliang@huawei.com>:

I'm trying to rename the legacy name to modern name used in SPI drivers,
this is part4 patchset.

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. Each patch compile test passed.
2023-08-22 00:06:26 +01:00
Yang Yingliang 557efcf4c6
spi: spi-sn-f-ospi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-24-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:39 +01:00
Yang Yingliang 8d9ae783fb
spi: sifive: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-23-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:38 +01:00
Yang Yingliang 0ec6a15091
spi: sh: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-22-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:37 +01:00
Yang Yingliang 91a940bb10
spi: sh-sci: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-21-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:36 +01:00
Yang Yingliang 1cb3ebc417
spi: sh-msiof: switch to use modern name
Change legacy name master/slave to modern name host/target.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-20-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:35 +01:00
Yang Yingliang 0c8e5afc87
spi: sh-hspi: switch to use modern name
Change legacy name master to modern name host.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-19-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:34 +01:00
Yang Yingliang 82a7792318
spi: sc18is602: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-18-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:33 +01:00
Yang Yingliang f4bc49eda2
spi: s3c64xx: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-17-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:32 +01:00
Yang Yingliang 6536da62e4
spi: rzv2m-csi: switch to use devm_spi_alloc_host()
Switch to use modern name function devm_spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-16-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:31 +01:00
Yang Yingliang 1405efe76f
spi: rspi: switch to use spi_alloc_host()
Switch to use modern name function spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230818093154.1183529-15-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:30 +01:00
Yang Yingliang 1a3ccff3bc
spi: rockchip: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Heiko Stuebner <heiko@sntech.e>
Link: https://lore.kernel.org/r/20230818093154.1183529-14-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:30 +01:00
Yang Yingliang 7d5db72519
spi: rockchip-sfc: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-13-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:29 +01:00
Yang Yingliang c84036243c
spi: realtek-rtl: switch to use devm_spi_alloc_host()
Switch to use modern name function devm_spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-12-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:28 +01:00
Yang Yingliang e6302d00d9
spi: rb4xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-11-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:27 +01:00
Yang Yingliang 597442ff4f
spi: qup: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-10-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:26 +01:00
Yang Yingliang 8d3ad99ad8
spi: spi-qcom-qspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-9-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:25 +01:00
Yang Yingliang 60ba4431c8
spi: pxa2xx: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-8-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:24 +01:00
Yang Yingliang 7134583057
spi: ppc4xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-7-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:23 +01:00
Yang Yingliang c97a43a546
spi: spl022: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-6-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:22 +01:00
Yang Yingliang 0273727c3b
spi: pic32: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-5-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:21 +01:00
Yang Yingliang cc64ab491b
spi: pic32-sqi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-4-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:20 +01:00
Yang Yingliang f9977bb164
spi: mchp-pci1xxxx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:19 +01:00
Yang Yingliang 08e6c5038f
spi: orion: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230818093154.1183529-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 14:29:18 +01:00
Zhang Zekun 246f74bb11
spi: bcm-qspi: Simplify logic by using devm_platform_ioremap_resource_byname()
platform_get_resource_byname() and devm_ioremap_resource() can be
replaced by devm_platform_ioremap_resource_byname(), which can
simplify the code logic a bit, No functional change here.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Link: https://lore.kernel.org/r/20230810131650.71916-1-zhangzekun11@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:10:56 +01:00
Srinivas Goud 627d05a41c
spi: spi-cadence: Fix data corruption issues in slave mode
Remove 10us delay in cdns_spi_process_fifo() (called from cdns_spi_irq())
to fix data corruption issue on Master side when this driver
configured in Slave mode, as Slave is failed to prepare the date
on time due to above delay.

Add 10us delay before processing the RX FIFO as TX empty doesn't
guarantee valid data in RX FIFO.

Signed-off-by: Srinivas Goud <srinivas.goud@amd.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1692610216-217644-1-git-send-email-srinivas.goud@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:09:57 +01:00
Leonard Göhrs 715dc9a1f0
spi: stm32: fix accidential revert to byte-sized transfer splitting
Commit 6f486556ab ("spi: stm32: renaming of spi_master into
spi_controller") included an accidential reverted of a change added in
commit 1e49291125 ("spi: stm32: split large transfers based on word
size instead of bytes").

This breaks large SPI transfers with word sizes > 8 bits, which are
e.g. common when driving MIPI DBI displays.

Fix this by using `spi_split_transfers_maxwords()` instead of
`spi_split_transfers_maxsize()`.

Fixes: 6f486556ab ("spi: stm32: renaming of spi_master into spi_controller")
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Link: https://lore.kernel.org/r/20230816145237.3159817-1-l.goehrs@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-21 13:09:56 +01:00
Mark Brown ab4724302f
Add cs42l43 PC focused SoundWire CODEC
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

This patch chain adds support for the Cirrus Logic cs42l43 PC focused
SoundWire CODEC.
2023-08-18 22:46:19 +01:00
Lucas Tanure ef75e76716
spi: cs42l43: Add SPI controller support
The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
(Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
for portable applications. It provides a high dynamic range, stereo
DAC for headphone output, two integrated Class D amplifiers for
loudspeakers, and two ADCs for wired headset microphone input or
stereo line input. PDM inputs are provided for digital microphones.

The SPI component incorporates a SPI controller interface for
communication with other peripheral components.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230804104602.395892-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-18 17:38:11 +01:00
Yang Yingliang 46f53bde6e
spi: rpc-if: switch to use devm_spi_alloc_host()
Switch to use modern name function devm_spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230816094013.1275068-15-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 12:58:08 +01:00
Yang Yingliang ecd02b6dee
spi: dw-mmio: keep old name same as documentation
The documentation has not use the new name(host/target),
so keep the comment words same as documentation used.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230816093938.1274806-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-16 12:58:07 +01:00
Alexander Danilenko 373c36bf79
spi: tegra114: Remove unnecessary NULL-pointer checks
cs_setup, cs_hold and cs_inactive points to fields of spi_device struct,
so there is no sense in checking them for NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 04e6bb0d6b ("spi: modify set_cs_timing parameter")
Signed-off-by: Alexander Danilenko <al.b.danilenko@gmail.com>
Link: https://lore.kernel.org/r/20230815092058.4083-1-al.b.danilenko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-15 19:55:00 +01:00
Mark Brown f5b19425cd
spi: switch to use modern name (part2)
Merge series from Yang Yingliang <yangyingliang@huawei.com>:

I'm trying to rename the legacy name to modern name used in SPI drivers,
this is part2 patchset.

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. All compile test passed.

Yang Yingliang (20):
  spi: amlogic-spifc-a1: switch to use devm_spi_alloc_host()
  spi: au1550: switch to use modern name
  spi: ep93xx: switch to use modern name
  spi: falcon: switch to use modern name
  spi: fsi: switch to use spi_alloc_host()
  spi: fsl-dspi: switch to use modern name
  spi: fsl-espi: switch to use modern name
  spi: fsl-lpspi: switch to use modern name
  spi: fsl-qspi: switch to use modern name
  spi: fsl-spi: switch to use modern name
  spi: gpio: switch to use modern name
  spi: gxp: switch to use modern name
  spi: bcmbca-hsspi: switch to use modern name
  spi: hisi-sfc-v3xx: switch to use modern name
  spi: img-spfi: switch to use modern name
  spi: imx: switch to use modern name
  spi: ingenic: switch to use devm_spi_alloc_host()
  spi: intel: switch to use modern name
  spi: jcore: switch to use modern name
  spi: lantiq: switch to use modern name

 drivers/spi/spi-amlogic-spifc-a1.c |   2 +-
 drivers/spi/spi-au1550.c           |  74 ++++++------
 drivers/spi/spi-bcmbca-hsspi.c     |  66 +++++------
 drivers/spi/spi-ep93xx.c           | 174 ++++++++++++++---------------
 drivers/spi/spi-falcon.c           |  34 +++---
 drivers/spi/spi-fsi.c              |   2 +-
 drivers/spi/spi-fsl-dspi.c         |  24 ++--
 drivers/spi/spi-fsl-espi.c         |  76 ++++++-------
 drivers/spi/spi-fsl-lpspi.c        |  54 ++++-----
 drivers/spi/spi-fsl-qspi.c         |  10 +-
 drivers/spi/spi-fsl-spi.c          |  76 ++++++-------
 drivers/spi/spi-gpio.c             |  72 ++++++------
 drivers/spi/spi-gxp.c              |   6 +-
 drivers/spi/spi-hisi-sfc-v3xx.c    |  18 +--
 drivers/spi/spi-img-spfi.c         | 118 +++++++++----------
 drivers/spi/spi-imx.c              | 114 +++++++++----------
 drivers/spi/spi-ingenic.c          |   2 +-
 drivers/spi/spi-intel.c            |  42 +++----
 drivers/spi/spi-jcore.c            |  44 ++++----
 drivers/spi/spi-lantiq-ssc.c       |  96 ++++++++--------
 20 files changed, 552 insertions(+), 552 deletions(-)

--
2.25.1
2023-08-14 22:09:42 +01:00
Krzysztof Kozlowski 675b8e35b5
spi: amd: fix Wvoid-pointer-to-enum-cast warning
'version' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  spi-amd.c:401:21: error: cast to smaller integer type 'enum amd_spi_versions' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810091247.70149-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:15 +01:00
Krzysztof Kozlowski 94d6cf7e72
spi: pxa2xx: fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  spi-pxa2xx.c:1347:10: error: cast to smaller integer type 'enum pxa_ssp_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810091247.70149-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:14 +01:00
Krzysztof Kozlowski 0f9440a646
spi: sc18is602: fix Wvoid-pointer-to-enum-cast warning
'id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  spi-sc18is602.c:269:12: error: cast to smaller integer type 'enum chips' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810091247.70149-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:13 +01:00
Yang Yingliang ea11a8bb79
spi: lantiq: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-21-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:06 +01:00
Yang Yingliang 810ee62dd8
spi: jcore: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-20-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:05 +01:00
Yang Yingliang 5fa0ade185
spi: intel: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-19-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:04 +01:00
Yang Yingliang 452edead18
spi: ingenic: switch to use devm_spi_alloc_host()
Switch to use modern name function devm_spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-18-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:03 +01:00
Yang Yingliang 756d5bf077
spi: imx: switch to use modern name
Change legacy name master/slave to modern name host/target.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-17-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:02 +01:00
Yang Yingliang d6e19216e8
spi: img-spfi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-16-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:01 +01:00
Yang Yingliang f64e6ee372
spi: hisi-sfc-v3xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-15-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:11:00 +01:00
Yang Yingliang 3dc6e684b4
spi: bcmbca-hsspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-14-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:59 +01:00
Yang Yingliang 6588d43ae8
spi: gxp: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-13-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:58 +01:00
Yang Yingliang 20becf43e8
spi: gpio: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-12-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:57 +01:00
Yang Yingliang d32382ca56
spi: fsl-spi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-11-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:56 +01:00
Yang Yingliang ec6a795296
spi: fsl-qspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-10-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:55 +01:00
Yang Yingliang 2e2af40b57
spi: fsl-lpspi: switch to use modern name
Change legacy name master/target to modern name host/target

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-9-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:54 +01:00
Yang Yingliang a87935899f
spi: fsl-espi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-8-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:54 +01:00
Yang Yingliang 6230d6cad1
spi: fsl-dspi: switch to use modern name
Change legacy name master/target to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-7-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:53 +01:00
Yang Yingliang d40f10d009
spi: fsi: switch to use spi_alloc_host()
Switch to use modern name function spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-6-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:52 +01:00
Yang Yingliang 45d9591105
spi: falcon: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-5-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:51 +01:00
Yang Yingliang 24e9b75c0c
spi: ep93xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-4-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:50 +01:00
Yang Yingliang 0c35cc597b
spi: au1550: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:49 +01:00
Yang Yingliang 40f78b74b6
spi: amlogic-spifc-a1: switch to use devm_spi_alloc_host()
Switch to use modern name function devm_spi_alloc_host().

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807124105.3429709-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14 13:10:48 +01:00
Christophe Leroy ddaec4e44d
spi: fsl-cpm: Properly define and use IO pointers
Sparse reports several issues with IO pointers.

Fix it by adding missing __iomem flags and using iowriteXXbe()
generic helpers instead of the powerpc specific out_beXX() ones.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307252052.7RqHxFZj-lkp@intel.com/
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/18a65dca9134f6fc35932408066d4a8284cbfa65.1691571190.git.christophe.leroy@csgroup.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-09 12:52:49 +01:00
Kunihiko Hayashi 2ca03ecc9c
spi: dw: Set default value if reg-io-width isn't specified
According to the dt-bindings, the default value of reg-io-width is 4.
However, the value becomes zero when reg-io-width isn't specified.

Should set the actual value to dws->reg_io_width, considering it
referenced.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20230807001621.196776-1-hayashi.kunihiko@socionext.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-08 13:59:26 +01:00
Mark Brown f9a798867b
spi: switch to use modern name
Merge series from Yang Yingliang <yangyingliang@huawei.com>:

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-07 21:59:25 +01:00
Zhu Wang 142c61a5fd
spi: omap2-mcspi: remove redundant dev_err_probe()
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 <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230801135442.255604-1-wangzhu9@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 18:37:55 +01:00
Rajeshwar R Shinde 4f5177458b
spi: spi-mpc52xx-psc: Fix an unsigned comparison that can never be negative
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 <coolrrsh@gmail.com>
Link: https://lore.kernel.org/r/20230807144942.30317-2-coolrrsh@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 18:37:54 +01:00
Yang Yingliang 1c75d749b5
spi: cadence-quadspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230807140717.3484180-11-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 18:37:53 +01:00
Ruan Jinjie 8102d64c04
spi: Do not check for 0 return after calling platform_get_irq()
It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> #
Link: https://lore.kernel.org/r/20230802093238.975906-1-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:40 +01:00
Ruan Jinjie 3182d49aad
spi: spi-zynq: Do not check for 0 return after calling platform_get_irq()
It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230802094357.981100-1-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:39 +01:00
Yang Yingliang 1f6c80a74c
spi: npcm-fiu: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-22-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:35 +01:00
Yang Yingliang 9f5890466e
spi: hisi-kunpeng: switch to use modern name
Change legacy name master to modern name host.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-21-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:34 +01:00
Yang Yingliang eefc6c5c24
spi: dw: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-20-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:33 +01:00
Yang Yingliang 5ab7a7e37d
spi: dln2: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-19-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:32 +01:00
Yang Yingliang ad5602ba31
spi: davinci: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-18-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:31 +01:00
Yang Yingliang cd9fdf5ae8
spi: coldfire-qspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-17-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:31 +01:00
Yang Yingliang 556aca5be0
spi: spi-cavium-thunderx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-16-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:30 +01:00
Yang Yingliang d2a44ae8d2
spi: octeon: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-15-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:29 +01:00
Yang Yingliang 1baba77b1f
spi: clps711x: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-14-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:28 +01:00
Yang Yingliang f75c04a991
spi: cadence: switch to use modern name
Change legacy name master/slave to modern name host/target or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-13-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:27 +01:00
Yang Yingliang ec7cfadff2
spi: cadence-xspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-12-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:26 +01:00
Yang Yingliang 5a59b9a107
spi: butterfly: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-10-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:25 +01:00
Yang Yingliang 1a9e76190f
spi: bcm63xx: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-9-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:24 +01:00
Yang Yingliang 2c40be6bc9
spi: bcm63xx-hsspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-8-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:23 +01:00
Yang Yingliang 901fcd0740
spi: bcm2835aux: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-7-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:22 +01:00
Yang Yingliang 00be843bc1
spi: bcm2835: switch to use modern name
Change legacy name master/slave to modern name host/target.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-6-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:21 +01:00
Yang Yingliang ec271c04ae
spi: bcm-qspi: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-5-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:20 +01:00
Yang Yingliang 9d5920b37a
spi: spi-axi-spi-engine: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-4-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:19 +01:00
Yang Yingliang 21ac58f591
spi: aspeed: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:18 +01:00
Yang Yingliang e9759d403b
spi: amd: switch to use modern name
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230728093221.3312026-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-07 14:38:18 +01:00
William Qiu 33f1ef6d4e
spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPI
Add JH7110's clock initialization code to the driver.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Link: https://lore.kernel.org/r/20230804020254.291239-3-william.qiu@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-04 13:29:50 +01:00
Li Zetao de5e92cb5c
spi: mpc5xxx-psc: Fix unsigned expression compared with zero
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: 208ee586f8 ("spi: mpc5xxx-psc: Return immediately if IRQ resource is unavailable")
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230803134805.1037251-1-lizetao1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-03 17:07:09 +01:00
Zhu Wang d8736266ae
spi: fsl-spi: Do not check 0 for platform_get_irq()
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 <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230803083944.21501-1-wangzhu9@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-03 12:29:17 +01:00
Mark Brown 3dcce5b3ff
spi-geni-qcom: Add SPI device mode support for GENI
Merge series from Praveen Talari <quic_ptalari@quicinc.com>:

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-31 21:08:15 +01:00
Yinbo Zhu 6c7a864007
spi: loongson: add bus driver for the loongson spi controller
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 <zhuyinbo@loongson.cn>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230613075834.5219-3-zhuyinbo@loongson.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 15:57:09 +01:00
Praveen Talari d7f74cc31a
spi: spi-geni-qcom: Add SPI Device mode support for GENI based QuPv3
Currently spi geni driver supports only master mode operation.

Add spi device mode support to GENI based QuPv3.

Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
Reviewed-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Link: https://lore.kernel.org/r/20230714042203.14251-3-quic_ptalari@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 15:57:04 +01:00
Wang Ming 893aa09ee5
spi: Use dev_err_probe instead of dev_err
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 <machel@vivo.com>
Link: https://lore.kernel.org/r/20230726105457.3743-1-machel@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-31 12:44:57 +01:00
Mark Brown 4ee0feccf2 Linux 6.5-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmTGxtMeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGy2kH/RUepcJdCEQT2XGz
 NnHQ7NMKNnkcGLZq0yIgxHnGtu0KWSjb+LxBtd1un0nuVuSnSgGesJFH/B4uY2hq
 veXHMlyfCPCKLvYziOegMoUBiLR3d7K6urP9XAhAKX5gz9zn3ciZ13W7N9Qdf3Qx
 2t0kdT7guv5Ki5u7o+Pylzsbz9wKgIngY1ncfPqWQOaS/McZ58keAjU0z/mVaFQ4
 Wanc18dzawpceybqXb6qgCg+khZl6we2Mkl872ANYwAzvOzlVmrenWzM+7jBQvHw
 DD82KXTwq4lcf1xp7fTKrWdXOTcfyREmXu+Nuazqu5KkcQ9aY7GMi9O5JtjR1PaQ
 EXCNR3w=
 =0UH2
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmTG5okACgkQJNaLcl1U
 h9AAfQf8DZLl1x691tw/9u0M8gXnnWFzyBHPBTiCXzJI6903DPUWMJHCOeRMwhqQ
 sAJYNjZGF7s4n5Csgse4iSlPREnI/DdOG/td8XeJ4JL3KXCf1kfzF8DTsl2iRCvE
 uRcl7tLcdiwtETgToNJK23BlHH+2uTsX6WT+t0pH3/vKSNzARm2slTVKKdePOPps
 RRbyoswRA+SdzD+fplyHVSPY3j48BkUG6z67cuU2Cd/Mtq1GG5/wSGf1frVSzVRS
 AgTwkpueS48/Zkw6i67rskx6h8rRA8v3eUTL9pCwceIebr31fu1SSwUc0R9n/Vu7
 6WtAIATOf1Ityi8WXG260xCAWy597Q==
 =pueu
 -----END PGP SIGNATURE-----

spi: Merge up fixes from Linus' tree

Gets us pine64plus back if nothing else.
2023-07-30 23:38:59 +01:00
Chen Jiahao 71ee2a4f95
spi: microchip-core: Clean up redundant dev_err_probe()
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 <chenjiahao16@huawei.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230728075729.3451867-1-chenjiahao16@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-28 15:06:14 +01:00
Chen Jiahao b2b5617570
spi: s3c64xx: Clean up redundant dev_err_probe()
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 <chenjiahao16@huawei.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20230727131635.2898051-1-chenjiahao16@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-27 17:33:05 +01:00
Ruan Jinjie b505e2ecf3
spi: stm32: Remove redundant dev_err_probe()
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 <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230727110558.2904084-1-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-27 13:06:37 +01:00
Zhang Shurong 29a449e765
spi: tegra20-sflash: fix to check return value of platform_get_irq() in 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: 8528547bcc ("spi: tegra: add spi driver for sflash controller")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_71FC162D589E4788C2152AAC84CD8D5C6D06@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-26 16:30:19 +01:00
Douglas Anderson cc71c42b3d
spi: spi-qcom-qspi: Add mem_ops to avoid PIO for badly sized reads
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: b5762d9560 ("spi: spi-qcom-qspi: Add DMA mode support")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Link: https://lore.kernel.org/r/20230725110226.2.Id4a39804e01e4a06dae9b73fd2a5194c4c7ea453@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-26 12:47:20 +01:00
Douglas Anderson 138d73b627
spi: spi-qcom-qspi: Fallback to PIO for xfers that aren't multiples of 4 bytes
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: b5762d9560 ("spi: spi-qcom-qspi: Add DMA mode support")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230725110226.1.Ia2f980fc7cd0b831e633391f0bb1272914d8f381@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-26 12:47:19 +01:00
Vijaya Krishna Nivarthi 916a4edf3d
spi: spi-qcom-qspi: Add DMA_CHAIN_DONE to ALL_IRQS
Add latest added DMA_CHAIN_DONE irq to QSPI_ALL_IRQS that encompasses all
of the qspi IRQs.

Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1690285689-30233-5-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-25 19:11:56 +01:00
Vijaya Krishna Nivarthi cfb81f2243
spi: spi-qcom-qspi: Call dma_wmb() after setting up descriptors
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 <quic_vnivarth@quicinc.com>
Fixes: b5762d9560 ("spi: spi-qcom-qspi: Add DMA mode support")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1690285689-30233-4-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-25 19:11:55 +01:00
Vijaya Krishna Nivarthi f7ba36d399
spi: spi-qcom-qspi: Use GFP_ATOMIC flag while allocating for descriptor
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 <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/abc223e8-44af-40bb-a0bd-9865b393f435@moroto.mountain/
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Fixes: b5762d9560 ("spi: spi-qcom-qspi: Add DMA mode support")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1690285689-30233-3-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-25 19:11:54 +01:00
Vijaya Krishna Nivarthi 17aaf9ea07
spi: spi-qcom-qspi: Ignore disabled interrupts' status in isr
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 <dianders@chromium.org>
Signed-off-by: Vijaya Krishna Nivarthi <quic_vnivarth@quicinc.com>
Fixes: b5762d9560 ("spi: spi-qcom-qspi: Add DMA mode support")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1690285689-30233-2-git-send-email-quic_vnivarth@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-25 19:11:53 +01:00
YueHaibing 7ad1c439fb
spi: fsl: Remove unused extern declarations
commit b36ece8325 ("spi/mpc8xxx: refactor the common code for SPI/eSPI controller")
left mpc8xxx_spi_bufs() behind.
And since commit 3c5395b66f ("spi: fsl-(e)spi: simplify cleanup code")
mpc8xxx_spi_remove() is not used anymore.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20230725135411.21152-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-25 17:40:28 +01:00
Minjie Du 908e5a3d4e
spi: fsl-dspi: Use dev_err_probe() in dspi_request_dma()
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 <duminjie@vivo.com>
Link: https://lore.kernel.org/r/20230725035038.1702-1-duminjie@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-25 12:14:30 +01:00
Mark Brown 0b201982fe Linux 6.5-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmS9qIoeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGH6EH/2EnB8lLGOl8QINL
 E8eTWj6e7hdXXEX42j5h+TeGZZgBbTwogzE08uHBOP7lO0h31GVa97D5xkjS8UIa
 CzjYcnAuvf36nexakdC/0T8WgGzWwzKo0MIVraPBbq/pPRyrJ0CXPzB0Sl4Z2XlL
 W3N12a1N655FRx/tjaXgUB+aMPGrdBA2t0k6eXwFWyBdQhmt7O8Y3xy0rTVA+qHZ
 F6D4fZI2Ej9WbxX+tBs+DLEk+ZUz+0fABUqvgJRNofjgm71CpGhbv4ZGUFQaJT+I
 5S7cu3R8pS2YLP8TA3kJSj5GUEwPEDEZpxMIJAqkr5uvkNysGi55lYRxxULUw/sO
 EYHRBJE=
 =c8SQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmS9qsoACgkQJNaLcl1U
 h9AgVQf/QABRhGbSHHC5Ghd5QXJlKTZqbems6QJFXX2yPvPtVwV7S1XmS/5IH49E
 RRQAeEfAK2MByqQ25999Kai0MF7ZXagOaNq/CanvuxgU72uD+iY8khNtuEf4ohSj
 w61uqWcwm/unNGkSI7dF7qaY5HANOoOWBVeEVAKnwFRDuuGIg6X/S79+J3aRZ3wy
 N634ApEQJzB/hQgXgiJeLKOWNkD+rf2xQdTNGGQV1bqaRndgdm9eRZ4rxoOucx9F
 W4/z1gxWBCuIKbZm86/XDxAH7emdzwuPl/H/bhlsrAZgj23RSnuGkLg1VR9F/O25
 eKPqTUVmd/WbzWs6m6ov26XSh+KDeQ==
 =u4QW
 -----END PGP SIGNATURE-----

spi: Merge up fixes from mainline

There's several things here that will really help my CI.
2023-07-23 23:33:41 +01:00
Yuanjun Gong a90a987ebe
spi: use devm_clk_get_enabled() in mcfqspi_probe()
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 <ruc_gongyuanjun@163.com>
Link: https://lore.kernel.org/r/20230720140909.34084-1-ruc_gongyuanjun@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-20 15:29:11 +01:00
Yuanjun Gong 1e7dae6851
spi: fix return value check in bcm2835_spi_probe()
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 <ruc_gongyuanjun@163.com>
Link: https://lore.kernel.org/r/20230720140859.33883-1-ruc_gongyuanjun@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-20 15:29:10 +01:00
Fabrizio Castro c5a7b66811
spi: rzv2m-csi: Make use of device_set_node
Use device_set_node instead of assigning controller->dev.of_node
directly because it also sets the firmware node.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230718192453.543549-5-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-19 14:33:34 +01:00
Fabrizio Castro 7b63568fce
spi: rzv2m-csi: Get rid of the x_trg{_words} tables
Table x_trg can be replaced with ilog2(), and table x_trg_words
can be replaced with rounddown_pow_of_two().
Replace the tables usage with the corresponding macros.
While at it, remove a couple of unnecessary empty lines.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230718192453.543549-4-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-19 14:33:33 +01:00
Fabrizio Castro 8dc4038a02
spi: rzv2m-csi: Improve data types, casting and alignment
"unsigned int" is more appropriate than "int" for the members
of "struct rzv2m_csi_priv".
Using void* rather than u8* for txbuf and rxbuf allows for
the removal of some type casting.
Remove the unnecessary casting of "data" to "struct rzv2m_csi_priv*"
in function "rzv2m_csi_irq_handler".
Also, members "bytes_per_word" and "errors" introduce gaps
in the structure.
Adjust "struct rzv2m_csi_priv" and its members usage accordingly.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230718192453.543549-3-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-19 14:33:32 +01:00
Fabrizio Castro d5737d1277
spi: rzv2m-csi: Squash timing settings into one statement
Register CLKSEL hosts the configuration for both clock polarity
and data phase, and both values can be set in one write operation.

Squash the clock polarity and data phase register writes into
one statement, for efficiency.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230718192453.543549-2-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-19 14:33:31 +01:00
Mark Brown 35057870b1
spi: rzv2m-csi: Code refactoring
Merge series from Fabrizio Castro <fabrizio.castro.jz@renesas.com>:

This series is to follow up on Geert and Andy feedback:
https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230622113341.657842-4-fabrizio.castro.jz@renesas.com/
2023-07-18 19:45:14 +01:00
Alexander Stein f46b06e62c
spi: spi-fsl-lpspi: Read chip-select amount from hardware for i.MX93
PARAM.PCSNUM register on i.MX93 indicates the number of supported
(hw) chip-selects. LPSPI4 has 3 while others have only 2.
Still allow overwriting from DT.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20230717085934.409476-3-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-18 12:47:56 +01:00
Alexander Stein dfc07ee62c
spi: spi-fsl-lpspi: Move controller initialization further down
This is a preparation for reading number of chip-selects from hardware.
This needs IO resources mapped and peripheral clocking enabled.
No functional changes intended.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20230717085934.409476-2-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-18 12:47:55 +01:00
Fabrizio Castro 9f5ac59980
spi: rzv2m-csi: Replace unnecessary ternary operators
The ternary operators used to initialize tx_completed and rx_completed
are not necessary, replace them with a better implementation.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230715010407.1751715-6-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 12:41:44 +01:00
Fabrizio Castro 2ed2699f58
spi: rzv2m-csi: Leave readl_poll_timeout calls for last
Both rzv2m_csi_sw_reset and rzv2m_csi_start_stop_operation
call into readl_poll_timeout upon a certain condition, and
return 0 otherwise.
Flip the logic to improve readability.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230715010407.1751715-5-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 12:41:43 +01:00
Fabrizio Castro aecf9fbdb7
spi: rzv2m-csi: Rework CSI_CKS_MAX definition
Clock "csiclk" gets divided by 2 * CSI_CLKSEL_CKS in order to generate
the serial clock (output from master), with CSI_CLKSEL_CKS ranging from
0x1 (that means "csiclk" is divided by 2) to 0x3FFF ("csiclk" is divided
by 32766). CSI_CKS_MAX is used for referring to the setting
corresponding to the maximum frequency divider.
Value 0x3FFF for CSI_CKS_MAX doesn't really means much to the reader
without an explanation and a more readable definition.

Add a comment with a meaningful description and also replace value
0x3FFF with the corresponding GENMASK, to make it very clear what the
macro means.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230715010407.1751715-4-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 12:41:42 +01:00
Fabrizio Castro 74e27ce8d2
spi: rzv2m-csi: Adopt HZ_PER_MHZ for max spi clock
Make use of HZ_PER_MHZ for CSI_MAX_SPI_SCKO to make it clear
what its value means.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230715010407.1751715-3-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 12:41:41 +01:00
Fabrizio Castro f572ba797c
spi: rzv2m-csi: Add missing include
Add missing include of bits.h file.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230715010407.1751715-2-fabrizio.castro.jz@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 12:41:40 +01:00
Alexander Stein a55265eeed
spi: spi-fsl-lpspi: Remove num_cs from device struct
This is only used during probe() call, so there is no need to store it
longer than that.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20230705090145.1354663-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 06:16:07 +01:00
Linus Torvalds 831fe284d8 spi: Fixes for v6.5
A couple of fairly minor driver specific fixes here, plus a bunch of
 maintainership and admin updates.  Nothing too remarkable.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSyiH8ACgkQJNaLcl1U
 h9AONwf9F4qxceaYLgOcCvY+kqamIXLaX7RMuBlVxaNSowBQdK0V0TMnyJ0SKhKN
 pN2lTRJBg9uHka5UoUNDnwbLPdhrGymSAMZRwytxztC+n1SCi+ic3R4YRhBG7Aql
 n8kxZqzzg0hWrV0eVD1tTMx2fhab6/qfyAsBVyup6VpwfLyHyQ1bB/74m9F21GZL
 2TK3PdElAF4pj1ug6c1LiMqgP41dxuh/oKFUTL2FSt8apIIrw66F3GNb/ANoqd/d
 40oNMsgSYEgkUZJqGha6pS/zrLdT1/+zJ7jayy9odSTqRR6/1e+FoPz6wthZb0XC
 iCMthULffLhmy4dIHBZhIbU29J15Pg==
 =9Sbr
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A couple of fairly minor driver specific fixes here, plus a bunch of
  maintainership and admin updates. Nothing too remarkable"

* tag 'spi-fix-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  mailmap: add entry for Jonas Gorski
  MAINTAINERS: add myself for spi-bcm63xx
  spi: s3c64xx: clear loopback bit after loopback test
  spi: bcm63xx: fix max prepend length
  MAINTAINERS: Add myself as a maintainer for Microchip SPI
2023-07-15 08:51:02 -07:00
Rob Herring 749396cb29
spi: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174955.4064174-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14 20:53:00 +01:00
Andy Shevchenko 169f5312dc
spi: Use BITS_TO_BYTES()
BITS_TO_BYTES() is the existing macro which takes care about full
bytes that may fully hold the given amount of bits. Use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230714091748.89681-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14 14:44:38 +01:00
Andy Shevchenko 7b5c6a545b
spi: Kill spi_add_device_locked()
Now, spi_add_device_locked() has just a line on top of __spi_add_device().
Besides that, it has a single caller. So, just kill it and embed its parts
into the caller.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230714091748.89681-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14 14:44:37 +01:00
Andy Shevchenko 36124dea16
spi: Remove code duplication in spi_add_device*()
The commit 0c79378c01 ("spi: add ancillary device support")
added a dozen of duplicating lines of code. We may move them
to the __spi_add_device(). Note, that the code may be called
under the mutex.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20230714091748.89681-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14 14:44:36 +01:00
Yangtao Li 3b38cabd5e
spi: spi-cadence: Delete unmatched comments
The function no longer returns a value, synchronize the comments.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230712064832.67091-1-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-12 13:11:16 +01:00
Jaewon Kim 9ec3c5517e
spi: s3c64xx: clear loopback bit after loopback test
When SPI loopback transfer is performed, S3C64XX_SPI_MODE_SELF_LOOPBACK
bit still remained. It works as loopback even if the next transfer is
not spi loopback mode.
If not SPI_LOOP, needs to clear S3C64XX_SPI_MODE_SELF_LOOPBACK bit.

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Fixes: ffb7bcd3b2 ("spi: s3c64xx: support loopback mode")
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Link: https://lore.kernel.org/r/20230711082020.138165-1-jaewon02.kim@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-12 13:11:06 +01:00
Mark Brown 64a7b0e081
spi: Header and core clean up and refactoring
Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>:

Various cleanups and refactorings of the SPI header and core parts
united in a single series. It also touches drivers under SPI subsystem
folder on the pure renaming purposes of some constants.

No functional change intended.
2023-07-12 12:44:34 +01:00
Mark Brown 0f51622628
Allwinner R329/D1/R528/T113s Dual/Quad SPI modes
Merge series from Maksim Kiselev <bigunclemax@gmail.com>:

This series extends the previous https://lore.kernel.org/all/20230510081121.3463710-1-bigunclemax@gmail.com
And adds support for Dual and Quad SPI modes for the listed SoCs.
Both modes have been tested on the T113s and should work on
other Allwinner's SoCs that have a similar SPI conttoller.
It may also work for previous SoCs that support Dual/Quad modes.
One of them are H6 and H616.
2023-07-12 12:43:48 +01:00
Mark Brown 1dc8ca7181
spi: amlogic-spifc-a1: fixes and improvements for
Merge series from Martin Kurbanov <mmkurbanov@sberdevices.ru>:

This series adds support for max_speed_hz and implement adjust_op_size()
callback.
2023-07-12 12:43:41 +01:00
Andy Shevchenko 702ca0269e
spi: Fix spelling typos and acronyms capitalization
Fix
  - spelling typos
  - capitalization of acronyms
in the comments.

While at it, fix the multi-line comment style.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-16-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-11 14:14:32 +01:00
Andy Shevchenko 7a2b552c8e
spi: Convert to SPI_CONTROLLER_HALF_DUPLEX
Convert the users under SPI subsystem to SPI_CONTROLLER_HALF_DUPLEX.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-15-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-11 14:14:31 +01:00
Andy Shevchenko 82238d2cbd
spi: Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS
Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS and
convert the users to SPI_CONTROLLER_GPIO_SS to follow
the new naming shema.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-14-andriy.shevchenko@linux.intel.com
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-11 14:12:56 +01:00
Andy Shevchenko 90366cd601
spi: Get rid of old SPI_MASTER_MUST_TX & SPI_MASTER_MUST_RX
Convert the users from SPI_MASTER_MUST_TX and/or SPI_MASTER_MUST_RX
to SPI_CONTROLLER_MUST_TX and/or SPI_CONTROLLER_MUST_RX respectively
and kill the not used anymore definitions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-13-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-11 13:41:25 +01:00
Andy Shevchenko c397f09e54
spi: Get rid of old SPI_MASTER_NO_TX & SPI_MASTER_NO_RX
Convert the users from SPI_MASTER_NO_TX and/or SPI_MASTER_NO_RX
to SPI_CONTROLLER_NO_TX and/or SPI_CONTROLLER_NO_RX respectively
and kill the not used anymore definitions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-12-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-11 13:41:20 +01:00
Andy Shevchenko edf6a864c9
spi: Sort headers alphabetically
Sorting headers alphabetically helps locating duplicates, and
make it easier to figure out where to insert new headers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10 18:27:46 +01:00
Andy Shevchenko f2daa4667f
spi: Use sysfs_emit() to instead of s*printf()
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10 18:27:45 +01:00
Andy Shevchenko 2b308e7176
spi: Replace if-else-if by bitops and multiplications
Instead of if-else-if, simply call roundup_pow_of_two(BITS_PER_BYTES()).
Note, there is no division assumed as compiler may optimize it away.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10 18:27:44 +01:00
Andy Shevchenko 440c47331b
spi: Drop duplicate IDR allocation code in spi_register_controller()
Refactor spi_register_controller() to drop duplicate IDR allocation.
Instead of if-else-if branching use two sequential if:s, which allows
to re-use the logic of IDR allocation in all cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10 18:27:43 +01:00
Andy Shevchenko fbab5b2c09
spi: Remove unneeded OF node NULL checks
In the couple of places the NULL check of OF node is implied by the call
that takes it as a parameter. Drop the respective duplicate checks.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10 18:27:42 +01:00
Jonas Gorski 5158814cbb
spi: bcm63xx: fix max prepend length
The command word is defined as following:

    /* Command */
    #define SPI_CMD_COMMAND_SHIFT           0
    #define SPI_CMD_DEVICE_ID_SHIFT         4
    #define SPI_CMD_PREPEND_BYTE_CNT_SHIFT  8
    #define SPI_CMD_ONE_BYTE_SHIFT          11
    #define SPI_CMD_ONE_WIRE_SHIFT          12

If the prepend byte count field starts at bit 8, and the next defined
bit is SPI_CMD_ONE_BYTE at bit 11, it can be at most 3 bits wide, and
thus the max value is 7, not 15.

Fixes: b17de07606 ("spi/bcm63xx: work around inability to keep CS up")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Link: https://lore.kernel.org/r/20230629071453.62024-1-jonas.gorski@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-10 10:01:27 +01:00
Yangtao Li 4f81b540cc
spi: s3c64xx: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-7-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:41 +01:00
Yangtao Li 2e4ed25779
spi: tegra20-slink: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230706032727.9180-6-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:40 +01:00
Yangtao Li b778d96797
spi: rspi: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-5-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:40 +01:00
Yangtao Li 8c8e947b6b
spi: spi-nxp-fspi: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname()
Use devm_platform_ioremap_resource() and
devm_platform_ioremap_resource_byname() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/r/20230706032727.9180-4-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:39 +01:00
Yangtao Li cb8ea3dd55
spi: ep93xx: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-3-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:38 +01:00
Yangtao Li 2ae3c98b6e
spi: davinci: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-2-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:37 +01:00
Yangtao Li 616a733cca
spi: atmel: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706032727.9180-1-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:36 +01:00
Uwe Kleine-König 9303331461
spi: rzv2m-csi: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230707071119.3394198-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:35 +01:00
Stefan Moring 15a6af94a2
spi: Increase imx51 ecspi burst length based on transfer length
IMX51 supports 4096 bit burst lengths. Using the spi transfer length
instead of bits_per_word increases performance significantly.

Signed-off-by: Stefan Moring <stefan.moring@technolution.nl>
Link: https://lore.kernel.org/r/20230628125406.237949-1-stefan.moring@technolution.nl
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:34 +01:00
Valentin Caron fee681646f
spi: stm32: disable device mode with st,stm32f4-spi compatible
STM32 SPI driver is not capable to handle device mode with stm32f4 soc.
Stop probing if this case happens.

Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20230706081342.468090-1-valentin.caron@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:33 +01:00
Martin Kurbanov 8d4d4c6813
spi: amlogic-spifc-a1: add support for max_speed_hz
This patch sets the clock rate (spi_transfer->max_speed_hz) from the
amlogic_spifc_a1_exec_op().

Signed-off-by: Martin Kurbanov <mmkurbanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230706110331.19794-3-mmkurbanov@sberdevices.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:31 +01:00
Martin Kurbanov 68a199640d
spi: amlogic-spifc-a1: implement adjust_op_size()
This enhancement eliminates the need for a loop in the
amlogic_spifc_a1_exec_op() function and allows the SPI core to
dynamically divide transactions into appropriately sized chunks.

Signed-off-by: Martin Kurbanov <mmkurbanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230706110331.19794-2-mmkurbanov@sberdevices.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:30 +01:00
Maksim Kiselev 25453d797d
spi: sun6i: add dual and quad SPI modes support for R329/D1/R528/T113s
Listed SoCs have SPI controllers that can operate in dual or quad modes.
This patch adds dual/quad mode bits for spi_master on these SoCS.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
Link: https://lore.kernel.org/r/20230624131632.2972546-3-bigunclemax@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:27 +01:00
Maksim Kiselev 0605d9fb41
spi: sun6i: add quirk for dual and quad SPI modes support
New Allwinner's SPI controllers can support dual and quad SPI modes.
To enable one of these modes, we should set the corresponding bit in
the SUN6I_BURST_CTL_CNT_REG register. DRM (28 bits) for dual mode and
Quad_EN (29 bits) for quad transmission.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
Link: https://lore.kernel.org/r/20230624131632.2972546-2-bigunclemax@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:51:26 +01:00
Linus Torvalds 1793eac148 spi: Fixes for v6.5
A few mostly minor fixes that came in during the merge window, plus one
 administrative update for Jonas' e-mail address.  The spi-geni-qcom fix
 is more major than the others, fixing the newly added DMA support for
 large reads which trigger DMA.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSmv8AACgkQJNaLcl1U
 h9C8BQf8CHq8UMV0vJReqkaDwW80n1grCi3MQev8He9mzqAad8lNq8crx9OyCb6F
 7YgtItOWDxHn/Hh7W7ASRKReIayVQwxhwHk2Iim1ISA7FiHkaAr8qyov4YWnRaMs
 taQhnYUTCpADeVT7FdZj6qnQjPn85i4fUy8UIrVt8nH1Ba3Zyv3i4yuj6ruigrAK
 T9jyCjeCyx772+yxwVfDQ+1ozOaLwo4aRdqtC10f0tDpPTob1027/8uGjjeUFxVR
 8troqEN2njkwgMX76imA/1PfTS6skhOB0e7H53BhNOGP/U8l28HuaCgxib9tRzhv
 8uG6qG4+55Hvoz4CjijO/wQqhmfBDg==
 =9ewC
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v6.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few mostly minor fixes that came in during the merge window, plus
  one administrative update for Jonas' e-mail address.

  The spi-geni-qcom fix is more major than the others, fixing the newly
  added DMA support for large reads which trigger DMA"

* tag 'spi-fix-v6.5-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: bcm{63xx,bca}-hsspi: update my email address
  spi: rzv2m-csi: Fix SoC product name
  spi: bcm-qspi: return error if neither hif_mspi nor mspi is available
  spi: spi-geni-qcom: enable SPI_CONTROLLER_MUST_TX for GPI DMA mode
2023-07-06 19:24:11 -07:00
Jonas Gorski 879a879c21
spi: bcm{63xx,bca}-hsspi: update my email address
Update my email address to a working one, as the openwrt.org one is
broken since ages.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: William Zhang <william.zhang@broadcom.com>
Link: https://lore.kernel.org/r/20230630202257.8449-2-jonas.gorski@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-04 13:54:19 +01:00
Geert Uytterhoeven e1ef683c86
spi: rzv2m-csi: Fix SoC product name
The SoC product name is "RZ/V2M".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Link: https://lore.kernel.org/r/89e9870a2c510387e4d7a863025f4d3639d4a261.1688375020.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-03 13:04:53 +01:00
Jonas Gorski 7c1f23ad34
spi: bcm-qspi: return error if neither hif_mspi nor mspi is available
If neither a "hif_mspi" nor "mspi" resource is present, the driver will
just early exit in probe but still return success. Apart from not doing
anything meaningful, this would then also lead to a null pointer access
on removal, as platform_get_drvdata() would return NULL, which it would
then try to dereference when trying to unregister the spi master.

Fix this by unconditionally calling devm_ioremap_resource(), as it can
handle a NULL res and will then return a viable ERR_PTR() if we get one.

The "return 0;" was previously a "goto qspi_resource_err;" where then
ret was returned, but since ret was still initialized to 0 at this place
this was a valid conversion in 63c5395bb7 ("spi: bcm-qspi: Fix
use-after-free on unbind"). The issue was not introduced by this commit,
only made more obvious.

Fixes: fa236a7ef2 ("spi: bcm-qspi: Add Broadcom MSPI driver")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com>
Link: https://lore.kernel.org/r/20230629134306.95823-1-jonas.gorski@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 14:53:52 +01:00
Dmitry Baryshkov d10005837b
spi: spi-geni-qcom: enable SPI_CONTROLLER_MUST_TX for GPI DMA mode
The GPI DMA mode requires for TX DMA to be prepared. Force SPI core to
provide TX buffer even if the caller didn't provide one by setting the
SPI_CONTROLLER_MUST_TX flag.

Fixes: b59c122484 ("spi: spi-geni-qcom: Add support for GPI dma")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230629095847.3648597-1-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-29 11:33:48 +01:00
Linus Torvalds 84fccbba93 spi: Updates for v6.5
One small core feature this time around but mostly driver improvements
 and additions for SPI:
 
  - Add support for controlling the idle state of MOSI, some systems can
    support this and depending on the system integration may need it to
    avoid glitching in some situations.
  - Support for polling mode in the S3C64xx driver and DMA on the
    Qualcomm QSPI driver.
  - Support for several Allwinner SoCs, AMD Pensando Elba, Intel Mount
    Evans, Renesas RZ/V2M, and ST STM32H7.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSZkwMACgkQJNaLcl1U
 h9AOOAf+NNDaxD7ymIZ4t9RVegbC7aCS/kGWCEr2bunAfSQYI7UhduOK1U5q9mq3
 pZy3ZT0Rm+5gm1jg4WSgozM2Sn/OljTUyUFgWvxS9oF/EUSLiHpwvJAo01Y6dZsF
 ZNVCB5RuhXr++i0wgR5HSAaMd8XQAp9H2OEO4wYynFHm3zX1bMtnybZuI1AKJbKF
 fBAhKRpemSxklL+oQru1FudJEyglJcRDXYtESDPpAvU0aEdoPekdZbbS2f99SX7k
 s5jojrnwViIRSqMLqTIDu2sNUcuCn883GPzKOtU0hexE2Y+90q7gzjnustVN93w/
 uyVKsVSegb5poA1HMlK/fu2Pp3oolg==
 =SJMZ
 -----END PGP SIGNATURE-----

Merge tag 'spi-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "One small core feature this time around but mostly driver improvements
  and additions for SPI:

   - Add support for controlling the idle state of MOSI, some systems
     can support this and depending on the system integration may need
     it to avoid glitching in some situations

   - Support for polling mode in the S3C64xx driver and DMA on the
     Qualcomm QSPI driver

   - Support for several Allwinner SoCs, AMD Pensando Elba, Intel Mount
     Evans, Renesas RZ/V2M, and ST STM32H7"

* tag 'spi-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (66 commits)
  spi: dt-bindings: atmel,at91rm9200-spi: fix broken sam9x7 compatible
  spi: dt-bindings: atmel,at91rm9200-spi: add sam9x7 compatible
  spi: Add support for Renesas CSI
  spi: dt-bindings: Add bindings for RZ/V2M CSI
  spi: sun6i: Use the new helper to derive the xfer timeout value
  spi: atmel: Prevent false timeouts on long transfers
  spi: dt-bindings: stm32: do not disable spi-slave property for stm32f4-f7
  spi: Create a helper to derive adaptive timeouts
  spi: spi-geni-qcom: correctly handle -EPROBE_DEFER from dma_request_chan()
  spi: stm32: disable spi-slave property for stm32f4-f7
  spi: stm32: introduction of stm32h7 SPI device mode support
  spi: stm32: use dmaengine_terminate_{a}sync instead of _all
  spi: stm32: renaming of spi_master into spi_controller
  spi: dw: Remove misleading comment for Mount Evans SoC
  spi: dt-bindings: snps,dw-apb-ssi: Add compatible for Intel Mount Evans SoC
  spi: dw: Add compatible for Intel Mount Evans SoC
  spi: s3c64xx: Use dev_err_probe()
  spi: s3c64xx: Use the managed spi master allocation function
  spi: spl022: Probe defer is no error
  spi: spi-imx: fix mixing of native and gpio chipselects for imx51/imx53/imx6 variants
  ...
2023-06-28 13:48:42 -07:00
Linus Torvalds 362067b6d5 regulator: Updates for v6.5
This release is almost all drivers, there's some small improvements in
 the core but otherwise everything is updates to drivers, mostly the
 addition of new ones.
 
 There's also a bunch of changes pulled in from the MFD subsystem as
 dependencies, Rockchip and TI core MFD code that the regulator drivers
 depend on.
 
 I've also yet again managed to put a SPI commit in the regulator tree, I
 don't know what it is about those two trees (this for spi-geni-qcom).
 
  - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments
    TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSZkRUACgkQJNaLcl1U
 h9A0bAf+IM6F/vTF7R/2NTlR3M/Z7HGinxK1oit6LuZfKnveaRRCEWvBVoZzZpjs
 CzdWTPBWA2jyETzEqmX7gxYnxf2aaLieLEpKRZSh3uQd5OKmrizQDs5/OdaVUViK
 /ytmqd/IFgFfwaI+az38CQlTf+dDyuJDB0OwlkEkoaxWjeiAh6INBh6xO9aKczoW
 lFd0tOVQt1EcBKdB4tBJLTFIWWsG66xy9NZ018FrcA+bCmQVBvkbqcahayI5Q6Kw
 m5H7cZuFbKV51AlyYMF/C4Lwhy1mOT166eRmSrgxBXCsqhpFeHYkJQkmumNd3gkQ
 oSQPTZHqSblJA7Utw09mlT6r/xqL0Q==
 =/f85
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "This release is almost all drivers, there's some small improvements in
  the core but otherwise everything is updates to drivers, mostly the
  addition of new ones.

  There's also a bunch of changes pulled in from the MFD subsystem as
  dependencies, Rockchip and TI core MFD code that the regulator drivers
  depend on.

  I've also yet again managed to put a SPI commit in the regulator tree,
  I don't know what it is about those two trees (this for
  spi-geni-qcom).

  Summary:

   - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments
     TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a"

* tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (43 commits)
  regulator: Add Renesas PMIC RAA215300 driver
  regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
  regulator: ltc3676: Use maple tree register cache
  regulator: ltc3589: Use maple tree register cache
  regulator: helper: Document ramp_delay parameter of regulator_set_ramp_delay_regmap()
  regulator: mt6358: Use linear voltage helpers for single range regulators
  regulator: mt6358: Const-ify mt6358_regulator_info data structures
  regulator: mt6358: Drop *_SSHUB regulators
  regulator: mt6358: Merge VCN33_* regulators
  regulator: dt-bindings: mt6358: Drop *_sshub regulators
  regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators
  regulator: dt-bindings: pwm-regulator: Add missing type for "pwm-dutycycle-unit"
  regulator: Switch two more i2c drivers back to use .probe()
  spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead
  soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma()
  regulator: tps6594-regulator: Add driver for TI TPS6594 regulators
  regulator: axp20x: Add AXP15060 support
  regulator: axp20x: Add support for AXP313a variant
  dt-bindings: pfuze100.yaml: Add an entry for interrupts
  regulator: stm32-pwr: Fix regulator disabling
  ...
2023-06-28 13:32:47 -07:00
Linus Torvalds 6e17c6de3d - Yosry Ahmed brought back some cgroup v1 stats in OOM logs.
- Yosry has also eliminated cgroup's atomic rstat flushing.
 
 - Nhat Pham adds the new cachestat() syscall.  It provides userspace
   with the ability to query pagecache status - a similar concept to
   mincore() but more powerful and with improved usability.
 
 - Mel Gorman provides more optimizations for compaction, reducing the
   prevalence of page rescanning.
 
 - Lorenzo Stoakes has done some maintanance work on the get_user_pages()
   interface.
 
 - Liam Howlett continues with cleanups and maintenance work to the maple
   tree code.  Peng Zhang also does some work on maple tree.
 
 - Johannes Weiner has done some cleanup work on the compaction code.
 
 - David Hildenbrand has contributed additional selftests for
   get_user_pages().
 
 - Thomas Gleixner has contributed some maintenance and optimization work
   for the vmalloc code.
 
 - Baolin Wang has provided some compaction cleanups,
 
 - SeongJae Park continues maintenance work on the DAMON code.
 
 - Huang Ying has done some maintenance on the swap code's usage of
   device refcounting.
 
 - Christoph Hellwig has some cleanups for the filemap/directio code.
 
 - Ryan Roberts provides two patch series which yield some
   rationalization of the kernel's access to pte entries - use the provided
   APIs rather than open-coding accesses.
 
 - Lorenzo Stoakes has some fixes to the interaction between pagecache
   and directio access to file mappings.
 
 - John Hubbard has a series of fixes to the MM selftesting code.
 
 - ZhangPeng continues the folio conversion campaign.
 
 - Hugh Dickins has been working on the pagetable handling code, mainly
   with a view to reducing the load on the mmap_lock.
 
 - Catalin Marinas has reduced the arm64 kmalloc() minimum alignment from
   128 to 8.
 
 - Domenico Cerasuolo has improved the zswap reclaim mechanism by
   reorganizing the LRU management.
 
 - Matthew Wilcox provides some fixups to make gfs2 work better with the
   buffer_head code.
 
 - Vishal Moola also has done some folio conversion work.
 
 - Matthew Wilcox has removed the remnants of the pagevec code - their
   functionality is migrated over to struct folio_batch.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCZJejewAKCRDdBJ7gKXxA
 joggAPwKMfT9lvDBEUnJagY7dbDPky1cSYZdJKxxM2cApGa42gEA6Cl8HRAWqSOh
 J0qXCzqaaN8+BuEyLGDVPaXur9KirwY=
 =B7yQ
 -----END PGP SIGNATURE-----

Merge tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull mm updates from Andrew Morton:

 - Yosry Ahmed brought back some cgroup v1 stats in OOM logs

 - Yosry has also eliminated cgroup's atomic rstat flushing

 - Nhat Pham adds the new cachestat() syscall. It provides userspace
   with the ability to query pagecache status - a similar concept to
   mincore() but more powerful and with improved usability

 - Mel Gorman provides more optimizations for compaction, reducing the
   prevalence of page rescanning

 - Lorenzo Stoakes has done some maintanance work on the
   get_user_pages() interface

 - Liam Howlett continues with cleanups and maintenance work to the
   maple tree code. Peng Zhang also does some work on maple tree

 - Johannes Weiner has done some cleanup work on the compaction code

 - David Hildenbrand has contributed additional selftests for
   get_user_pages()

 - Thomas Gleixner has contributed some maintenance and optimization
   work for the vmalloc code

 - Baolin Wang has provided some compaction cleanups,

 - SeongJae Park continues maintenance work on the DAMON code

 - Huang Ying has done some maintenance on the swap code's usage of
   device refcounting

 - Christoph Hellwig has some cleanups for the filemap/directio code

 - Ryan Roberts provides two patch series which yield some
   rationalization of the kernel's access to pte entries - use the
   provided APIs rather than open-coding accesses

 - Lorenzo Stoakes has some fixes to the interaction between pagecache
   and directio access to file mappings

 - John Hubbard has a series of fixes to the MM selftesting code

 - ZhangPeng continues the folio conversion campaign

 - Hugh Dickins has been working on the pagetable handling code, mainly
   with a view to reducing the load on the mmap_lock

 - Catalin Marinas has reduced the arm64 kmalloc() minimum alignment
   from 128 to 8

 - Domenico Cerasuolo has improved the zswap reclaim mechanism by
   reorganizing the LRU management

 - Matthew Wilcox provides some fixups to make gfs2 work better with the
   buffer_head code

 - Vishal Moola also has done some folio conversion work

 - Matthew Wilcox has removed the remnants of the pagevec code - their
   functionality is migrated over to struct folio_batch

* tag 'mm-stable-2023-06-24-19-15' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (380 commits)
  mm/hugetlb: remove hugetlb_set_page_subpool()
  mm: nommu: correct the range of mmap_sem_read_lock in task_mem()
  hugetlb: revert use of page_cache_next_miss()
  Revert "page cache: fix page_cache_next/prev_miss off by one"
  mm/vmscan: fix root proactive reclaim unthrottling unbalanced node
  mm: memcg: rename and document global_reclaim()
  mm: kill [add|del]_page_to_lru_list()
  mm: compaction: convert to use a folio in isolate_migratepages_block()
  mm: zswap: fix double invalidate with exclusive loads
  mm: remove unnecessary pagevec includes
  mm: remove references to pagevec
  mm: rename invalidate_mapping_pagevec to mapping_try_invalidate
  mm: remove struct pagevec
  net: convert sunrpc from pagevec to folio_batch
  i915: convert i915_gpu_error to use a folio_batch
  pagevec: rename fbatch_count()
  mm: remove check_move_unevictable_pages()
  drm: convert drm_gem_put_pages() to use a folio_batch
  i915: convert shmem_sg_free_table() to use a folio_batch
  scatterlist: add sg_set_folio()
  ...
2023-06-28 10:28:11 -07:00