aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2015-02-28 19:59:26 +0000
committerJonas Gorski <jogo@openwrt.org>2015-02-28 19:59:26 +0000
commitc2a89871c29da6399c76796dc7d28eda8298f0bc (patch)
tree69d221d67ac967936efc91a7f8eefc6e976d76e6 /target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch
parent15fb17791a6fe75fb962800b51af3b78e653d9ea (diff)
downloadupstream-c2a89871c29da6399c76796dc7d28eda8298f0bc.tar.gz
upstream-c2a89871c29da6399c76796dc7d28eda8298f0bc.tar.bz2
upstream-c2a89871c29da6399c76796dc7d28eda8298f0bc.zip
brcm63xx: fix gpio register usage
The driver expected data then dir, but both dts and legacy code passed dir then data. Fix this by making the driver expect the registers in ascending order, i.e. dir then data. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 44574
Diffstat (limited to 'target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch8
1 files changed, 4 insertions, 4 deletions
diff --git a/target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch b/target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch
index 24dd3a9d10..d561e43f8c 100644
--- a/target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch
+++ b/target/linux/brcm63xx/patches-3.14/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch
@@ -100,7 +100,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
- u32 mask;
+ res[0].flags = IORESOURCE_MEM;
+ res[0].start = bcm63xx_regset_address(RSET_GPIO);
-+ res[0].start += data;
++ res[0].start += dir;
- if (gpio >= chip->ngpio)
- BUG();
@@ -115,7 +115,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
- }
+ res[1].flags = IORESOURCE_MEM;
+ res[1].start = bcm63xx_regset_address(RSET_GPIO);
-+ res[1].start += dir;
++ res[1].start += data;
- return !!(bcm_gpio_readl(reg) & mask);
-}
@@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+ else
+ data_low_reg = GPIO_DATA_LO_REG;
-+ bcm63xx_gpio_init_one(0, data_low_reg, GPIO_CTL_LO_REG, min(ngpio, 32));
++ bcm63xx_gpio_init_one(0, GPIO_CTL_LO_REG, data_low_reg, min(ngpio, 32));
-static struct gpio_chip bcm63xx_gpio_chip = {
- .label = "bcm63xx-gpio",
@@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
-int __init bcm63xx_gpio_init(void)
-{
- bcm63xx_gpio_out_low_reg_init();
-+ bcm63xx_gpio_init_one(1, GPIO_DATA_HI_REG, GPIO_CTL_HI_REG, ngpio - 32);
++ bcm63xx_gpio_init_one(1, GPIO_CTL_HI_REG, GPIO_DATA_HI_REG, ngpio - 32);
- gpio_out_low = bcm_gpio_readl(gpio_out_low_reg);
- if (!BCMCPU_IS_6345())