2 * linux/arch/arm/mach-omap1/leds.c
6 #include <linux/gpio.h>
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <linux/platform_data/gpio-omap.h>
12 #include <asm/mach-types.h>
21 if (!cpu_class_is_omap1())
24 if (machine_is_omap_innovator())
25 leds_event = innovator_leds_event;
27 else if (machine_is_omap_h2()
28 || machine_is_omap_h3()
29 || machine_is_omap_perseus2())
30 leds_event = h2p2_dbg_leds_event;
32 else if (machine_is_omap_osk())
33 leds_event = osk_leds_event;
38 if (machine_is_omap_h2()
39 || machine_is_omap_h3()
40 #ifdef CONFIG_OMAP_OSK_MISTRAL
41 || machine_is_omap_osk()
45 /* LED1/LED2 pins can be used as GPIO (as done here), or by
46 * the LPG (works even in deep sleep!), to drive a bicolor
47 * LED on the H2 sample board, and another on the H2/P2
48 * "surfer" expansion board.
50 * The same pins drive a LED on the OSK Mistral board, but
51 * that's a different kind of LED (just one color at a time).
53 omap_cfg_reg(P18_1610_GPIO3);
54 if (gpio_request(3, "LED red") == 0)
55 gpio_direction_output(3, 1);
57 printk(KERN_WARNING "LED: can't get GPIO3/red?\n");
60 if (gpio_request(OMAP_MPUIO(4), "LED green") == 0)
61 gpio_direction_output(OMAP_MPUIO(4), 1);
63 printk(KERN_WARNING "LED: can't get MPUIO4/green?\n");
66 leds_event(led_start);
70 __initcall(omap_leds_init);