1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-25 03:13:20 +02:00

[brcm63xx] use the correct number of GPIOs for bcm6358

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16329 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2009-06-04 10:01:03 +00:00
parent f1fc76fbaa
commit 848fab305c
3 changed files with 12 additions and 6 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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