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