ramips: 6.1: spi: fix patch by replacing cs_gpio with cs_gpiod
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Thu, 8 Feb 2024 20:57:12 +0000 (21:57 +0100)
committerNick Hainke <vincent@systemli.org>
Sat, 10 Feb 2024 12:06:05 +0000 (13:06 +0100)
Upstream commit f48dc6b96649 ("spi: Retire legacy GPIO handling") [0]
removed support using GPIOs as chip select. Fix it by replacing cs_gpio
with cs_gpiod.

[0] - https://github.com/torvalds/linux/commit/f48dc6b9664963107e500aecfc2f4df27dc5afb6

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
[split commit and rewrite commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
target/linux/ramips/patches-6.1/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch

index fa119ab211ecc05df07e1902f0ed620c5257b511..7815ecf5a0ebc32efd7609e04ed39c228fcb8b77 100644 (file)
@@ -339,8 +339,8 @@ Acked-by: John Crispin <blogic@openwrt.org>
 +      if (spi->mode & SPI_CS_HIGH)
 +              enable = !enable;
 +
-+      if (spi->cs_gpio >= 0)
-+              gpio_set_value(spi->cs_gpio, !enable);
++      if (spi->cs_gpiod)
++              gpiod_set_value(spi->cs_gpiod, !enable);
 +      else if (spi->master->set_cs)
 +              spi->master->set_cs(spi, !enable);
 +}