Commit | Line | Data |
---|---|---|
78a56aab PB |
1 | #ifndef _GPIO_KEYS_H |
2 | #define _GPIO_KEYS_H | |
3 | ||
b18db3d9 HS |
4 | struct device; |
5 | ||
542ad4f8 AS |
6 | /** |
7 | * struct gpio_keys_button - configuration parameters | |
8 | * @code: input event code (KEY_*, SW_*) | |
9 | * @gpio: %-1 if this key does not support gpio | |
10 | * @active_low: %true indicates that button is considered | |
11 | * depressed when gpio is low | |
12 | * @desc: label that will be attached to button's gpio | |
13 | * @type: input event type (%EV_KEY, %EV_SW, %EV_ABS) | |
14 | * @wakeup: configure the button as a wake-up source | |
15 | * @debounce_interval: debounce ticks interval in msecs | |
16 | * @can_disable: %true indicates that userspace is allowed to | |
17 | * disable button via sysfs | |
18 | * @value: axis value for %EV_ABS | |
19 | * @irq: Irq number in case of interrupt keys | |
20 | */ | |
78a56aab | 21 | struct gpio_keys_button { |
542ad4f8 AS |
22 | unsigned int code; |
23 | int gpio; | |
78a56aab | 24 | int active_low; |
92a47674 | 25 | const char *desc; |
542ad4f8 AS |
26 | unsigned int type; |
27 | int wakeup; | |
28 | int debounce_interval; | |
9e3af04f | 29 | bool can_disable; |
542ad4f8 AS |
30 | int value; |
31 | unsigned int irq; | |
78a56aab PB |
32 | }; |
33 | ||
542ad4f8 AS |
34 | /** |
35 | * struct gpio_keys_platform_data - platform data for gpio_keys driver | |
36 | * @buttons: pointer to array of &gpio_keys_button structures | |
37 | * describing buttons attached to the device | |
38 | * @nbuttons: number of elements in @buttons array | |
39 | * @poll_interval: polling interval in msecs - for polling driver only | |
40 | * @rep: enable input subsystem auto repeat | |
41 | * @enable: platform hook for enabling the device | |
42 | * @disable: platform hook for disabling the device | |
43 | * @name: input device name | |
44 | */ | |
78a56aab PB |
45 | struct gpio_keys_platform_data { |
46 | struct gpio_keys_button *buttons; | |
47 | int nbuttons; | |
542ad4f8 AS |
48 | unsigned int poll_interval; |
49 | unsigned int rep:1; | |
173bdd74 S |
50 | int (*enable)(struct device *dev); |
51 | void (*disable)(struct device *dev); | |
542ad4f8 | 52 | const char *name; |
78a56aab PB |
53 | }; |
54 | ||
55 | #endif |