openwrtv4/target/linux/generic/patches-4.9/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch
Koen Vandeputte cd54b2d42b kernel: update kernel 4.9 to 4.9.37
- Refreshed all patches
- Removed upstreamed
- Adapted 4 patches:

473-fix-marvell-phy-initialization-issues.patch
-----------------------------------------------
Removed hunk 5 which got upstreamed

403-net-phy-avoid-setting-unsupported-EEE-advertisments.patch
404-net-phy-restart-phy-autonegotiation-after-EEE-advert.patch
--------------------------------------------------------------
Adapted these 2 RFC patches, merging the delta's from an upstream commit
(see below) which made it before these 2.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
stable.git/commit/?h=v4.9.36&id=97ace183074d306942b903a148aebd5d061758f0

180-usb-xhci-add-support-for-performing-fake-doorbell.patch
-----------------------------------------------------------
- Moved fake_doorbell bitmask due to new item

Compile tested on: cns3xxx, imx6
Run tested on: cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2017-07-15 00:13:05 +02:00

21 lines
638 B
Diff

From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 30 Dec 2016 14:53:45 +0100
Subject: [PATCH] spi: use gpio_set_value_cansleep for setting chipselect GPIO
Sleeping is safe inside spi_transfer_one_message, and some GPIO chips
need to sleep for setting values
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -700,7 +700,7 @@ static void spi_set_cs(struct spi_device
enable = !enable;
if (gpio_is_valid(spi->cs_gpio))
- gpio_set_value(spi->cs_gpio, !enable);
+ gpio_set_value_cansleep(spi->cs_gpio, !enable);
else if (spi->master->set_cs)
spi->master->set_cs(spi, !enable);
}