User manual
Page | 56
static void gpio_keys_work_func(struct work_struct *work)
{
…
gpio_keys_report_event(bdata);
…
}
static void gpio_keys_report_event(struct gpio_button_data
*bdata)
{
struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
unsigned int type = button->type ?: EV_KEY;
int state = (gpio_get_value(button->gpio) ? 1 : 0) ^
button->active_low;
input_event(input, type, button->code, !!state);
input_sync(input);
3.5.2 GPIO_LEDs Driver
1. Device Definitions;
The source file: board-omap3sbc8140.c is saved under
/linux-2.6.32-sbc8140/arch/arm/mach-omap2/;
static struct gpio_led gpio_leds[] = {
{
.name = "led0",
.default_trigger = "heartbeat",
.gpio = 136,
.active_low = true,
},
{
.name = "led1",
.gpio = 137, /* gets replaced
*/
.active_low = true,
},
{
.name = "led2",
.gpio = 138, /* gets replaced