spi: dw: Add a number of native CS auto-detection
authorSerge Semin <fancer.lancer@gmail.com>
Wed, 24 Apr 2024 15:06:43 +0000 (18:06 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 3 May 2024 02:09:23 +0000 (11:09 +0900)
commite164be7e1e9373bd10e6b79924b0a6374752775e
tree3ae85ce8759d335b598ac1bb4d25d81bccba2eb6
parent11ae2e63b2a517742d233c4e5b67b898c797973e
spi: dw: Add a number of native CS auto-detection

Aside with the FIFO depth and DFS field size it's possible to auto-detect
a number of native chip-select synthesized in the DW APB/AHB SSI IP-core.
It can be done just by writing ones to the SER register. The number of
writable flags in the register is limited by the SSI_NUM_SLAVES IP-core
synthesize parameter. All the upper flags are read-only and wired to zero.
Based on that let's add the number of native CS auto-detection procedure
so the low-level platform drivers wouldn't need to manually set it up
unless it's required to set a constraint due to platform-specific reasons
(for instance, due to a hardware bug).

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240424150657.9678-3-fancer.lancer@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-core.c