]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: Allow to have all native CSs in use along with GPIOs
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 20 Apr 2021 16:44:24 +0000 (19:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:59:29 +0000 (16:59 +0200)
commitdb804b5e7bdc713449ab90baddf0c3d9b52730c5
tree8f0aa965c4d32fe673ae9e257f672fe673e380e7
parent60d2fab273653ecd8b10db323851d00b7cb4db47
spi: Allow to have all native CSs in use along with GPIOs

[ Upstream commit dbaca8e56ea3f23fa215f48c2d46dd03ede06e02 ]

The commit 7d93aecdb58d ("spi: Add generic support for unused native cs
with cs-gpios") excludes the valid case for the controllers that doesn't
need to switch native CS in order to perform the transfer, i.e. when

  0 native
  ... ...
  <n> - 1 native
  <n> GPIO
  <n> + 1 GPIO
  ... ...

where <n> defines maximum of native CSs supported by the controller.

To allow this, bail out from spi_get_gpio_descs() conditionally for
the controllers which explicitly marked with SPI_MASTER_GPIO_SS.

Fixes: 7d93aecdb58d ("spi: Add generic support for unused native cs with cs-gpios")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210420164425.40287-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi.c