1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_GENERIC_GPIO_KEYS_H__
4 #define __DRIVERS_GENERIC_GPIO_KEYS_H__
6 #include <acpi/acpi_device.h>
15 /* Switch events type (Linux code emitted for EV_SW) */
18 SW_PEN_INSERTED
= 0xf,
21 /* Trigger for wakeup event action */
30 * GPIO key uses SCI route to wake the system from suspend state. This is typically used
31 * when the input line is dual routed i.e. one for IRQ and other for SCI or if the GPIO
32 * controller is capable of handling the filtering for IRQ and SCI separately. This
33 * requires "wake" property to be provided by the board which represents the GPE # for
34 * wake. It is exposed as _PRW in ACPI tables.
38 * GPIO key uses GPIO controller IRQ route for wake. This is used when IRQ and wake are
39 * routed to the same pad and the GPIO controller is not capable of handling the trigger
40 * filtering separately for IRQ and wake. Kernel driver for gpio-keys takes care of
41 * reconfiguring the IRQ trigger as both edges when used in S0 and the edge requested by
42 * BIOS (as per wakeup_event_action) when entering suspend. In this case, _PRW is not
43 * exposed for the key device.
45 WAKEUP_ROUTE_GPIO_IRQ
,
46 /* GPIO key does not support wake. */
47 WAKEUP_ROUTE_DISABLED
,
50 /* Details of the child node defining key */
52 /* Device name of the child node - Mandatory */
54 /* Keycode emitted for this key - Mandatory */
57 * Event type generated for this key
60 uint32_t linux_input_type
;
61 /* Descriptive name of the key */
63 /* Wakeup route (if any) for the key. See WAKEUP_ROUTE_* macros above. */
64 unsigned int wakeup_route
;
65 /* Wake GPE -- SCI GPE # for wake. Required for WAKEUP_ROUTE_SCI. */
66 unsigned int wake_gpe
;
67 /* Trigger for Wakeup Event Action as defined in EV_ACT_* enum */
68 unsigned int wakeup_event_action
;
69 /* Can this key be disabled? */
71 /* Debounce interval time in milliseconds */
72 uint32_t debounce_interval
;
75 struct drivers_generic_gpio_keys_config
{
76 /* Device name of the parent gpio-keys node */
78 /* Name of the input device - Optional */
80 /* GPIO line providing the key - Mandatory */
81 struct acpi_gpio gpio
;
82 /* Is this a polled GPIO button? - Optional */
84 /* Poll interval - Mandatory only if GPIO is polled. */
85 uint32_t poll_interval
;
86 /* Details about the key - Mandatory */
90 #endif /* __DRIVERS_GENERIC_GPIO_KEYS_H__ */