diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-06-04 09:59:28 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2009-06-04 09:59:28 +0000 |
commit | b86d85140fac67279221bfdac1d85fdbb0254f97 (patch) | |
tree | 438ad9538b87a975a2829f718319a56fc0e24742 /target | |
parent | 77bd54ed2c6ad683949c2acc993fee6f19ce1c3c (diff) | |
download | upstream-b86d85140fac67279221bfdac1d85fdbb0254f97.tar.gz upstream-b86d85140fac67279221bfdac1d85fdbb0254f97.tar.bz2 upstream-b86d85140fac67279221bfdac1d85fdbb0254f97.zip |
[brcm63xx] register gpiochip earlier, allowing gpio-based runtime detection to be performed in board_init callback
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16328 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
3 files changed, 9 insertions, 2 deletions
diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c index b78d3fdafa..997fcaa439 100644 --- a/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c +++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/gpio.c @@ -120,9 +120,8 @@ static struct gpio_chip bcm63xx_gpio_chip = { .ngpio = BCM63XX_GPIO_COUNT, }; -static int __init bcm63xx_gpio_init(void) +int __init bcm63xx_gpio_init(void) { printk(KERN_INFO "registering %d GPIOs\n", BCM63XX_GPIO_COUNT); return gpiochip_add(&bcm63xx_gpio_chip); } -arch_initcall(bcm63xx_gpio_init); diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/prom.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/prom.c index db0ef555a8..964a1479c6 100644 --- a/target/linux/brcm63xx/files/arch/mips/bcm63xx/prom.c +++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/prom.c @@ -13,6 +13,7 @@ #include <bcm63xx_cpu.h> #include <bcm63xx_io.h> #include <bcm63xx_regs.h> +#include <bcm63xx_gpio.h> void __init prom_init(void) { @@ -42,6 +43,9 @@ void __init prom_init(void) /* assign command line from kernel config */ strcpy(arcs_cmdline, CONFIG_CMDLINE); + /* register gpiochip */ + bcm63xx_gpio_init(); + /* do low level board init */ board_prom_init(); } 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 72cee75f0a..7f5d8e87d0 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 @@ -1,6 +1,10 @@ #ifndef BCM63XX_GPIO_H #define BCM63XX_GPIO_H +#include <linux/init.h> + +int __init bcm63xx_gpio_init(void); + /* all helpers will BUG() if gpio count is >= 37. */ #define BCM63XX_GPIO_COUNT 37 |