diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-apollon.c')
-rw-r--r-- | arch/arm/mach-omap2/board-apollon.c | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index bf1e5d32c2a3..0a7b24ba1652 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -22,8 +22,6 @@ | |||
22 | #include <linux/mtd/mtd.h> | 22 | #include <linux/mtd/mtd.h> |
23 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | #include <linux/mtd/onenand.h> | 24 | #include <linux/mtd/onenand.h> |
25 | #include <linux/irq.h> | ||
26 | #include <linux/interrupt.h> | ||
27 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
28 | #include <linux/leds.h> | 26 | #include <linux/leds.h> |
29 | #include <linux/err.h> | 27 | #include <linux/err.h> |
@@ -282,65 +280,16 @@ static void __init apollon_led_init(void) | |||
282 | { | 280 | { |
283 | /* LED0 - AA10 */ | 281 | /* LED0 - AA10 */ |
284 | omap_cfg_reg(AA10_242X_GPIO13); | 282 | omap_cfg_reg(AA10_242X_GPIO13); |
285 | omap_request_gpio(LED0_GPIO13); | 283 | gpio_request(LED0_GPIO13, "LED0"); |
286 | omap_set_gpio_direction(LED0_GPIO13, 0); | 284 | gpio_direction_output(LED0_GPIO13, 0); |
287 | omap_set_gpio_dataout(LED0_GPIO13, 0); | ||
288 | /* LED1 - AA6 */ | 285 | /* LED1 - AA6 */ |
289 | omap_cfg_reg(AA6_242X_GPIO14); | 286 | omap_cfg_reg(AA6_242X_GPIO14); |
290 | omap_request_gpio(LED1_GPIO14); | 287 | gpio_request(LED1_GPIO14, "LED1"); |
291 | omap_set_gpio_direction(LED1_GPIO14, 0); | 288 | gpio_direction_output(LED1_GPIO14, 0); |
292 | omap_set_gpio_dataout(LED1_GPIO14, 0); | ||
293 | /* LED2 - AA4 */ | 289 | /* LED2 - AA4 */ |
294 | omap_cfg_reg(AA4_242X_GPIO15); | 290 | omap_cfg_reg(AA4_242X_GPIO15); |
295 | omap_request_gpio(LED2_GPIO15); | 291 | gpio_request(LED2_GPIO15, "LED2"); |
296 | omap_set_gpio_direction(LED2_GPIO15, 0); | 292 | gpio_direction_output(LED2_GPIO15, 0); |
297 | omap_set_gpio_dataout(LED2_GPIO15, 0); | ||
298 | } | ||
299 | |||
300 | static irqreturn_t apollon_sw_interrupt(int irq, void *ignored) | ||
301 | { | ||
302 | static unsigned int led0, led1, led2; | ||
303 | |||
304 | if (irq == OMAP_GPIO_IRQ(SW_ENTER_GPIO16)) | ||
305 | omap_set_gpio_dataout(LED0_GPIO13, led0 ^= 1); | ||
306 | else if (irq == OMAP_GPIO_IRQ(SW_UP_GPIO17)) | ||
307 | omap_set_gpio_dataout(LED1_GPIO14, led1 ^= 1); | ||
308 | else if (irq == OMAP_GPIO_IRQ(SW_DOWN_GPIO58)) | ||
309 | omap_set_gpio_dataout(LED2_GPIO15, led2 ^= 1); | ||
310 | |||
311 | return IRQ_HANDLED; | ||
312 | } | ||
313 | |||
314 | static void __init apollon_sw_init(void) | ||
315 | { | ||
316 | /* Enter SW - Y11 */ | ||
317 | omap_cfg_reg(Y11_242X_GPIO16); | ||
318 | omap_request_gpio(SW_ENTER_GPIO16); | ||
319 | gpio_direction_input(SW_ENTER_GPIO16); | ||
320 | /* Up SW - AA12 */ | ||
321 | omap_cfg_reg(AA12_242X_GPIO17); | ||
322 | omap_request_gpio(SW_UP_GPIO17); | ||
323 | gpio_direction_input(SW_UP_GPIO17); | ||
324 | /* Down SW - AA8 */ | ||
325 | omap_cfg_reg(AA8_242X_GPIO58); | ||
326 | omap_request_gpio(SW_DOWN_GPIO58); | ||
327 | gpio_direction_input(SW_DOWN_GPIO58); | ||
328 | |||
329 | set_irq_type(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), IRQ_TYPE_EDGE_RISING); | ||
330 | if (request_irq(OMAP_GPIO_IRQ(SW_ENTER_GPIO16), &apollon_sw_interrupt, | ||
331 | IRQF_SHARED, "enter sw", | ||
332 | &apollon_sw_interrupt)) | ||
333 | return; | ||
334 | set_irq_type(OMAP_GPIO_IRQ(SW_UP_GPIO17), IRQ_TYPE_EDGE_RISING); | ||
335 | if (request_irq(OMAP_GPIO_IRQ(SW_UP_GPIO17), &apollon_sw_interrupt, | ||
336 | IRQF_SHARED, "up sw", | ||
337 | &apollon_sw_interrupt)) | ||
338 | return; | ||
339 | set_irq_type(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), IRQ_TYPE_EDGE_RISING); | ||
340 | if (request_irq(OMAP_GPIO_IRQ(SW_DOWN_GPIO58), &apollon_sw_interrupt, | ||
341 | IRQF_SHARED, "down sw", | ||
342 | &apollon_sw_interrupt)) | ||
343 | return; | ||
344 | } | 293 | } |
345 | 294 | ||
346 | static void __init apollon_usb_init(void) | 295 | static void __init apollon_usb_init(void) |
@@ -357,7 +306,6 @@ static void __init omap_apollon_init(void) | |||
357 | u32 v; | 306 | u32 v; |
358 | 307 | ||
359 | apollon_led_init(); | 308 | apollon_led_init(); |
360 | apollon_sw_init(); | ||
361 | apollon_flash_init(); | 309 | apollon_flash_init(); |
362 | apollon_usb_init(); | 310 | apollon_usb_init(); |
363 | 311 | ||