aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-08 21:58:55 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-14 14:10:51 +0100
commit7d7aa2fd924c27829ec25f825481554dd81bce97 (patch)
tree658b87b89331670266163e522ea5fb52535633cb /target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch
parente7bfda2c243e66a75ff966ba04c28b1590b5d24c (diff)
downloadupstream-7d7aa2fd924c27829ec25f825481554dd81bce97.tar.gz
upstream-7d7aa2fd924c27829ec25f825481554dd81bce97.tar.bz2
upstream-7d7aa2fd924c27829ec25f825481554dd81bce97.zip
brcm2708: rename target to bcm27xx
This change makes the names of Broadcom targets consistent by using the common notation based on SoC/CPU ID (which is used internally anyway), bcmXXXX instead of brcmXXXX. This is even used for target TITLE in make menuconfig already, only the short target name used brcm so far. Despite, since subtargets range from bcm2708 to bcm2711, it seems appropriate to use bcm27xx instead of bcm2708 (again, as already done for BOARDNAME). This also renames the packages brcm2708-userland and brcm2708-gpu-fw. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch')
-rw-r--r--target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch b/target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch
new file mode 100644
index 0000000000..41d6c8d363
--- /dev/null
+++ b/target/linux/bcm27xx/patches-4.19/950-0012-spi-bcm2835-Remove-unused-code.patch
@@ -0,0 +1,88 @@
+From 80dc41f5617db0dbe3e17a399603a50b91997c5b Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 8 Nov 2016 21:35:38 +0000
+Subject: [PATCH] spi-bcm2835: Remove unused code
+
+---
+ drivers/spi/spi-bcm2835.c | 61 ---------------------------------------
+ 1 file changed, 61 deletions(-)
+
+--- a/drivers/spi/spi-bcm2835.c
++++ b/drivers/spi/spi-bcm2835.c
+@@ -678,17 +678,8 @@ static void bcm2835_spi_set_cs(struct sp
+ bcm2835_wr(bs, BCM2835_SPI_CS, cs);
+ }
+
+-static int chip_match_name(struct gpio_chip *chip, void *data)
+-{
+- return !strcmp(chip->label, data);
+-}
+-
+ static int bcm2835_spi_setup(struct spi_device *spi)
+ {
+- int err;
+- struct gpio_chip *chip;
+- struct device_node *pins;
+- u32 pingroup_index;
+ /*
+ * sanity checking the native-chipselects
+ */
+@@ -706,58 +697,6 @@ static int bcm2835_spi_setup(struct spi_
+ return -EINVAL;
+ }
+
+-#if 0
+- /* now translate native cs to GPIO */
+- /* first look for chip select pins in the devices pin groups */
+- for (pingroup_index = 0;
+- (pins = of_parse_phandle(spi->master->dev.of_node,
+- "pinctrl-0",
+- pingroup_index)) != 0;
+- pingroup_index++) {
+- u32 pin;
+- u32 pin_index;
+- for (pin_index = 0;
+- of_property_read_u32_index(pins,
+- "brcm,pins",
+- pin_index,
+- &pin) == 0;
+- pin_index++) {
+- if (((spi->chip_select == 0) &&
+- ((pin == 8) || (pin == 36) || (pin == 46))) ||
+- ((spi->chip_select == 1) &&
+- ((pin == 7) || (pin == 35)))) {
+- spi->cs_gpio = pin;
+- break;
+- }
+- }
+- of_node_put(pins);
+- }
+- /* if that fails, assume GPIOs 7-11 are used */
+- if (!gpio_is_valid(spi->cs_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;
+- }
+-#endif
+-
+ return 0;
+ }
+