Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: dw: Add support for master mode selection for DWC SSI controller

Add support to select the controller mode as master mode by setting Bit 31
of CTRLR0 register. This feature is supported for controller versions above
v1.02.

Signed-off-by: Nandhini Srikandan <nandhini.srikandan@intel.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20220713042223.1458-4-nandhini.srikandan@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Nandhini Srikandan and committed by
Mark Brown
51e41dc2 0d085723

+4 -9
+3 -2
drivers/spi/spi-dw-core.c
··· 307 307 if (spi->mode & SPI_LOOP) 308 308 cr0 |= DW_HSSI_CTRLR0_SRL; 309 309 310 - if (dws->caps & DW_SPI_CAP_KEEMBAY_MST) 311 - cr0 |= DW_HSSI_CTRLR0_KEEMBAY_MST; 310 + /* CTRLR0[31] MST */ 311 + if (dw_spi_ver_is_ge(dws, HSSI, 102A)) 312 + cr0 |= DW_HSSI_CTRLR0_MST; 312 313 } 313 314 314 315 return cr0;
+1 -7
drivers/spi/spi-dw.h
··· 94 94 #define DW_HSSI_CTRLR0_SCPOL BIT(9) 95 95 #define DW_HSSI_CTRLR0_TMOD_MASK GENMASK(11, 10) 96 96 #define DW_HSSI_CTRLR0_SRL BIT(13) 97 - 98 - /* 99 - * For Keem Bay, CTRLR0[31] is used to select controller mode. 100 - * 0: SSI is slave 101 - * 1: SSI is master 102 - */ 103 - #define DW_HSSI_CTRLR0_KEEMBAY_MST BIT(31) 97 + #define DW_HSSI_CTRLR0_MST BIT(31) 104 98 105 99 /* Bit fields in CTRLR1 */ 106 100 #define DW_SPI_NDF_MASK GENMASK(15, 0)