}; #define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \ { \ .gpio = gpio_num, \ .type = ev_type, \ .code = ev_code, \ .active_low = act_low, \ .desc = "btn " descr, \ } #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \ GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description) static struct gpio_keys_button pandora_gpio_keys[] = { GPIO_BUTTON_LOW(110, KEY_UP, "up"), GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), GPIO_BUTTON_LOW(111, BTN_A, "a"), GPIO_BUTTON_LOW(106, BTN_B, "b"), GPIO_BUTTON_LOW(109, BTN_X, "x"), GPIO_BUTTON_LOW(101, BTN_Y, "y"), GPIO_BUTTON_LOW(102, BTN_TL, "l"), GPIO_BUTTON_LOW(97, BTN_TL2, "l2"), GPIO_BUTTON_LOW(105, BTN_TR, "r"), GPIO_BUTTON_LOW(107, BTN_TR2, "r2"), GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"),
#define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \ { \ .gpio = gpio_num, \ .type = ev_type, \ .code = ev_code, \ .active_low = act_low, \ .debounce_interval = 4, \ .desc = "btn " descr, \ } #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \ GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description) static struct gpio_keys_button pandora_gpio_keys[] = { GPIO_BUTTON_LOW(110, KEY_UP, "up"), GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), GPIO_BUTTON_LOW(109, KEY_PAGEUP, "game 1"), GPIO_BUTTON_LOW(111, KEY_END, "game 2"), GPIO_BUTTON_LOW(106, KEY_PAGEDOWN, "game 3"), GPIO_BUTTON_LOW(101, KEY_HOME, "game 4"), GPIO_BUTTON_LOW(102, KEY_RIGHTSHIFT, "l"), GPIO_BUTTON_LOW(97, KEY_KPPLUS, "l2"), GPIO_BUTTON_LOW(105, KEY_RIGHTCTRL, "r"), GPIO_BUTTON_LOW(107, KEY_KPMINUS, "r2"), GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"),
}; #define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \ { \ .gpio = gpio_num, \ .type = ev_type, \ .code = ev_code, \ .active_low = act_low, \ .desc = "btn " descr, \ } #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \ GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description) static struct gpio_keys_button pandora_gpio_keys[] = { GPIO_BUTTON_LOW(110, KEY_UP, "up"), GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), GPIO_BUTTON_LOW(109, KEY_KP1, "game 1"), GPIO_BUTTON_LOW(111, KEY_KP2, "game 2"), GPIO_BUTTON_LOW(106, KEY_KP3, "game 3"), GPIO_BUTTON_LOW(101, KEY_KP4, "game 4"), GPIO_BUTTON_LOW(102, BTN_TL, "l"), GPIO_BUTTON_LOW(97, BTN_TL2, "l2"), GPIO_BUTTON_LOW(105, BTN_TR, "r"), GPIO_BUTTON_LOW(107, BTN_TR2, "r2"), GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"),