diff options
author | Johannes Weiner <jw@emlix.com> | 2009-05-11 17:43:34 +0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2009-05-12 09:00:07 +0400 |
commit | 1fb137c1e33cd188b40b3c0d7283412efeeb783f (patch) | |
tree | 3cb2744c809158f9db7c8abae397c0069c8cf359 /arch | |
parent | 586411dcd1935f91796d5e8a29aa3cfdf01a01f4 (diff) | |
download | linux-1fb137c1e33cd188b40b3c0d7283412efeeb783f.tar.xz |
xtensa: register gpio chip before use
Platform initialization sets up the LED heartbeat that is controlled
via GPIO. Requesting the GPIO pins fails, however, as the chip is
only initialized later by a device_initcall().
Fix this up by exporting the initialization function. Let the
platform set up the chip before it starts using it.
Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/xtensa/platforms/s6105/setup.c | 3 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/gpio.c | 3 | ||||
-rw-r--r-- | arch/xtensa/variants/s6000/include/variant/gpio.h | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/arch/xtensa/platforms/s6105/setup.c b/arch/xtensa/platforms/s6105/setup.c index ae041d5027a2..855ddeadc43d 100644 --- a/arch/xtensa/platforms/s6105/setup.c +++ b/arch/xtensa/platforms/s6105/setup.c @@ -10,6 +10,8 @@ #include <asm/bootparam.h> #include <variant/hardware.h> +#include <variant/gpio.h> + #include <platform/gpio.h> void platform_halt(void) @@ -47,6 +49,7 @@ void __init platform_setup(char **cmdline) void __init platform_init(bp_tag_t *first) { + s6_gpio_init(); gpio_request(GPIO_LED1_NGREEN, "led1_green"); gpio_request(GPIO_LED1_RED, "led1_red"); gpio_direction_output(GPIO_LED1_NGREEN, 1); diff --git a/arch/xtensa/variants/s6000/gpio.c b/arch/xtensa/variants/s6000/gpio.c index 33a8d952934c..79317fdcf14c 100644 --- a/arch/xtensa/variants/s6000/gpio.c +++ b/arch/xtensa/variants/s6000/gpio.c @@ -64,8 +64,7 @@ static struct gpio_chip gpiochip = { .exported = 0, /* no exporting to userspace */ }; -static int gpio_init(void) +int s6_gpio_init(void) { return gpiochip_add(&gpiochip); } -device_initcall(gpio_init); diff --git a/arch/xtensa/variants/s6000/include/variant/gpio.h b/arch/xtensa/variants/s6000/include/variant/gpio.h new file mode 100644 index 000000000000..8327f62167eb --- /dev/null +++ b/arch/xtensa/variants/s6000/include/variant/gpio.h @@ -0,0 +1,6 @@ +#ifndef _XTENSA_VARIANT_S6000_GPIO_H +#define _XTENSA_VARIANT_S6000_GPIO_H + +extern int s6_gpio_init(void); + +#endif /* _XTENSA_VARIANT_S6000_GPIO_H */ |