User manual
Page | 51
Reference
linux-2.6.32-sbc8140/sound/soc/
linux-2.6.32-sbc8140/sound/soc/omap/omap3sbc8140.c
linux-2.6.32-sbc8140/sound/soc/codecs/twl4030.c
3.5 Driver Development
This section will introduce how to develop drivers with two examples,
GPIO_Keys and GPIO_LEDs.
3.5.1 GPIO_Keys Driver
1. Device Definition;
The source file: board-omap3sbc8140.c is saved under
/linux-2.6.32-sbc8140/arch/arm/mach-omap2/;
static struct gpio_keys_button gpio_buttons[] = {
{
.code = KEY_F1,
.gpio = 26,
.desc = "menu",
.active_low = true,
},
{
.code = KEY_ESC,
.gpio = 29,
.desc = "back",
.active_low = true,
},
};
static struct gpio_keys_platform_data gpio_key_info = {
.buttons = gpio_buttons,
.nbuttons = ARRAY_SIZE(gpio_buttons),
};
static struct platform_device keys_gpio = {
.name = "gpio-keys",
.id = -1,
.dev = {