summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-06-04 10:01:03 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-06-04 10:01:03 +0000
commit1208ffaedb5e7472a15427dd91ae237146305ab5 (patch)
tree385bc648a109c1ea147db943fda6da2d25352ed0 /target/linux/brcm63xx
parentc95420f06d5d62fa91eb5ecdf6574d6da5262f3e (diff)
downloadmtk-20170518-1208ffaedb5e7472a15427dd91ae237146305ab5.zip
mtk-20170518-1208ffaedb5e7472a15427dd91ae237146305ab5.tar.gz
mtk-20170518-1208ffaedb5e7472a15427dd91ae237146305ab5.tar.bz2
use the correct number of GPIOs for bcm6358
SVN-Revision: 16329
Diffstat (limited to 'target/linux/brcm63xx')
-rw-r--r--target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c4
-rw-r--r--target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h12
-rw-r--r--target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h2
3 files changed, 12 insertions, 6 deletions
diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c
index 997fcaa..97e3730 100644
--- a/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c
+++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c
@@ -117,11 +117,11 @@ static struct gpio_chip bcm63xx_gpio_chip = {
.get = bcm63xx_gpio_get,
.set = bcm63xx_gpio_set,
.base = 0,
- .ngpio = BCM63XX_GPIO_COUNT,
};
int __init bcm63xx_gpio_init(void)
{
- printk(KERN_INFO "registering %d GPIOs\n", BCM63XX_GPIO_COUNT);
+ bcm63xx_gpio_chip.ngpio = bcm63xx_gpio_count();
+ printk(KERN_INFO "registering %d GPIOs\n", bcm63xx_gpio_chip.ngpio);
return gpiochip_add(&bcm63xx_gpio_chip);
}
diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h b/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h
index 7f5d8e8..76a0b72 100644
--- a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h
+++ b/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/bcm63xx_gpio.h
@@ -5,8 +5,16 @@
int __init bcm63xx_gpio_init(void);
-/* all helpers will BUG() if gpio count is >= 37. */
-#define BCM63XX_GPIO_COUNT 37
+static inline unsigned long bcm63xx_gpio_count(void)
+{
+ switch (bcm63xx_get_cpu_id()) {
+ case BCM6358_CPU_ID:
+ return 40;
+ case BCM6348_CPU_ID:
+ default:
+ return 37;
+ }
+}
#define GPIO_DIR_OUT 0x0
#define GPIO_DIR_IN 0x1
diff --git a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h b/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h
index 033c997..7cda8c0 100644
--- a/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h
+++ b/target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx/gpio.h
@@ -3,8 +3,6 @@
#include <bcm63xx_gpio.h>
-#define NR_BUILTIN_GPIO BCM63XX_GPIO_COUNT
-
#define gpio_to_irq(gpio) NULL
#define gpio_get_value __gpio_get_value