summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'spi-v6.11' of ↵Linus Torvalds2024-07-1653-703/+1256
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "There's some quite exciting core work in this release, we've got the beginnings of support for hardware initiated transfers which is itself independently useful for optimising fast paths in existing drivers. We also have a rework of the DMA mapping which allows finer grained decisions about DMA mapping messages and also helps remove some bodges that we'd had. Otherwise it's a fairly quiet release, a few new drivers and features for existing drivers, together with various cleanups and DT binding conversions. One regmap SPI fix made it's way in here too which I should probably have sent as a regmap fix instead. Summary: - Support for pre-optimising messages, reducing the overhead for messages that are repeatedly used (eg, reading the interrupt status from a device). This will also be used for hardware initiated transfers in future. - A reworking of how DMA mapping is done, introducing a new helper and allowing the DMA mapping decision to be done per transfer instead of per message. - Support for Atmel SAMA7D64, Freescale LX2160A DSPI and WCH CH341A" * tag 'spi-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (72 commits) spi: dt-bindings: at91: Add sama7d65 compatible string spi: add ch341a usb2spi driver spi: dt-bindings: fsl-dspi: add compatible string 'fsl,lx2160a-dspi' spi: dt-bindings: fsl-dspi: add dmas and dma-names properties spi: spi: Remove unnecessary ‘0’ values from status spi: spi: Remove unnecessary ‘0’ values from rc spi: xcomm: fix coding style spi: xcomm: remove i2c_set_clientdata() spi: xcomm: make use of devm_spi_alloc_host() spi: xcomm: add gpiochip support spi: dt-bindings: snps,dw-apb-ssi.yaml: update compatible property spi: dt-bindings: fsl-dspi: Convert to yaml format spi: fsl-dspi: use common proptery 'spi-cs-setup(hold)-delay-ns' spi: axi-spi-engine: remove platform_set_drvdata() spi: spi-fsl-lpspi: Pass pm_ptr() spi: spi-imx: Pass pm_ptr() spi: spi-fsl-lpspi: Switch to SYSTEM_SLEEP_PM_OPS() spi: spi-imx: Switch to RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() spi: add EXPORT_SYMBOL_GPL(devm_spi_optimize_message) spi: add devm_spi_optimize_message() helper ...
| * spi: dt-bindings: at91: Add sama7d65 compatible stringNicolas Ferre2024-07-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add compatible string for sama7d65. Like sam9x60 and sam9x7, it requires to bind to "atmel,at91rm9200-spi". Group these three under the same enum, sorted alphanumerically, and remove previously added item. Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240711165402.373634-1-nicolas.ferre@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: add ch341a usb2spi driverJohannes Thumshirn2024-07-083-0/+248
| | | | | | | | | | | | | | | | | | | | Add a driver for the QiHeng Electronics ch341a USB-to-SPI adapter. This driver is loosely based on the ch341a module from the flashrom project. Signed-off-by: Johannes Thumshirn <jth@kernel.org> Link: https://patch.msgid.link/20240708-spi-ch341a-v3-1-cf7f9b2c1e31@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: dt-bindings: fsl-dspi: add compatible string 'fsl,lx2160a-dspi'Frank Li2024-07-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Add compatible string 'fsl,lx2160a-dspi' and allow fall back to 'fsl,ls2085a-dspi'. Fix below CHECK_DTBS warning. arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dtb: spi@2100000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,lx2160a-dspi', 'fsl,ls2085a-dspi'] is too long Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20240703165931.2325807-2-Frank.Li@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: dt-bindings: fsl-dspi: add dmas and dma-names propertiesFrank Li2024-07-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Add dmas and dma-names properties because dspi support dma transfer. Fix below warnings: arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var1.dtb: spi@2120000: Unevaluated properties are not allowed ('dma-names', 'dmas', 'little-endian' were unexpected) from schema $id: http://devicetree.org/schemas/spi/fsl,dspi.yaml# Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/20240703165931.2325807-1-Frank.Li@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: spi: Remove unnecessary ‘0’ values from statusLi zeming2024-07-081-1/+1
| | | | | | | | | | | | | | | | status is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming <zeming@nfschina.com> Link: https://patch.msgid.link/20240708041411.14424-1-zeming@nfschina.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: spi: Remove unnecessary ‘0’ values from rcLi zeming2024-07-081-1/+1
| | | | | | | | | | | | | | | | rc is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming <zeming@nfschina.com> Link: https://patch.msgid.link/20240708035320.14241-1-zeming@nfschina.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: xcomm: fix coding styleNuno Sa2024-07-051-14/+14
| | | | | | | | | | | | | | | | | | | | Just cosmetics. No functional change intended. While at it, removed a couple of redundant else if() statements. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240705-dev-spi-xcomm-gpiochip-v2-4-b10842fc9636@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: xcomm: remove i2c_set_clientdata()Nuno Sa2024-07-051-1/+0
| | | | | | | | | | | | | | | | | | i2c_get_clientdata() is not being called anywhere so that we do not need to set clientdata. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240705-dev-spi-xcomm-gpiochip-v2-3-b10842fc9636@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: xcomm: make use of devm_spi_alloc_host()Nuno Sa2024-07-051-2/+2
| | | | | | | | | | | | | | | | | | Use devm_spi_alloc_host() so that there's no need to call spi_controller_put() in the error path. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240705-dev-spi-xcomm-gpiochip-v2-2-b10842fc9636@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: xcomm: add gpiochip supportMichael Hennerich2024-07-051-1/+41
| | | | | | | | | | | | | | | | | | | | | | The hardware can expose one pin as a GPO. Hence, register a simple gpiochip to support it. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Co-developed-by: Nuno Sa <nuno.sa@analog.com> Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240705-dev-spi-xcomm-gpiochip-v2-1-b10842fc9636@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: dt-bindings: snps,dw-apb-ssi.yaml: update compatible propertyKanak Shilledar2024-07-011-0/+4
| | | | | | | | | | | | | | | | | | | | updated compatible property to include "thead,th1520-spi" for the TH1520 SoC SPI Controller. Signed-off-by: Kanak Shilledar <kanakshilledar@gmail.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20240701121355.262259-3-kanakshilledar@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: dt-bindings: fsl-dspi: Convert to yaml formatFrank Li2024-07-015-66/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert dt-binding spi-fsl-dspi.txt to yaml format. Use part Vladimir Oltean's work at of https://lore.kernel.org/linux-spi/20221111224651.577729-1-vladimir.oltean@nxp.com/ Additional changes during convert: - compatible string "fsl,ls1028a-dspi" can be followed by fsl,ls1021a-v1.0-dspi. - Change "dspi0@4002c000" to "spi@4002c000" in example. - Reorder properties in example. - Use GIC include in example. - Deprecated fsl,spi-cs-sck-delay and fsl,spi-sck-cs-delay by use common SPI property. - Use compatible string 'jedec,spi-nor' in example. - Split peripheral part to fsl,dspi-peripheral-props.yaml. - Remove 'interrupts' and 'pinctrl' from required list. - Update 'bus-num' description. - Update 'spi-num-chipselects' description by add "cs-gpios don't count against this number". - Remove 'big-endian' description. Co-developed-by: Kuldeep Singh <kuldeep.singh@nxp.com> Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com> Co-developed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240624-ls_qspi-v4-2-3d1c6f5005bf@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: fsl-dspi: use common proptery 'spi-cs-setup(hold)-delay-ns'Frank Li2024-07-011-5/+14
| | | | | | | | | | | | | | | | | | | | | | Use SPI common DT binding properties 'spi-cs-setup-delay-ns' and 'spi-cs-hold-delay-ns'. If these properties do not exist, fall back to legacy 'fsl,spi-cs-sck-delay' and 'fsl,spi-sck-cs-delay'. Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/20240624-ls_qspi-v4-1-3d1c6f5005bf@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: axi-spi-engine: remove platform_set_drvdata()David Lechner2024-06-271-7/+1
| | | | | | | | | | | | | | | | | | | | | | platform_get_drvdata() is never called in the AXI SPI Engine driver, so platform_set_drvdata() is not needed. Remove it. This also lets us avoid the final error check in the probe function. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240626-spi-axi-spi-engine-remove-drvdata-v1-1-1752e372dd5d@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: spi-fsl-lpspi: Pass pm_ptr()Fabio Estevam2024-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | After coverting to SYSTEM_SLEEP_PM_OPS, it is necessary to pass pm_ptr() to the PM operations. Fix it accordingly. Fixes: 6765e859fac9 ("spi: spi-fsl-lpspi: Switch to SYSTEM_SLEEP_PM_OPS()") Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240625183919.368770-2-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: spi-imx: Pass pm_ptr()Fabio Estevam2024-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | After coverting to RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS, it is necessary to pass pm_ptr() to the PM operations. Fix it accordingly. Fixes: a93f089ccf82 ("spi: spi-imx: Switch to RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()") Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240625183919.368770-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: add devm_spi_optimize_message() helperMark Brown2024-06-251-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Merge series from David Lechner <dlechner@baylibre.com>: In the IIO subsystem, we are finding that it is common to call spi_optimize_message() during driver probe since the SPI message doesn't change for the lifetime of the driver. This patch adds a devm_spi_optimize_message() helper to simplify this common pattern.
| | * spi: add EXPORT_SYMBOL_GPL(devm_spi_optimize_message)David Lechner2024-06-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devm_spi_optimize_message() is a public function and needs EXPORT_SYMBOL_GPL. Reported-by: Jonathan Cameron <jic23@kernel.org> Closes: https://lore.kernel.org/linux-iio/20240624204424.6a91a5e4@jic23-huawei/ Fixes: d4a0055fdc22 ("spi: add devm_spi_optimize_message() helper") Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240624-devm_spi_optimize_message-v2-1-58155c0180c2@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: spi-fsl-lpspi: Switch to SYSTEM_SLEEP_PM_OPS()Fabio Estevam2024-06-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240625002023.228235-2-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: spi-imx: Switch to RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()Fabio Estevam2024-06-251-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://patch.msgid.link/20240625002023.228235-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: add devm_spi_optimize_message() helperMark Brown2024-06-23575-3282/+5887
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Merge series from David Lechner <dlechner@baylibre.com>: In the IIO subsystem, we are finding that it is common to call spi_optimize_message() during driver probe since the SPI message doesn't change for the lifetime of the driver. This patch adds a devm_spi_optimize_message() helper to simplify this common pattern.
| | * spi: add devm_spi_optimize_message() helperDavid Lechner2024-06-223-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new helper function devm_spi_optimize_message() that automatically registers spi_unoptimize_message() to be called when the device is removed. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-devm_spi_optimize_message-v1-2-3f9dcba6e95e@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * Documentation: devres: add missing SPI helpersDavid Lechner2024-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | A few SPI devm_* helpers were missing from the devres documentation. This patch adds them. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-devm_spi_optimize_message-v1-1-3f9dcba6e95e@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: imx: Don't expect DMA for i.MX{25,35,50,51,53} cspi devicesUwe Kleine-König2024-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While in commit 2dd33f9cec90 ("spi: imx: support DMA for imx35") it was claimed that DMA works on i.MX25, i.MX31 and i.MX35 the respective device trees don't add DMA channels. The Reference manuals of i.MX31 and i.MX25 also don't mention the CSPI core being DMA capable. (I didn't check the others.) Since commit e267a5b3ec59 ("spi: spi-imx: Use dev_err_probe for failed DMA channel requests") this results in an error message spi_imx 43fa4000.spi: error -ENODEV: can't get the TX DMA channel! during boot. However that isn't fatal and the driver gets loaded just fine, just without using DMA. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://patch.msgid.link/20240508095610.2146640-2-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: cs42l43: Add speaker id support to the bridge configurationSimon Trimmer2024-06-201-21/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OEMs can connect a number of types of speakers to the sidecar cs35l56 amplifiers and a different speaker requires a different firmware configuration. When the cs42l43 ACPI includes a property indicating a particular type of speaker has been installed this should be passed to the cs35l56 driver instances as a device property. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20240619121703.3411989-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: cs42l43: Refactor accessing the SDCA extension propertiesCharles Keepax2024-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor accessing the SDCA extension properties to make it easier to access multiple properties to assist with future features. Return the node itself and allow the caller to read the actual properties. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20240619121703.3411989-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: Merge up fixesMark Brown2024-06-205-30/+23
| |\ \ | | | | | | | | | | | | We need the fixes to apply new changes to the Cirrus drivers.
| * | | spi: spi-cadence: Enable spi refclk in slave modeAmit Kumar Mahapatra2024-06-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When spi-cadence is configured as a slave, it requires the SPI refclk to detect the synchronization start condition while communicating with the master. However, the spi-cadence driver never enables the SPI refclk in slave mode, causing the refclk to remain disabled if the "clk_ignore_unused" kernel parameter is not passed through bootargs. As a result, the slave cannot detect data sent by the master, leading to communication failure. Update driver to enable the SPI refclk in both master and slave configurations. Fixes: b1b90514eaa3 ("spi: spi-cadence: Add support for Slave mode") Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> Link: https://msgid.link/r/20240617153837.29861-1-amit.kumar-mahapatra@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: cs42l43: Refactor accessing the SDCA extension propertiesCharles Keepax2024-06-181-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor accessing the SDCA extension properties to make it easier to access multiple properties to assist with future features. Return the node itself and allow the caller to read the actual properties. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://msgid.link/r/20240611132556.1557075-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: meson-spicc: add spicc loopback modeXianwei Zhao2024-06-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add spicc loopback mode for debugging convenience. Signed-off-by: Sunny Luo <sunny.luo@amlogic.com> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20240612-spi_lbc-v1-1-d52e8c8011bd@amlogic.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: Rework DMA mapped flagMark Brown2024-06-119-69/+59
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>: The first part of the series (patches 1 to 7) is an introduction of a new helper followed by the user conversion. This consolidates the same code and also makes patch 8 (last one) be localised to the SPI core part. The last patch is the main rework to get rid of a recently introduced hack with a dummy SG list and move to the transfer-based DMA mapped flag. That said, the patches 1 to 7 may be applied right away since they have no functional change intended, while the last one needs more testing and reviewing.
| | * | | spi: Rework per message DMA mapped flag to be per transferAndy Shevchenko2024-06-103-51/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The granularity of DMA mappings is transfer and moreover, the direction is also important as it can be unidirect. The current cur_msg_mapped flag doesn't fit well the DMA mapping and syncing calls and we have tons of checks around on top of it. So, instead of doing that rework the code to use per transfer per direction flag to show if it's DMA mapped or not. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-9-andriy.shevchenko@linux.intel.com Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: qup: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-8-andriy.shevchenko@linux.intel.com Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: pci1xxxx: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-7-andriy.shevchenko@linux.intel.com Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: pxa2xx: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-6-andriy.shevchenko@linux.intel.com Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: omap2-mcspi: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-5-andriy.shevchenko@linux.intel.com Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: ingenic: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-4-andriy.shevchenko@linux.intel.com Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: dw: Use new spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-3-andriy.shevchenko@linux.intel.com Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: Introduce internal spi_xfer_is_dma_mapped() helperAndy Shevchenko2024-06-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are few drivers that use the same pattern to check if the transfer is DMA mapped or not. Provide a helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Link: https://lore.kernel.org/r/20240531194723.1761567-2-andriy.shevchenko@linux.intel.com Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | spi: add missing MODULE_DESCRIPTION() macrosJeff Johnson2024-06-106-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-altera-core.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-fsl-lib.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-omap2-mcspi.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/spi/spi-qup.o Add the missing invocations of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://lore.kernel.org/r/20240609-md-drivers-spi-v1-1-1c7444f53cde@quicinc.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | | spi: meson-spicc: set SPI clock flag CLK_SET_RATE_PARENTXianwei Zhao2024-06-101-6/+10
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add SPI clock flag CLK_SET_RATE_PARENT for using pclk as parent clock. This gives SPI more flexibility in frequency selection. Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com> Signed-off-by: Sunny Luo <sunny.luo@amlogic.com> Link: https://lore.kernel.org/r/20240524-spi_pclk_setparent-v1-1-99e0ce70b66f@amlogic.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | regmap: spi: Fix potential off-by-one when calculating reserved sizeAndy Shevchenko2024-06-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we ever meet a hardware that uses weird register bits and padding, we may end up in off-by-one error since x/8 + y/8 might not be equal to (x + y)/8 in some cases. bits pad x/8+y/8 (x+y)/8 4..7 0..3 0 0 // x + y from 4 up to 7 4..7 4..7 0 1 // x + y from 8 up to 11 4..7 8..11 1 1 // x + y from 12 up to 15 8..15 0..7 1 1 // x + y from 8 up to 15 8..15 8..15 2 2 // x + y from 16 up to 23 Fix this by using (x+y)/8. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://msgid.link/r/20240605205315.19132-1-andy.shevchenko@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | dt-bindings: spi: amlogic,a1-spifc: add missing power-domainsNeil Armstrong2024-06-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the Amlogic A1, the SPI FC controller can require a power-domain to operate, add it as optional. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://msgid.link/r/20240605-topic-amlogic-upstream-bindings-fixes-power-domains-spifc-v1-1-380f29ba4a16@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: pxa2xx: Convert PCI driver to use spi-pxa2xx code directlyAndy Shevchenko2024-06-031-26/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCI driver has an additional device layer for enumeration. Remove that layer and use spi-pxa2xx code directly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-12-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: pxa2xx: Move platform driver to a separate fileAndy Shevchenko2024-06-034-208/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spi-pxa2xx.c is bloated with a platform driver code while pretending to provide a core functionality. Make it real core library by splitting out the platform driver to a separate file. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-11-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: pxa2xx: Extract pxa2xx_spi_platform_*() callbacksAndy Shevchenko2024-06-031-19/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation of the extracting platform driver from spi-pxa2xx.c split the probe and remove functions so we have bus independent and platform device ones. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-10-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: pxa2xx: Remove superflous check for Intel Atom SoCsAndy Shevchenko2024-06-031-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pxa2xx_spi_fw_translate_cs() checks for the ACPI companion device presence along with the SSP type. But the SSP type is uniquely determines the case. Hence remove the superflous check. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-9-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: pxa2xx: Remove duplicate checkAndy Shevchenko2024-06-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mmio_base can't be NULL at this point. It's either checked in both pxa_ssp_probe() and pxa2xx_spi_init_ssp() or correctly provided by PCI core. Hence, remove duplicate check which is a dead code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-8-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | spi: pxa2xx: Print DMA burst size only when DMA is enabledAndy Shevchenko2024-06-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print DMA burst size only when DMA is enabled to avoid making a false impression that DMA is enabled when it may be not. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240530151117.1130792-7-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>