User manual

Page | 52
.platform_data = &gpio_key_info,
},
};
Set GPIO 26 as the menu key, returning the key value KEY_F1, triggered
by a low voltage level.
2. GPIO pinmux Configuration;
The file sbc8140.h is saved under
/u-boot-03.00.02.07/board/timll/sbc8140/
/*
* IEN - Input Enable
* IDIS - Input Disable
* PTD - Pull type Down
* PTU - Pull type Up
* DIS - Pull type selection is inactive
* EN - Pull type selection is active
* M0 - Mode 0
* The commented string gives the final mux configuration for
that pin
*/
MUX_VAL(CP(ETK_D12_ES2), (IEN | PTU | DIS | M4))
/*GPIO_26*/\
MUX_VAL(CP(ETK_D15_ES2), (IEN | PTU | DIS | M4))
/*GPIO_29*/\
Set GPIOs 26 and 29 as M4 (GPIO mode) and IEN (allow input).
3. Driver Design;
The source file: gpio_keys.c is saved under
/linux-2.6.32-sbc8140/drivers/input/keyboard/;
Call platform_driver_register to register gpio_keys driver;
static struct platform_driver gpio_keys_device_driver = {
.probe = gpio_keys_probe,
.remove = __devexit_p(gpio_keys_remove),
.driver = {
.name = "gpio-keys",