aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/spi/spi-mem.h
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2022-01-27 10:17:56 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-02-10 09:32:29 +0100
commit4a3cc7fb6e63bcfdedec25364738f1493345bd20 (patch)
treec25241f3e2c4e9dcc6ad90ad16ba57359939dfbe /include/linux/spi/spi-mem.h
parentmtd: nand: mxic-ecc: Support SPI pipelined mode (diff)
downloadlinux-dev-4a3cc7fb6e63bcfdedec25364738f1493345bd20.tar.xz
linux-dev-4a3cc7fb6e63bcfdedec25364738f1493345bd20.zip
spi: spi-mem: Introduce a capability structure
Create a spi_controller_mem_caps structure and put it within the spi_controller structure close to the spi_controller_mem_ops strucure. So far the only field in this structure is the support for dtr operations, but soon we will add another parameter. Also create a helper to parse the capabilities and check if the requested capability has been set or not. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-2-miquel.raynal@bootlin.com
Diffstat (limited to 'include/linux/spi/spi-mem.h')
-rw-r--r--include/linux/spi/spi-mem.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 85e2ff7b840d..38e5d45c9842 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -286,6 +286,17 @@ struct spi_controller_mem_ops {
};
/**
+ * struct spi_controller_mem_caps - SPI memory controller capabilities
+ * @dtr: Supports DTR operations
+ */
+struct spi_controller_mem_caps {
+ bool dtr;
+};
+
+#define spi_mem_controller_is_capable(ctlr, cap) \
+ ((ctlr)->mem_caps && (ctlr)->mem_caps->cap)
+
+/**
* struct spi_mem_driver - SPI memory driver
* @spidrv: inherit from a SPI driver
* @probe: probe a SPI memory. Usually where detection/initialization takes