summaryrefslogtreecommitdiff
path: root/include/linux/spi
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2024-12-24 20:05:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 00:18:50 +0300
commita25cc746f7d0dc6b6211b0f73defba7be7c90f3e (patch)
tree0b23addbc16dc215cd4592f58214bcd7588f577d /include/linux/spi
parentf1ea0e8b4a154f28642fa402c5ae5db1b47e71ba (diff)
downloadlinux-a25cc746f7d0dc6b6211b0f73defba7be7c90f3e.tar.xz
spi: spi-mem: Add a new controller capability
[ Upstream commit 1248c9b8d54120950fda10fbeb98fb8932b4d45c ] There are spi devices with multiple frequency limitations depending on the invoked command. We probably do not want to afford running at the lowest supported frequency all the time, so if we want to get the most of our hardware, we need to allow per-operation frequency limitations. Among all the SPI memory controllers, I believe all are capable of changing the spi frequency on the fly. Some of the drivers do not make any frequency setup though. And some others will derive a per chip prescaler value which will be used forever. Actually changing the frequency on the fly is something new in Linux, so we need to carefully flag the drivers which do and do not support it. A controller capability is created for that, and the presence for this capability will always be checked before accepting such pattern. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Link: https://patch.msgid.link/20241224-winbond-6-11-rc1-quad-support-v2-2-ad218dbc406f@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org> Stable-dep-of: 40ad64ac25bb ("spi: nxp-fspi: Propagate fwnode in ACPI case as well") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi-mem.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index cceebf8c78ba..6bd0b548bd1e 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -309,11 +309,13 @@ struct spi_controller_mem_ops {
* @ecc: Supports operations with error correction
* @swap16: Supports swapping bytes on a 16 bit boundary when configured in
* Octal DTR
+ * @per_op_freq: Supports per operation frequency switching
*/
struct spi_controller_mem_caps {
bool dtr;
bool ecc;
bool swap16;
+ bool per_op_freq;
};
#define spi_mem_controller_is_capable(ctlr, cap) \