aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpio/Kconfig6
-rw-r--r--drivers/gpio/gpio-74x164.c14
-rw-r--r--include/linux/spi/74x164.h9
3 files changed, 4 insertions, 25 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index ae3682d25a3c..4127f68412eb 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -714,10 +714,10 @@ config GPIO_MC33880
714 714
715config GPIO_74X164 715config GPIO_74X164
716 tristate "74x164 serial-in/parallel-out 8-bits shift register" 716 tristate "74x164 serial-in/parallel-out 8-bits shift register"
717 depends on SPI_MASTER 717 depends on SPI_MASTER && OF
718 help 718 help
719 Platform driver for 74x164 compatible serial-in/parallel-out 719 Driver for 74x164 compatible serial-in/parallel-out 8-outputs
720 8-outputs shift registers. This driver can be used to provide access 720 shift registers. This driver can be used to provide access
721 to more gpio outputs. 721 to more gpio outputs.
722 722
723comment "AC97 GPIO expanders:" 723comment "AC97 GPIO expanders:"
diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index ddb831232407..4d4e15ca67e0 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -12,7 +12,6 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/mutex.h> 13#include <linux/mutex.h>
14#include <linux/spi/spi.h> 14#include <linux/spi/spi.h>
15#include <linux/spi/74x164.h>
16#include <linux/gpio.h> 15#include <linux/gpio.h>
17#include <linux/of_gpio.h> 16#include <linux/of_gpio.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
@@ -108,14 +107,8 @@ static int gen_74x164_direction_output(struct gpio_chip *gc,
108static int gen_74x164_probe(struct spi_device *spi) 107static int gen_74x164_probe(struct spi_device *spi)
109{ 108{
110 struct gen_74x164_chip *chip; 109 struct gen_74x164_chip *chip;
111 struct gen_74x164_chip_platform_data *pdata;
112 int ret; 110 int ret;
113 111
114 if (!spi->dev.of_node) {
115 dev_err(&spi->dev, "No device tree data available.\n");
116 return -EINVAL;
117 }
118
119 /* 112 /*
120 * bits_per_word cannot be configured in platform data 113 * bits_per_word cannot be configured in platform data
121 */ 114 */
@@ -129,12 +122,6 @@ static int gen_74x164_probe(struct spi_device *spi)
129 if (!chip) 122 if (!chip)
130 return -ENOMEM; 123 return -ENOMEM;
131 124
132 pdata = dev_get_platdata(&spi->dev);
133 if (pdata && pdata->base)
134 chip->gpio_chip.base = pdata->base;
135 else
136 chip->gpio_chip.base = -1;
137
138 mutex_init(&chip->lock); 125 mutex_init(&chip->lock);
139 126
140 spi_set_drvdata(spi, chip); 127 spi_set_drvdata(spi, chip);
@@ -145,6 +132,7 @@ static int gen_74x164_probe(struct spi_device *spi)
145 chip->gpio_chip.direction_output = gen_74x164_direction_output; 132 chip->gpio_chip.direction_output = gen_74x164_direction_output;
146 chip->gpio_chip.get = gen_74x164_get_value; 133 chip->gpio_chip.get = gen_74x164_get_value;
147 chip->gpio_chip.set = gen_74x164_set_value; 134 chip->gpio_chip.set = gen_74x164_set_value;
135 chip->gpio_chip.base = -1;
148 136
149 if (of_property_read_u32(spi->dev.of_node, "registers-number", &chip->registers)) { 137 if (of_property_read_u32(spi->dev.of_node, "registers-number", &chip->registers)) {
150 dev_err(&spi->dev, "Missing registers-number property in the DT.\n"); 138 dev_err(&spi->dev, "Missing registers-number property in the DT.\n");
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
deleted file mode 100644
index 0aa6acc73317..000000000000
--- a/include/linux/spi/74x164.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H
3
4struct gen_74x164_chip_platform_data {
5 /* number assigned to the first GPIO */
6 unsigned base;
7};
8
9#endif