blob: a7e977ff4abf060190118884b8a107c826c78feb [file] [log] [blame]
Phil Blundell78a56aa2007-01-18 00:44:09 -05001#ifndef _GPIO_KEYS_H
2#define _GPIO_KEYS_H
3
Heiko Stübnerb18db3d2012-02-01 09:12:24 -08004struct device;
5
Phil Blundell78a56aa2007-01-18 00:44:09 -05006struct gpio_keys_button {
7 /* Configuration parameters */
Alexander Stein92a47672011-04-11 23:34:37 -07008 unsigned int code; /* input event code (KEY_*, SW_*) */
Laxman Dewangand8ee4a12012-03-19 17:54:31 -07009 int gpio; /* -1 if this key does not support gpio */
Phil Blundell78a56aa2007-01-18 00:44:09 -050010 int active_low;
Alexander Stein92a47672011-04-11 23:34:37 -070011 const char *desc;
12 unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */
Anti Sulline15b0212007-09-26 00:01:17 -040013 int wakeup; /* configure the button as a wake-up source */
Dmitry Baryshkova33466e2008-05-07 16:30:15 -040014 int debounce_interval; /* debounce ticks interval in msecs */
Mika Westerberg9e3af042010-02-04 00:48:00 -080015 bool can_disable;
Alexander Stein92a47672011-04-11 23:34:37 -070016 int value; /* axis value for EV_ABS */
Laxman Dewangand8ee4a12012-03-19 17:54:31 -070017 unsigned int irq; /* Irq number in case of interrupt keys */
Phil Blundell78a56aa2007-01-18 00:44:09 -050018};
19
20struct gpio_keys_platform_data {
21 struct gpio_keys_button *buttons;
22 int nbuttons;
Gabor Juhos0e7d0c82010-12-06 17:14:47 -080023 unsigned int poll_interval; /* polling interval in msecs -
24 for polling driver only */
Dominic Curranb67b4b12008-10-27 22:30:53 -040025 unsigned int rep:1; /* enable input subsystem auto repeat */
Shubhrajyoti D173bdd72010-08-03 19:44:40 -070026 int (*enable)(struct device *dev);
27 void (*disable)(struct device *dev);
Alexander Stein46711272011-04-11 23:34:48 -070028 const char *name; /* input device name */
Phil Blundell78a56aa2007-01-18 00:44:09 -050029};
30
31#endif