aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-04-01spi: Remove repeated struct declarationWan Jiabing1-1/+0
struct spi_transfer is declared twice. One is declared at 24th line. The blew one is not needed though. Remove the duplicate. Signed-off-by: Wan Jiabing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-04-01Merge series "Convert Cadence QSPI bindings to yaml" from Pratyush Yadav ↵Mark Brown2-68/+143
<[email protected]>: Hi, This series picks up Ramuthevar's effort on converting the Cadence QSPI bindings to yaml [0]. During the conversion process, I discovered that some TI device tree files were not using the compatible correctly. Those are fixed in patches 1-3. [0] https://patchwork.kernel.org/project/spi-devel-general/patch/20201116031003.19062-6-vadivel.muruganx.ramuthevar@linux.intel.com/ Pratyush Yadav (3): arm64: dts: ti: k3-j721e-mcu: Fix ospi compatible arm64: dts: ti: k3-j7200-mcu: Fix ospi compatible arm64: dts: ti: k3-am64-main: Fix ospi compatible Ramuthevar Vadivel Murugan (1): dt-bindings: spi: Convert cadence-quadspi.txt to cadence-quadspi.yaml .../bindings/spi/cadence-quadspi.txt | 68 --------- .../bindings/spi/cdns,qspi-nor.yaml | 143 ++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 2 +- .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 2 +- .../boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 4 +- 5 files changed, 147 insertions(+), 72 deletions(-) delete mode 100644 Documentation/devicetree/bindings/spi/cadence-quadspi.txt create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml -- 2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
2021-04-01spi: Convert cadence-quadspi.txt to cadence-quadspi.yamlRamuthevar Vadivel Murugan2-68/+143
There is no way as of now to have a parent or bus defining properties for child nodes. For now, avoid it in the example to silence warnings on dt_schema_check. We can figure out how to deal with actual dts files later. [[email protected]: Fix how compatible is defined, make reset optional, fix minor typos, remove subnode properties in example, update commit message.] Signed-off-by: Ramuthevar Vadivel Murugan <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-31spi: Add HiSilicon SPI Controller Driver for Kunpeng SoCsJay Fang4-0/+523
This driver supports SPI Controller for HiSilicon Kunpeng SoCs. This driver supports SPI operations using FIFO mode of transfer. DMA is not supported, and we just use IRQ mode for operation completion notification. Only ACPI firmware is supported. Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-31spi: pl022: Convert to use GPIO descriptorsLinus Walleij1-6/+14
This converts the PL022 driver to use GPIO descriptors instead of the old global GPIO numberspace. Since the driver handles messages on its own it needs to manage the GPIO descriptor directly. Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-31spi: pl022: Use GPIOs looked up by the coreLinus Walleij2-67/+10
The SPI core looks up GPIO lines from the device tree, so let's stop trying to do that on our own and rely on the core to do this for us. In addition to the GPIO line we also need to keep track of the chip select index separately, as the native chip select needs this index. The driver was reusing the same GPIO array for native chip select indices, so keep this in a separate state variable instead. The facility to pass in custom GPIO lines from the platform data can go, because even if we do have out-of-tree code that want to use platform data, they can soon pass in GPIOs using machine GPIO descriptor tables which will be available after the next step when we convert the driver to using GPIO descriptors. The implicit inclusion of <linux/of.h> is made explicit as we no longer need to include <linux/of_gpio.h>. Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-31spi: pl022: Drop custom per-chip cs_controlLinus Walleij2-27/+2
Drop the custom cs_control() assigned through platform data, we have no in-tree users and the only out-of-tree use I have ever seen of this facility is to pull GPIO lines, which is something the driver can already do for us. Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-29spi: pl022: User more sensible defaultsLinus Walleij1-2/+2
When using the device tree, which must be considered normal these days, in order to get some kind of normal functionality out of the PL022 users have to actively go into the device tree and edit the SPI clients like this: spi { compatible = "arm,pl022"; num-cs = <1>; cs-gpios = <&gpio 0 GPIO_ACTIVE_LOW>; foo@0 { compatible = "foo"; reg = <0>; pl022,interface = <0>; pl022,com-mode = <0>; }; }; Otherwise the PL022 will come up as a client (slave) and using polling mode. This is quite unintuitive and many users will get their device trees wrong. Alter the defaults such that we come up in host mode (master) and use interrupt mode. Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-25Merge series "enable flexspi support on imx8mp" from Heiko Schocher ↵Mark Brown2-0/+2
<[email protected]>: add compatible entry in nxp_fspi driver for imx8mp @Shawn: If this series is accepted, can you apply the DTS patches from series v2? http://lists.infradead.org/pipermail/linux-arm-kernel/2021-March/643292.html http://lists.infradead.org/pipermail/linux-arm-kernel/2021-March/643293.html Changes in v4: rebased against: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next a43e89624baea ("Merge remote-tracking branch 'spi/for-5.13' into spi-next") Changes in v3: - seperate spi changes from series: http://lists.infradead.org/pipermail/linux-arm-kernel/2021-March/643289.html into own series as Kuldeep suggested and rebased against git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next 144c79ef33536 ("Merge tag 'perf-tools-fixes-for-v5.12-2020-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux") - no changes, rebased against git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next 144c79ef33536 Merge tag 'perf-tools-fixes-for-v5.12-2020-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Changes in v2: - work in comments from Marco add own compatible entry for imx8mp Heiko Schocher (2): spi: fspi: enable fspi driver for on imx8mp dt-bindings: spi: add compatible entry for imx8mp in FlexSPI controller Documentation/devicetree/bindings/spi/spi-nxp-fspi.txt | 1 + drivers/spi/spi-nxp-fspi.c | 1 + 2 files changed, 2 insertions(+) -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
2021-03-25spi: fsi: Remove multiple sequenced ops for restricted chipsEddie James1-20/+7
Updated restricted chips have trouble processing multiple sequenced operations. So remove the capability to sequence multiple operations and reduce the maximum transfer size to 8 bytes. Signed-off-by: Eddie James <[email protected]> Reviewed-by: Joel Stanley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-25dt-bindings: spi: add compatible entry for imx8mp in FlexSPI controllerHeiko Schocher1-0/+1
add compatible entry "nxp,imx8mp-fspi" in NXP FlexSPI controller Signed-off-by: Heiko Schocher <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-25spi: fspi: enable fspi driver for on imx8mpHeiko Schocher1-0/+1
add compatible entry in nxp_fspi driver for imx8mp. Signed-off-by: Heiko Schocher <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: pl022: Fix trailing whitespaceJay Fang1-1/+1
Fix checkpatch error: ERROR: trailing whitespace #1198: FILE: spi-pl022.c:1198: Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: rockchip: Fix code indent should use tabs where possibleJay Fang1-3/+3
Fix checkpatch errors: ERROR: code indent should use tabs where possible #484: FILE: spi-rockchip.c:484: +^I | CR0_BHT_8BIT << CR0_BHT_OFFSET$ ERROR: code indent should use tabs where possible #485: FILE: spi-rockchip.c:485: +^I | CR0_SSD_ONE << CR0_SSD_OFFSET$ ERROR: code indent should use tabs where possible #486: FILE: spi-rockchip.c:486: +^I | CR0_EM_BIG << CR0_EM_OFFSET;$ Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: spi-mem: Fix code indent should use tabs where possibleJay Fang1-3/+3
Fix checkpatch errors: ERROR: code indent should use tabs where possible #624: FILE: spi-mem.c:624: ERROR: code indent should use tabs where possible #626: FILE: spi-mem.c:626: ERROR: code indent should use tabs where possible #627: FILE: spi-mem.c:627: Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: jcore: Fix trailing statements should be on next lineJay Fang1-1/+2
Fix checkpatch error: ERROR: trailing statements should be on next line #85: FILE: spi-jcore.c:85: + if (speed == hw->speed_hz) return; Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: spi-bitbang: Fix open brace following function definitions go on the ↵Jay Fang1-3/+6
next line Fix checkpatch errors: ERROR: open brace '{' following function definitions go on the next line #54: FILE: spi-bitbang.c:54: ERROR: open brace '{' following function definitions go on the next line #82: FILE: spi-bitbang.c:82: ERROR: open brace '{' following function definitions go on the next line #110: FILE: spi-bitbang.c:110: Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: dln2: Fix open brace following function definitions go on the next lineJay Fang1-1/+2
Fix checkpatch error: ERROR: open brace '{' following function definitions go on the next line #545: FILE: spi-dln2.c:545: +static int dln2_spi_rdwr(struct dln2_spi *dln2, const u8 *tx_data, + u8 *rx_data, u16 data_len, u8 attr) { Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: spi-mtk-nor: Fix checkpatch spacing errorJay Fang1-1/+1
Fix checkpatch error: ERROR: space required before the open parenthesis '(' #295: FILE: spi-mtk-nor.c:295: + switch(op->data.dir) { Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: omap-100k: Fix checkpatch spacing errorsJay Fang1-4/+4
Fix checkpatch errors: ERROR: space prohibited before that ',' (ctx:WxW) #113: FILE: spi-omap-100k.c:113: + writew(data , spi100k->base + SPI_TX_MSB); ^ ERROR: space prohibited before that ',' (ctx:WxW) #249: FILE: spi-omap-100k.c:249: + writew(0x3e , spi100k->base + SPI_SETUP1); ^ ERROR: space prohibited before that ',' (ctx:WxW) #250: FILE: spi-omap-100k.c:250: + writew(0x00 , spi100k->base + SPI_STATUS); ^ ERROR: space prohibited before that ',' (ctx:WxW) #251: FILE: spi-omap-100k.c:251: + writew(0x3e , spi100k->base + SPI_CTRL); ^ Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: pxa2xx: Fix checkpatch spacing errorsJay Fang2-2/+2
Fix checkpatch errors: ERROR: space prohibited before that ',' (ctx:WxW) #255: FILE: spi-pxa2xx-pci.c:255: + ssp->clk = clk_register_fixed_rate(&dev->dev, buf , NULL, 0, ^ ERROR: "foo* bar" should be "foo *bar" #621: FILE: spi-pxa2xx.c:621: +static void int_error_stop(struct driver_data *drv_data, const char* msg) Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: sprd: Fix checkpatch spacing errorJay Fang1-1/+1
Fix checkpatch error: ERROR: space prohibited before that close parenthesis ')' #213: FILE: spi-sprd-adi.c:213: + rd_addr = (val & RD_ADDR_MASK ) >> RD_ADDR_SHIFT; Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-24spi: spi-topcliff-pch: Fix checkpatch spacing errorJay Fang1-1/+2
Fix checkpatch error: ERROR: space prohibited before that '++' (ctx:WxB) #1204: FILE: spi-topcliff-pch.c:1204: + for (i = 0; i < cnt; i ++) { ^ Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-23spi: mediatek: add mt8195 spi slave supportLeilk Liu1-0/+8
this patch adds mt8195 spi slave compatible support. Signed-off-by: Leilk Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-23spi: mediatek: add mtk_spi_compatible supportLeilk Liu1-4/+24
this patch adds max_fifo_size and must_rx compat support. Signed-off-by: Leilk Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-23spi: update spi slave bindings for MT8195 SoCLeilk Liu1-0/+1
Add a DT binding documentation for the MT8195 soc. Signed-off-by: Leilk Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-23spi: update spi master bindings for MT8195 SoCLeilk Liu1-0/+1
Add a DT binding documentation for the MT8195 soc. Signed-off-by: leilk.liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-19spi: stm32: Fix use-after-free on unbindAlain Volmat1-14/+10
stm32_spi_remove() accesses the driver's private data after calling spi_unregister_master() even though that function releases the last reference on the spi_master and thereby frees the private data. Fix by switching over to the new devm_spi_alloc_master() helper which keeps the private data accessible until the driver has unbound. Fixes: 8d559a64f00b ("spi: stm32: drop devres version of spi_register_master") Reported-by: Lukas Wunner <[email protected]> Signed-off-by: Alain Volmat <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-17spi: imx: Improve driver descriptionFabio Estevam1-1/+1
"SPI Controller driver" is a too generic description. Make it i.MX specific instead. Signed-off-by: Fabio Estevam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-17spi: Fix spelling mistake "softwade" -> "software"Colin Ian King1-1/+1
There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-16Merge series "spi: Adding support for software nodes" from Heikki Krogerus ↵Mark Brown4-24/+22
<[email protected]>: Hi, The older API used to supply additional device properties for the devices - so mainly the function device_add_properties() - is going to be removed. The reason why the API will be removed is because it gives false impression that the properties are assigned directly to the devices, which has actually never been the case - the properties have always been assigned to a software fwnode which was then just directly linked with the device when the old API was used. By only accepting device properties instead of complete software nodes, the subsystems remove any change of taking advantage of the other features the software nodes have. The change that is required from the spi subsystem and the drivers is trivial. Basically only the "properties" member in struct spi_board_info, which was a pointer to struct property_entry, is replaced with a pointer to a complete software node. thanks, Heikki Krogerus (4): spi: Add support for software nodes ARM: pxa: icontrol: Constify the software node ARM: pxa: zeus: Constify the software node spi: Remove support for dangling device properties arch/arm/mach-pxa/icontrol.c | 12 ++++++++---- arch/arm/mach-pxa/zeus.c | 6 +++++- drivers/spi/spi.c | 21 ++++++--------------- include/linux/spi/spi.h | 7 +++---- 4 files changed, 22 insertions(+), 24 deletions(-) -- 2.30.1 base-commit: a38fd8748464831584a19438cbb3082b5a2dab15
2021-03-16spi: Remove support for dangling device propertiesHeikki Krogerus2-25/+3
>From now on only accepting complete software nodes. Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-16ARM: pxa: zeus: Constify the software nodeHeikki Krogerus1-1/+5
When device properties are supplied to the devices, in reality a software fwnode that holds those properties is created which is then assigned to the device. If the device properties are constant the software node can also be constant. Signed-off-by: Heikki Krogerus <[email protected]> Cc: Daniel Mack <[email protected]> Cc: Haojian Zhuang <[email protected]> Cc: Robert Jarzmik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-16ARM: pxa: icontrol: Constify the software nodeHeikki Krogerus1-4/+8
When device properties are supplied to the devices, in reality a software fwnode that holds those properties is created which is then assigned to the device. If the device properties are constant the software node can also be constant. Signed-off-by: Heikki Krogerus <[email protected]> Cc: Daniel Mack <[email protected]> Cc: Haojian Zhuang <[email protected]> Cc: Robert Jarzmik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-16spi: Add support for software nodesHeikki Krogerus2-3/+15
Making it possible for the drivers to assign complete software fwnodes to the devices instead of only the device properties in those nodes. Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-16dt-bindings: spi: Add compatible for Mediatek MT8195Seiya Wang1-0/+1
This commit adds dt-binding documentation of spi nor for Mediatek MT8195 SoC Platform. Signed-off-by: Seiya Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12Merge series "spi: finalize 'delay_usecs' removal/transition" from Alexandru ↵Mark Brown11-43/+24
Ardelean <[email protected]>: A while back I started the introduction of the 'spi_delay' data type: https://lore.kernel.org/linux-spi/[email protected]/ Users of the 'delay_usecs' were removed from drivers. Now it's time to remove the 'delay_usecs' from the SPI subsystem and use only the 'delay' field. This changeset adapts all SPI drivers to do without 'delay_usecs'. Additionally, for greybus we need to adapt it to use the 'delay' in nano-seconds and convert it to micro-seconds. Alexandru Ardelean (10): spi: spi-axi-spi-engine: remove usage of delay_usecs spi: bcm63xx-spi: don't check 'delay_usecs' field spi: spi-bcm-qspi: replace 'delay_usecs' with 'delay.value' check spi: spi-sh: replace 'delay_usecs' with 'delay.value' in pr_debug spi: spi-tegra20-flash: don't check 'delay_usecs' field for spi transfer staging: greybus: spilib: use 'spi_delay_to_ns' for getting xfer delay spi: spi-falcon: remove check for 'delay_usecs' spi: fsl-espi: remove usage of 'delay_usecs' field spi: core: remove 'delay_usecs' field from spi_transfer spi: docs: update info about 'delay_usecs' Documentation/spi/spi-summary.rst | 7 +++++-- drivers/spi/spi-axi-spi-engine.c | 12 ++++-------- drivers/spi/spi-bcm-qspi.c | 2 +- drivers/spi/spi-bcm63xx.c | 2 +- drivers/spi/spi-falcon.c | 2 +- drivers/spi/spi-fsl-espi.c | 17 +++++------------ drivers/spi/spi-sh.c | 4 ++-- drivers/spi/spi-tegra20-sflash.c | 3 +-- drivers/spi/spi.c | 1 - drivers/staging/greybus/spilib.c | 5 ++++- include/linux/spi/spi.h | 12 ------------ 11 files changed, 24 insertions(+), 43 deletions(-) -- 2.29.2 _______________________________________________ devel mailing list [email protected] http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
2021-03-12spi: stm32: avoid ifdef CONFIG_PM for pm callbacksAlain Volmat1-8/+4
Avoid CONFIG_PM preprocessor check for pm suspend/resume callbacks and identify the functions with __maybe_unused. Signed-off-by: Alain Volmat <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: docs: update info about 'delay_usecs'Alexandru Ardelean1-2/+5
The 'delay_usecs' field is no longer present on the spi_transfer struct. This change updates the doc to mention the usage of the (relatively) new 'delay' field. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: core: remove 'delay_usecs' field from spi_transferAlexandru Ardelean2-13/+0
The 'delay' field in the spi_transfer struct is meant to replace the 'delay_usecs' field. However some cleanup was required to remove the uses of 'delay_usecs'. Now that it's been cleaned up, we can remove it from the kernel tree. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: fsl-espi: remove usage of 'delay_usecs' fieldAlexandru Ardelean1-12/+5
The 'delay_usecs' field is being removed from the spi_transfer struct. This change removes it from the SPI FSL ESPI driver. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: spi-falcon: remove check for 'delay_usecs'Alexandru Ardelean1-1/+1
The 'delay_usecs' field is being removed from the spi_transfer struct. This change removes it from the SPI Falcon driver. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12staging: greybus: spilib: use 'spi_delay_to_ns' for getting xfer delayAlexandru Ardelean1-1/+4
The intent is the removal of the 'delay_usecs' field from the spi_transfer struct, as there is a 'delay' field that does the same thing. The spi_delay_to_ns() can be used to get the transfer delay. It works by using the 'delay_usecs' field first (if it is non-zero), and finally uses the 'delay' field. Since the 'delay_usecs' field is going away, this change makes use of the spi_delay_to_ns() function. This also means dividing the return value of the function by 1000, to convert it to microseconds. To prevent any potential faults when converting to microseconds and since the result of spi_delay_to_ns() is int, the delay is being computed in 32 bits and then clamped between 0 & U16_MAX. Signed-off-by: Alexandru Ardelean <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: spi-tegra20-flash: don't check 'delay_usecs' field for spi transferAlexandru Ardelean1-2/+1
The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. So we can remove the 'delay_usecs' handling in this driver. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: spi-sh: replace 'delay_usecs' with 'delay.value' in pr_debugAlexandru Ardelean1-2/+2
The 'delay_usecs' field is going away. The replacement for it is the 'delay' field. So, we should print the 'delay.value' value instead. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: spi-bcm-qspi: replace 'delay_usecs' with 'delay.value' checkAlexandru Ardelean1-1/+1
The 'delay_usecs' field is going away. The replacement for it is the 'delay' field. So, we should check for 'delay.value' being non-zero. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: bcm63xx-spi: don't check 'delay_usecs' fieldAlexandru Ardelean1-1/+1
The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: spi-axi-spi-engine: remove usage of delay_usecsAlexandru Ardelean1-8/+4
The 'delay_usecs' field was handled for backwards compatibility in case there were some users that still configured SPI delay transfers with this field. They should all be removed by now. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-12spi: stm32: drop devres version of spi_register_masterAntonio Borneo1-1/+2
A call to spi_unregister_master() triggers calling remove() for all the spi devices binded to the spi master. Some spi device driver requires to "talk" with the spi device during the remove(), e.g.: - a LCD panel like drivers/gpu/drm/panel/panel-lg-lg4573.c will turn off the backlighting sending a command over spi. This implies that the spi master must be fully functional when spi_unregister_master() is called, either if it is called explicitly in the master's remove() code or implicitly by the devres framework. Devres calls devres_release_all() to release all the resources "after" the remove() of the spi master driver (check code of __device_release_driver() in drivers/base/dd.c). If the spi master driver has an empty remove() then there would be no issue; the devres_release_all() will release everything in reverse order w.r.t. probe(). But if code in spi master driver remove() disables the spi or makes it not functional (like in this spi-stm32), then devres cannot be used safely for unregistering the spi master and the binded spi devices. Replace devm_spi_register_master() with spi_register_master() and add spi_unregister_master() as first action in remove(). Fixes: dcbe0d84dfa5 ("spi: add driver for STM32 SPI controller") Signed-off-by: Antonio Borneo <[email protected]> Signed-off-by: Alain Volmat <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
2021-03-10spi: cadence-quadspi: Silence shiftTooManyBitsSigned warningJay Fang1-1/+1
drivers/spi/spi-cadence-quadspi.c:267:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour [shiftTooManyBitsSigned] return reg & (1 << CQSPI_REG_CONFIG_IDLE_LSB); ^ Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Jay Fang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>