mirror of
https://github.com/Fishwaldo/build.git
synced 2025-07-09 14:39:14 +00:00
switch to 5.4.y
This commit is contained in:
parent
1a4c152fc6
commit
aafb70a9a3
189 changed files with 1212088 additions and 222 deletions
24
patch/kernel/sunxi-dev/general-fix-cs_gpio-spi-support.patch
Normal file
24
patch/kernel/sunxi-dev/general-fix-cs_gpio-spi-support.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
|
||||
index 9a7def7..08c6a05 100644
|
||||
--- a/drivers/spi/spi.c
|
||||
+++ b/drivers/spi/spi.c
|
||||
@@ -2884,6 +2884,19 @@ int spi_setup(struct spi_device *spi)
|
||||
if (spi->controller->setup)
|
||||
status = spi->controller->setup(spi);
|
||||
|
||||
+ if (gpio_is_valid(spi->cs_gpio)) {
|
||||
+ dev_info(&spi->dev, "spi_setup / gpio_is_valid(%d) ... doing gpio_request ...\n", spi->cs_gpio);
|
||||
+ int ret = gpio_request(spi->cs_gpio, dev_name(&spi->dev));
|
||||
+ if (ret) {
|
||||
+ dev_err(&spi->dev, "failed to request gpio\n");
|
||||
+ }
|
||||
+ else {
|
||||
+ gpio_direction_output(spi->cs_gpio,
|
||||
+ !(spi->mode & SPI_CS_HIGH));
|
||||
+ dev_info(&spi->dev, "spi_setup / gpio_direction_output(%d) done !\n", spi->cs_gpio);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
spi_set_cs(spi, false);
|
||||
|
||||
dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
|
Loading…
Add table
Add a link
Reference in a new issue