From 96706600de83966812b01a3cb310a13da2a1a4e9 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sat, 6 Sep 2008 20:19:02 -0700 Subject: [PATCH] ngw100: export J15 through sysfs The NGW100 board has jumper J15 (near the reset button) which is unused. This patch exports it through the GPIO sysfs support (as /sys/class/gpio/gpio62/value) so that it's easily queried by boot scripts or whatever might want to know if the jumper has been installed (value = 0) or not (value = 1, "default"). Signed-off-by: David Brownell [haavard.skinnemoen@atmel.com: add missing include] Signed-off-by: Haavard Skinnemoen --- arch/avr32/boards/atngw100/setup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index b8286f1ce85..abcb0d9559b 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -204,6 +205,15 @@ postcore_initcall(atngw100_init); static int __init atngw100_arch_init(void) { + /* PB30 is the otherwise unused jumper on the mainboard, with an + * external pullup; the jumper grounds it. Use it however you + * like, including letting U-Boot or Linux tweak boot sequences. + */ + at32_select_gpio(GPIO_PIN_PB(30), 0); + gpio_request(GPIO_PIN_PB(30), "j15"); + gpio_direction_input(GPIO_PIN_PB(30)); + gpio_export(GPIO_PIN_PB(30), false); + /* set_irq_type() after the arch_initcall for EIC has run, and * before the I2C subsystem could try using this IRQ. */ -- 2.41.1