summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-15 14:34:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-15 14:34:11 -0700
commit405f6584d7d0fc46534fd370e374630283dffe60 (patch)
tree3fb3b28d26578f450f446bedc2818a6fc26101f0 /include/linux
parent44f7a3795395b54bf674002803e3e80c6312e210 (diff)
parentc4c3fc872d2a05bf10372233c98e81344e685cdf (diff)
Merge tag 'spi-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi updates from Mark Brown: "A busy release for SPI, almost all of it in a couple of larger fix and cleanup series for patterns that affected many drivers. We do have a couple of core API additions as well, relatively application specific but they enable some new use cases. - A packed command operation for spi-mem devices - Improvements to the ancillary device support to enable some IIO use cases from Antoniu Miclaus - Fixes for a registration ordering issue pattern caused by the handover between allocation and registration of controllers in concert with devm from Johan Hovold - Improvements to handling of clock allocation from Pei Xiao - Cleanups in the fsl-lpspi driver from Marc Kleine-Budde - Support for Renesas RZ/G3E and RZ/G3L" * tag 'spi-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (115 commits) spi: sn-f-ospi: fix incorrect return code for invalid num-cs spi: spi-mem: Add a packed command operation spi: cadence-qspi: Revert the filtering of certain opcodes in ODTR spi: mtk-snfi: unregister ECC engine on probe failure and remove() callback spi: s3c64xx: fix NULL-deref on driver unbind spi: zynq-qspi: fix controller deregistration spi: zynqmp-gqspi: fix controller deregistration spi: uniphier: fix controller deregistration spi: ti-qspi: fix controller deregistration spi: tegra20-sflash: fix controller deregistration spi: tegra114: fix controller deregistration spi: syncuacer: fix controller deregistration spi: sun6i: fix controller deregistration spi: sun4i: fix controller deregistration spi: st-ssc4: fix controller deregistration spi: sprd: fix controller deregistration spi: slave-mt27xx: fix controller deregistration spi: sifive: fix controller deregistration spi: sh-msiof: fix controller deregistration spi: sh-hspi: fix controller deregistration ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/spi/spi-mem.h16
-rw-r--r--include/linux/spi/spi.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 5774e554c0f0..c8e207522223 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -28,6 +28,14 @@
.dtr = true, \
}
+#define SPI_MEM_DTR_OP_PACKED_CMD(__opcode, __addr, __buswidth) \
+ { \
+ .nbytes = 2, \
+ .opcode = __opcode << 8 | __addr, \
+ .buswidth = __buswidth, \
+ .dtr = true, \
+ }
+
#define SPI_MEM_OP_ADDR(__nbytes, __val, __buswidth) \
{ \
.nbytes = __nbytes, \
@@ -130,11 +138,13 @@ enum spi_mem_data_dir {
/**
* struct spi_mem_op - describes a SPI memory operation
+ * @cmd: the complete command
* @cmd.nbytes: number of opcode bytes (only 1 or 2 are valid). The opcode is
* sent MSB-first.
* @cmd.buswidth: number of IO lines used to transmit the command
* @cmd.opcode: operation opcode
* @cmd.dtr: whether the command opcode should be sent in DTR mode or not
+ * @addr: the address attributes
* @addr.nbytes: number of address bytes to send. Can be zero if the operation
* does not need to send an address
* @addr.buswidth: number of IO lines used to transmit the address cycles
@@ -143,10 +153,12 @@ enum spi_mem_data_dir {
* Note that only @addr.nbytes are taken into account in this
* address value, so users should make sure the value fits in the
* assigned number of bytes.
+ * @dummy: data for dummy operation
* @dummy.nbytes: number of dummy bytes to send after an opcode or address. Can
* be zero if the operation does not require dummy bytes
* @dummy.buswidth: number of IO lanes used to transmit the dummy bytes
* @dummy.dtr: whether the dummy bytes should be sent in DTR mode or not
+ * @data: the data attributes
* @data.buswidth: number of IO lanes used to send/receive the data
* @data.dtr: whether the data should be sent in DTR mode or not
* @data.ecc: whether error correction is required or not
@@ -273,7 +285,7 @@ struct spi_mem {
};
/**
- * struct spi_mem_set_drvdata() - attach driver private data to a SPI mem
+ * spi_mem_set_drvdata() - attach driver private data to a SPI mem
* device
* @mem: memory device
* @data: data to attach to the memory device
@@ -284,7 +296,7 @@ static inline void spi_mem_set_drvdata(struct spi_mem *mem, void *data)
}
/**
- * struct spi_mem_get_drvdata() - get driver private data attached to a SPI mem
+ * spi_mem_get_drvdata() - get driver private data attached to a SPI mem
* device
* @mem: memory device
*
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 0dc671c07d3a..7587b1c5d7ec 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -382,6 +382,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
}
extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 chip_select);
+extern struct spi_device *devm_spi_new_ancillary_device(struct spi_device *spi, u8 chip_select);
/* Use a define to avoid include chaining to get THIS_MODULE */
#define spi_register_driver(driver) \