diff options
author | Jonas Gorski <jogo@openwrt.org> | 2015-02-28 19:59:26 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2015-02-28 19:59:26 +0000 |
commit | cd2b8886d9772f77975949b38434147f01169692 (patch) | |
tree | d476f123bdd896643b16360c2882d729999fc989 /target | |
parent | a398026d1658372cb1ee469b0c7315be974441cb (diff) | |
download | upstream-cd2b8886d9772f77975949b38434147f01169692.tar.gz upstream-cd2b8886d9772f77975949b38434147f01169692.tar.bz2 upstream-cd2b8886d9772f77975949b38434147f01169692.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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44574 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
4 files changed, 12 insertions, 12 deletions
diff --git a/target/linux/brcm63xx/patches-3.14/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch b/target/linux/brcm63xx/patches-3.14/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch index 7d1cd28bb3..2a07e735ca 100644 --- a/target/linux/brcm63xx/patches-3.14/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch +++ b/target/linux/brcm63xx/patches-3.14/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch @@ -87,8 +87,8 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org> + struct bgpio_chip *bgc; + struct bgpio_pdata *pdata = dev_get_platdata(dev); + -+ dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); + if (!dat_r || !dirout_r) + return -EINVAL; + 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()) 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 82d7abec60..53fcb8a3f5 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 @@ -87,8 +87,8 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org> + struct bgpio_chip *bgc; + struct bgpio_pdata *pdata = dev_get_platdata(dev); + -+ dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 1); + if (!dat_r || !dirout_r) + return -EINVAL; + diff --git a/target/linux/brcm63xx/patches-3.18/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch b/target/linux/brcm63xx/patches-3.18/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch index 24dd3a9d10..d561e43f8c 100644 --- a/target/linux/brcm63xx/patches-3.18/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch +++ b/target/linux/brcm63xx/patches-3.18/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()) |