1 From 80dc41f5617db0dbe3e17a399603a50b91997c5b Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 8 Nov 2016 21:35:38 +0000
4 Subject: [PATCH] spi-bcm2835: Remove unused code
7 drivers/spi/spi-bcm2835.c | 61 ---------------------------------------
8 1 file changed, 61 deletions(-)
10 --- a/drivers/spi/spi-bcm2835.c
11 +++ b/drivers/spi/spi-bcm2835.c
12 @@ -678,17 +678,8 @@ static void bcm2835_spi_set_cs(struct sp
13 bcm2835_wr(bs, BCM2835_SPI_CS, cs);
16 -static int chip_match_name(struct gpio_chip *chip, void *data)
18 - return !strcmp(chip->label, data);
21 static int bcm2835_spi_setup(struct spi_device *spi)
24 - struct gpio_chip *chip;
25 - struct device_node *pins;
28 * sanity checking the native-chipselects
30 @@ -706,58 +697,6 @@ static int bcm2835_spi_setup(struct spi_
35 - /* now translate native cs to GPIO */
36 - /* first look for chip select pins in the devices pin groups */
37 - for (pingroup_index = 0;
38 - (pins = of_parse_phandle(spi->master->dev.of_node,
40 - pingroup_index)) != 0;
45 - of_property_read_u32_index(pins,
50 - if (((spi->chip_select == 0) &&
51 - ((pin == 8) || (pin == 36) || (pin == 46))) ||
52 - ((spi->chip_select == 1) &&
53 - ((pin == 7) || (pin == 35)))) {
60 - /* if that fails, assume GPIOs 7-11 are used */
61 - if (!gpio_is_valid(spi->cs_gpio) ) {
62 - /* get the gpio chip for the base */
63 - chip = gpiochip_find("pinctrl-bcm2835", chip_match_name);
67 - /* and calculate the real CS */
68 - spi->cs_gpio = chip->base + 8 - spi->chip_select;
71 - /* and set up the "mode" and level */
72 - dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n",
73 - spi->chip_select, spi->cs_gpio);
75 - /* set up GPIO as output and pull to the correct level */
76 - err = gpio_direction_output(spi->cs_gpio,
77 - (spi->mode & SPI_CS_HIGH) ? 0 : 1);
80 - "could not set CS%i gpio %i as output: %i",
81 - spi->chip_select, spi->cs_gpio, err);