Skip to content

Commit 7cc3522

Browse files
tlebbroonie
authored andcommitted
spi: cadence-qspi: set maximum chip-select to 4
Change the maximum chip-select count in cadence-qspi to 4 instead of 16. The value gets used as default ->num_chipselect when the num-cs DT property isn't received from devicetree. It also determines the cqspi->f_pdata array size. Hardware only supports values up to 4; see cqspi_chipselect() that sets CS using a one-bit-per-CS 4-bit register field. Add a static_assert() call as a defensive measure to ensure we stay under the SPI subsystem limit. It got set to 4 when introduced in 4d8ff6b ("spi: Add multi-cs memories support in SPI core") and later increased to 16 in 2f8c7c3 ("spi: Raise limit on number of chip selects"). Signed-off-by: Théo Lebrun <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0d62c64 commit 7cc3522

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
#include <linux/timer.h>
3232

3333
#define CQSPI_NAME "cadence-qspi"
34-
#define CQSPI_MAX_CHIPSELECT 16
34+
#define CQSPI_MAX_CHIPSELECT 4
35+
36+
static_assert(CQSPI_MAX_CHIPSELECT <= SPI_CS_CNT_MAX);
3537

3638
/* Quirks */
3739
#define CQSPI_NEEDS_WR_DELAY BIT(0)

0 commit comments

Comments
 (0)