summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2015-03-31 21:31:36 +0000
committerGabor Juhos <juhosg@openwrt.org>2015-03-31 21:31:36 +0000
commit36e10677df06c7ce01c434736ffb37c53735fd0b (patch)
tree91878235a0666c7f5c54a8a0d4fa3be7031eaf7c /target
parent9c5aa7c528b45670a988a8c190acc06abe8a09c6 (diff)
downloadmtk-20170518-36e10677df06c7ce01c434736ffb37c53735fd0b.zip
mtk-20170518-36e10677df06c7ce01c434736ffb37c53735fd0b.tar.gz
mtk-20170518-36e10677df06c7ce01c434736ffb37c53735fd0b.tar.bz2
ar71xx: fix platform device support in the gpio-74x164 driver
Platform device support has been removed from the gpio-74x164 driver in 3.14. Restore that. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 45203
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/patches-3.18/451-gpio-74x164-improve-platform-device-support.patch45
1 files changed, 43 insertions, 2 deletions
diff --git a/target/linux/ar71xx/patches-3.18/451-gpio-74x164-improve-platform-device-support.patch b/target/linux/ar71xx/patches-3.18/451-gpio-74x164-improve-platform-device-support.patch
index ed95f5e..5d29fae 100644
--- a/target/linux/ar71xx/patches-3.18/451-gpio-74x164-improve-platform-device-support.patch
+++ b/target/linux/ar71xx/patches-3.18/451-gpio-74x164-improve-platform-device-support.patch
@@ -1,6 +1,14 @@
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
-@@ -107,8 +107,18 @@ static int gen_74x164_direction_output(s
+@@ -12,6 +12,7 @@
+ #include <linux/init.h>
+ #include <linux/mutex.h>
+ #include <linux/spi/spi.h>
++#include <linux/spi/74x164.h>
+ #include <linux/gpio.h>
+ #include <linux/of_gpio.h>
+ #include <linux/slab.h>
+@@ -107,8 +108,18 @@ static int gen_74x164_direction_output(s
static int gen_74x164_probe(struct spi_device *spi)
{
struct gen_74x164_chip *chip;
@@ -19,7 +27,7 @@
/*
* bits_per_word cannot be configured in platform data
*/
-@@ -130,18 +140,27 @@ static int gen_74x164_probe(struct spi_d
+@@ -130,18 +141,28 @@ static int gen_74x164_probe(struct spi_d
chip->gpio_chip.set = gen_74x164_set_value;
chip->gpio_chip.base = -1;
@@ -35,6 +43,7 @@
+ goto exit_destroy;
+ }
+ } else if (pdata) {
++ chip->gpio_chip.base = pdata->base;
+ chip->registers = pdata->num_registers;
}
@@ -52,6 +61,27 @@
chip->gpio_chip.can_sleep = true;
chip->gpio_chip.dev = &spi->dev;
chip->gpio_chip.owner = THIS_MODULE;
+@@ -174,17 +195,19 @@ static int gen_74x164_remove(struct spi_
+ return 0;
+ }
+
++#ifdef CONFIG_OF
+ static const struct of_device_id gen_74x164_dt_ids[] = {
+ { .compatible = "fairchild,74hc595" },
+ {},
+ };
+ MODULE_DEVICE_TABLE(of, gen_74x164_dt_ids);
++#endif /* CONFIG_OF */
+
+ static struct spi_driver gen_74x164_driver = {
+ .driver = {
+ .name = "74x164",
+ .owner = THIS_MODULE,
+- .of_match_table = gen_74x164_dt_ids,
++ .of_match_table = of_match_ptr(gen_74x164_dt_ids),
+ },
+ .probe = gen_74x164_probe,
+ .remove = gen_74x164_remove,
--- /dev/null
+++ b/include/linux/spi/74x164.h
@@ -0,0 +1,13 @@
@@ -68,3 +98,14 @@
+};
+
+#endif
+--- a/drivers/gpio/Kconfig
++++ b/drivers/gpio/Kconfig
+@@ -821,7 +821,7 @@ config GPIO_MC33880
+
+ config GPIO_74X164
+ tristate "74x164 serial-in/parallel-out 8-bits shift register"
+- depends on SPI_MASTER && OF
++ depends on SPI_MASTER
+ help
+ Driver for 74x164 compatible serial-in/parallel-out 8-outputs
+ shift registers. This driver can be used to provide access