aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2015-03-16 13:37:38 +0000
committerJonas Gorski <jogo@openwrt.org>2015-03-16 13:37:38 +0000
commitad99d837467e7f036300a6c6cfe0281289ce5fda (patch)
treeb98398bcab26cead9bc2a40c3e9d7c93acdf60c0 /target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
parentad457afeef7a522b995006affc84981c034466b6 (diff)
downloadmaster-187ad058-ad99d837467e7f036300a6c6cfe0281289ce5fda.tar.gz
master-187ad058-ad99d837467e7f036300a6c6cfe0281289ce5fda.tar.bz2
master-187ad058-ad99d837467e7f036300a6c6cfe0281289ce5fda.zip
brcm63xx: use consistent gpio chip labeling for OF/non-OF
Ensure gpio chips are always labeled the same; this allows simplifying any arch setup gpio lookups. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44846 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch11
1 files changed, 8 insertions, 3 deletions
diff --git a/target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch b/target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
index 53fcb8a3f5..3e53c80606 100644
--- a/target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
+++ b/target/linux/brcm63xx/patches-3.18/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
@@ -8,8 +8,8 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
drivers/gpio/Kconfig | 8 +++
drivers/gpio/Makefile | 1 +
- drivers/gpio/gpio-bcm63xx.c | 117 +++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 126 insertions(+)
+ drivers/gpio/gpio-bcm63xx.c | 122 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 131 insertions(+)
create mode 100644 drivers/gpio/gpio-bcm63xx.c
--- a/drivers/gpio/Kconfig
@@ -41,7 +41,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
obj-$(CONFIG_GPIO_CS5535) += gpio-cs5535.o
--- /dev/null
+++ b/drivers/gpio/gpio-bcm63xx.c
-@@ -0,0 +1,117 @@
+@@ -0,0 +1,122 @@
+/*
+ * Driver for BCM63XX memory-mapped GPIO controllers, based on
+ * Generic driver for memory-mapped GPIO controllers.
@@ -117,8 +117,13 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+ platform_set_drvdata(pdev, bgc);
+
+ if (dev->of_node) {
++ int id = of_alias_get_id(dev->of_node, "gpio");
+ u32 ngpios;
+
++ if (id >= 0)
++ bgc->gc.label = devm_kasprintf(dev, GFP_KERNEL,
++ "bcm63xx-gpio.%d", id);
++
+ if (!of_property_read_u32(dev->of_node, "ngpios", &ngpios))
+ bgc->gc.ngpio = ngpios;
+