summaryrefslogtreecommitdiffstats
path: root/sys-kernel/boest-v5.0.15/raspberrypi/0157-spi-spi-bcm2835-Disable-forced-software-CS.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/boest-v5.0.15/raspberrypi/0157-spi-spi-bcm2835-Disable-forced-software-CS.patch')
-rw-r--r--sys-kernel/boest-v5.0.15/raspberrypi/0157-spi-spi-bcm2835-Disable-forced-software-CS.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/sys-kernel/boest-v5.0.15/raspberrypi/0157-spi-spi-bcm2835-Disable-forced-software-CS.patch b/sys-kernel/boest-v5.0.15/raspberrypi/0157-spi-spi-bcm2835-Disable-forced-software-CS.patch
new file mode 100644
index 00000000..6588b4f3
--- /dev/null
+++ b/sys-kernel/boest-v5.0.15/raspberrypi/0157-spi-spi-bcm2835-Disable-forced-software-CS.patch
@@ -0,0 +1,56 @@
+From 5c9cc75bf04898d3dd8daee121947435337f3035 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 15 Jan 2019 12:41:15 +0000
+Subject: [PATCH 157/194] spi: spi-bcm2835: Disable forced software CS
+
+With GPIO CS used by the DTBs, allow hardware CS to be selected by an
+overlay.
+
+Signed-off-by: Phil Elwell <phil@raspberrypi.org>
+---
+ drivers/spi/spi-bcm2835.c | 25 -------------------------
+ 1 file changed, 25 deletions(-)
+
+diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
+index 0344f386213d..cfaf98775a4b 100644
+--- a/drivers/spi/spi-bcm2835.c
++++ b/drivers/spi/spi-bcm2835.c
+@@ -927,8 +927,6 @@ static void bcm2835_spi_set_cs(struct spi_device *spi, bool gpio_level)
+
+ static int bcm2835_spi_setup(struct spi_device *spi)
+ {
+- int err;
+- struct gpio_chip *chip;
+ /*
+ * sanity checking the native-chipselects
+ */
+@@ -945,29 +943,6 @@ static int bcm2835_spi_setup(struct spi_device *spi)
+ "setup: only two native chip-selects are supported\n");
+ return -EINVAL;
+ }
+- /* now translate native cs to GPIO */
+-
+- /* get the gpio chip for the base */
+- chip = gpiochip_find("pinctrl-bcm2835", chip_match_name);
+- if (!chip)
+- return 0;
+-
+- /* and calculate the real CS */
+- spi->cs_gpio = chip->base + 8 - spi->chip_select;
+-
+- /* and set up the "mode" and level */
+- dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n",
+- spi->chip_select, spi->cs_gpio);
+-
+- /* set up GPIO as output and pull to the correct level */
+- err = gpio_direction_output(spi->cs_gpio,
+- (spi->mode & SPI_CS_HIGH) ? 0 : 1);
+- if (err) {
+- dev_err(&spi->dev,
+- "could not set CS%i gpio %i as output: %i",
+- spi->chip_select, spi->cs_gpio, err);
+- return err;
+- }
+
+ return 0;
+ }