diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2014-03-30 19:08:37 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2014-03-30 19:08:37 +0000 |
commit | 111e9f18883849552a2e09a149e676f67348aa2f (patch) | |
tree | a66937225abf4a9f9d16cd11a1d4bcbc30a95694 /target | |
parent | 30de67d40915074d15e73cc57baa73cf9898a560 (diff) | |
download | upstream-111e9f18883849552a2e09a149e676f67348aa2f.tar.gz upstream-111e9f18883849552a2e09a149e676f67348aa2f.tar.bz2 upstream-111e9f18883849552a2e09a149e676f67348aa2f.zip |
kernel: backport BCM5357 fix for GPIOs
This backports: bcma: gpio: register 32 GPIOs on BCM5357
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40347 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
4 files changed, 54 insertions, 9 deletions
diff --git a/target/linux/generic/patches-3.10/025-bcma_backport.patch b/target/linux/generic/patches-3.10/025-bcma_backport.patch index ca911cdcc2..c3f7ffb354 100644 --- a/target/linux/generic/patches-3.10/025-bcma_backport.patch +++ b/target/linux/generic/patches-3.10/025-bcma_backport.patch @@ -479,17 +479,26 @@ chip->label = "bcma_gpio"; chip->owner = THIS_MODULE; -@@ -95,7 +215,9 @@ int bcma_gpio_init(struct bcma_drv_cc *c +@@ -95,8 +215,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c chip->set = bcma_gpio_set_value; chip->direction_input = bcma_gpio_direction_input; chip->direction_output = bcma_gpio_direction_output; +#if IS_BUILTIN(CONFIG_BCMA_HOST_SOC) chip->to_irq = bcma_gpio_to_irq; +- chip->ngpio = 16; +#endif - chip->ngpio = 16; ++ switch (cc->core->bus->chipinfo.id) { ++ case BCMA_CHIP_ID_BCM5357: ++ chip->ngpio = 32; ++ break; ++ default: ++ chip->ngpio = 16; ++ } ++ /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get -@@ -105,10 +227,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c + * a random base number. */ +@@ -105,10 +234,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c else chip->base = -1; diff --git a/target/linux/generic/patches-3.12/025-bcma_backport.patch b/target/linux/generic/patches-3.12/025-bcma_backport.patch index 3e86f69f42..1b88dfdda0 100644 --- a/target/linux/generic/patches-3.12/025-bcma_backport.patch +++ b/target/linux/generic/patches-3.12/025-bcma_backport.patch @@ -198,17 +198,26 @@ chip->label = "bcma_gpio"; chip->owner = THIS_MODULE; -@@ -95,7 +215,9 @@ int bcma_gpio_init(struct bcma_drv_cc *c +@@ -95,8 +215,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c chip->set = bcma_gpio_set_value; chip->direction_input = bcma_gpio_direction_input; chip->direction_output = bcma_gpio_direction_output; +#if IS_BUILTIN(CONFIG_BCMA_HOST_SOC) chip->to_irq = bcma_gpio_to_irq; +- chip->ngpio = 16; +#endif - chip->ngpio = 16; ++ switch (cc->core->bus->chipinfo.id) { ++ case BCMA_CHIP_ID_BCM5357: ++ chip->ngpio = 32; ++ break; ++ default: ++ chip->ngpio = 16; ++ } ++ /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get -@@ -105,10 +227,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c + * a random base number. */ +@@ -105,10 +234,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c else chip->base = -1; diff --git a/target/linux/generic/patches-3.13/025-bcma_backport.patch b/target/linux/generic/patches-3.13/025-bcma_backport.patch index 3aad2a16db..dcb712dbbc 100644 --- a/target/linux/generic/patches-3.13/025-bcma_backport.patch +++ b/target/linux/generic/patches-3.13/025-bcma_backport.patch @@ -198,17 +198,26 @@ chip->label = "bcma_gpio"; chip->owner = THIS_MODULE; -@@ -95,7 +215,9 @@ int bcma_gpio_init(struct bcma_drv_cc *c +@@ -95,8 +215,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c chip->set = bcma_gpio_set_value; chip->direction_input = bcma_gpio_direction_input; chip->direction_output = bcma_gpio_direction_output; +#if IS_BUILTIN(CONFIG_BCMA_HOST_SOC) chip->to_irq = bcma_gpio_to_irq; +- chip->ngpio = 16; +#endif - chip->ngpio = 16; ++ switch (cc->core->bus->chipinfo.id) { ++ case BCMA_CHIP_ID_BCM5357: ++ chip->ngpio = 32; ++ break; ++ default: ++ chip->ngpio = 16; ++ } ++ /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get -@@ -105,10 +227,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c + * a random base number. */ +@@ -105,10 +234,21 @@ int bcma_gpio_init(struct bcma_drv_cc *c else chip->base = -1; diff --git a/target/linux/generic/patches-3.14/025-bcma_backport.patch b/target/linux/generic/patches-3.14/025-bcma_backport.patch new file mode 100644 index 0000000000..b49d345473 --- /dev/null +++ b/target/linux/generic/patches-3.14/025-bcma_backport.patch @@ -0,0 +1,18 @@ +--- a/drivers/bcma/driver_gpio.c ++++ b/drivers/bcma/driver_gpio.c +@@ -218,7 +218,14 @@ int bcma_gpio_init(struct bcma_drv_cc *c + #if IS_BUILTIN(CONFIG_BCMA_HOST_SOC) + chip->to_irq = bcma_gpio_to_irq; + #endif +- chip->ngpio = 16; ++ switch (cc->core->bus->chipinfo.id) { ++ case BCMA_CHIP_ID_BCM5357: ++ chip->ngpio = 32; ++ break; ++ default: ++ chip->ngpio = 16; ++ } ++ + /* There is just one SoC in one device and its GPIO addresses should be + * deterministic to address them more easily. The other buses could get + * a random base number. */ |