aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2015-02-27 17:39:49 +0000
committerJonas Gorski <jogo@openwrt.org>2015-02-27 17:39:49 +0000
commiteea227c60d593c2fe5692365936703bbebdbd1ad (patch)
tree75ffdc0a1a19758e3c30b241e7aef13f7ab25ecd /target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch
parent1efb7398e1ae9e967a9b0b1a73edb034b10ee5fc (diff)
downloadupstream-eea227c60d593c2fe5692365936703bbebdbd1ad.tar.gz
upstream-eea227c60d593c2fe5692365936703bbebdbd1ad.tar.bz2
upstream-eea227c60d593c2fe5692365936703bbebdbd1ad.zip
brcm63xx: probe gpio controllers through DT
Add a generic mmio gpio controller based driver and probe it through device tree. Use aliases for base calculation until we converted all users to device tree or named gpios. Convert bcm63xx_enet's ephy-reset gpio to use a named gpio. While at it, remove the duplicate reset gpio defintion for livebox. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 44565
Diffstat (limited to 'target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch b/target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch
new file mode 100644
index 0000000000..5be625a9ae
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.14/379-gpio-gpio-bcm63xx-use-alias-id-for-base-calculation.patch
@@ -0,0 +1,34 @@
+From 6759a62f28bb1995afe6562c0adfbbb6e8540933 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Sun, 22 Feb 2015 12:57:58 +0100
+Subject: [PATCH 6/6] gpio: gpio-bcm63xx: use alias id for base calculation
+
+Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+---
+ drivers/gpio/gpio-bcm63xx.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/gpio/gpio-bcm63xx.c
++++ b/drivers/gpio/gpio-bcm63xx.c
+@@ -32,6 +32,8 @@
+ #include <linux/of.h>
+ #include <linux/of_gpio.h>
+
++#define BCM63XX_GPIOS_PER_BANK 32
++
+ static int bcm63xx_gpio_probe(struct platform_device *pdev)
+ {
+ struct device *dev = &pdev->dev;
+@@ -73,8 +75,12 @@ static int bcm63xx_gpio_probe(struct pla
+ 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.base = id * BCM63XX_GPIOS_PER_BANK;
++
+ if (!of_property_read_u32(dev->of_node, "ngpios", &ngpios))
+ bgc->gc.ngpio = ngpios;
+