From 5a56c3197471868f0985796d07a31f33a38c49cd Mon Sep 17 00:00:00 2001 From: Serge Semin Date: Fri, 19 Jun 2026 17:42:44 +0300 Subject: spi: dw: Inform core subsystem with a max number of native CS The driver has been capable of auto-detecting the number of native CS since commit e164be7e1e93 ("spi: dw: Add a number of native CS auto-detection") unless the glue-code has the actual number of the CS defined. Let's use that data to inform the SPI core about that. Thus it will be able to perform additional sanity checks on the GPIO CS initialization procedure. It will be especially useful seeing the driver sets the SPI_CONTROLLER_GPIO_SS flag requiring the native CS being enabled in the GPIO-based CS case. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index b47637888c5c6..fe94fa134866e 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -960,6 +960,7 @@ int dw_spi_add_controller(struct device *dev, struct dw_spi *dws) ctlr->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16); ctlr->bus_num = dws->bus_num; ctlr->num_chipselect = dws->num_cs; + ctlr->max_native_cs = dws->num_cs; ctlr->setup = dw_spi_setup; ctlr->cleanup = dw_spi_cleanup; ctlr->transfer_one = dw_spi_transfer_one; -- cgit v1.2.3