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

spi: spi-imx: set max_native_cs for imx51/imx53/imx6 variants

The ecspi IP block on imx51/imx53/imx6 have four native chip
selects. Tell that to the spi core so that any non-gpio chip selects
get validated against that upper bound.

Also set the SPI_MASTER_GPIO_SS so that the core verifies that, in the
case where both native and gpio chip selects are in use, there is at
least one leftover native chip select (or "channel", in the ecspi
language) for use by the slaves sitting on gpio chip selects.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20230425134527.483607-3-linux@rasmusvillemoes.dk
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rasmus Villemoes and committed by
Mark Brown
8ce1bb9a d9032b30

+5
+5
drivers/spi/spi-imx.c
··· 1761 1761 */ 1762 1762 controller->mode_bits |= SPI_CS_WORD; 1763 1763 1764 + if (is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx)) { 1765 + controller->max_native_cs = 4; 1766 + controller->flags |= SPI_MASTER_GPIO_SS; 1767 + } 1768 + 1764 1769 spi_imx->spi_drctl = spi_drctl; 1765 1770 1766 1771 init_completion(&spi_imx->xfer_done);