diff options
| author | Shiji Yang | 2024-10-07 15:21:16 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2024-10-12 20:04:03 +0000 |
| commit | 09a6e4747f759fd3867c3ddf04834e09fd252e73 (patch) | |
| tree | db27540e3c9e15e44dc94eab0dc6623a63f93d35 | |
| parent | 6e40f982082a60b9788cf5e0360142a23180fbfa (diff) | |
| download | openwrt-09a6e4747f759fd3867c3ddf04834e09fd252e73.tar.gz | |
ramips: remove useless cs gpio code for rt2800 SPI driver
The SPI driver framework can handle it automatically in
spi.c:spi_setup():spi_set_cs():gpiod_set_value_cansleep().
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16636
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
| -rw-r--r-- | target/linux/ramips/patches-6.6/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/target/linux/ramips/patches-6.6/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-6.6/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch index 6760d9f56c..318039fb4c 100644 --- a/target/linux/ramips/patches-6.6/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch +++ b/target/linux/ramips/patches-6.6/821-SPI-ralink-add-Ralink-SoC-spi-driver.patch @@ -41,7 +41,7 @@ Acked-by: John Crispin <blogic@openwrt.org> obj-$(CONFIG_SPI_SC18IS602) += spi-sc18is602.o --- /dev/null +++ b/drivers/spi/spi-rt2880.c -@@ -0,0 +1,535 @@ +@@ -0,0 +1,519 @@ +/* + * spi-rt2880.c -- Ralink RT288x/RT305x SPI controller driver + * @@ -66,7 +66,6 @@ Acked-by: John Crispin <blogic@openwrt.org> +#include <linux/reset.h> +#include <linux/spi/spi.h> +#include <linux/platform_device.h> -+#include <linux/gpio.h> + +#define DRIVER_NAME "spi-rt2880" + @@ -333,18 +332,6 @@ Acked-by: John Crispin <blogic@openwrt.org> + return err; +} + -+/* copy from spi.c */ -+static void spi_set_cs(struct spi_device *spi, bool enable) -+{ -+ if (spi->mode & SPI_CS_HIGH) -+ enable = !enable; -+ -+ if (spi->cs_gpiod) -+ gpiod_set_value(spi->cs_gpiod, !enable); -+ else if (spi->master->set_cs) -+ spi->master->set_cs(spi, !enable); -+} -+ +static int rt2880_spi_setup(struct spi_device *spi) +{ + struct spi_master *master = spi->master; @@ -401,9 +388,6 @@ Acked-by: John Crispin <blogic@openwrt.org> + if (reg != old_reg) + rt2880_spi_write(rs, arbit_off, reg); + -+ /* deselected the spi device */ -+ spi_set_cs(spi, false); -+ + rt2880_dump_reg(master); + + return 0; |