User manual
Page | 51
5.6.2 Driver for the GPIO_Leds
Device Definition
linux-3.1.0-psp04.06.00.03.sdk/arch/arm/mach-omap2/board-am335xevm.c
The kernel configurations are: sys_led (GPIO1.26) and usr_led (GPIO1.27),
where a low level enables:
static struct gpio_led gpio_leds[] = {
{
.name = "sys_led",
.default_trigger = "heartbeat",
.gpio = GPIO_TO_PIN(1, 26),
},
{
.name = "user_led",
.gpio = GPIO_TO_PIN(1, 27),
},
};
static struct gpio_led_platform_data gpio_led_info = {
.leds = gpio_leds,
.num_leds = ARRAY_SIZE(gpio_leds),
};
static struct platform_device leds_gpio = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &gpio_led_info,
},
};
GPIO pinmux Setup
linux-3.1.0-psp04.06.00.03.sdk/arch/arm/mach-omap2/board-am335xev
m.c
Configure GPIO 1.26 and GPIO 1.27 as M7 (MODE 7 = GPIO) and IDIS
(Input not allowed)
static struct pinmux_config gpio_led_pin_mux[] = {
{"gpmc_a10.gpio1_26", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},