coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#ifndef __DRIVERS_GENERIC_GPIO_KEYS_H__
4
#define __DRIVERS_GENERIC_GPIO_KEYS_H__
5
6
#include <
acpi/acpi_device.h
>
7
#include <
stdint.h
>
8
9
/* Linux input type */
10
enum
{
11
/* Switch event */
12
EV_SW
= 0x5,
13
};
14
15
/* Switch events type (Linux code emitted for EV_SW) */
16
enum
{
17
SW_MUTE_DEVICE
= 0xe,
18
SW_PEN_INSERTED
= 0xf,
19
};
20
21
/* Trigger for wakeup event action */
22
enum
{
23
EV_ACT_ANY
,
24
EV_ACT_ASSERTED
,
25
EV_ACT_DEASSERTED
,
26
};
27
28
enum
{
29
/*
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.
35
*/
36
WAKEUP_ROUTE_SCI
,
37
/*
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.
44
*/
45
WAKEUP_ROUTE_GPIO_IRQ
,
46
/* GPIO key does not support wake. */
47
WAKEUP_ROUTE_DISABLED
,
48
};
49
50
/* Details of the child node defining key */
51
struct
key_info
{
52
/* Device name of the child node - Mandatory */
53
const
char
*
dev_name
;
54
/* Keycode emitted for this key - Mandatory */
55
uint32_t
linux_code
;
56
/*
57
* Event type generated for this key
58
* See EV_* above.
59
*/
60
uint32_t
linux_input_type
;
61
/* Descriptive name of the key */
62
const
char
*
label
;
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? */
70
bool
can_be_disabled
;
71
/* Debounce interval time in milliseconds */
72
uint32_t
debounce_interval
;
73
};
74
75
struct
drivers_generic_gpio_keys_config
{
76
/* Device name of the parent gpio-keys node */
77
const
char
*
name
;
78
/* Name of the input device - Optional */
79
const
char
*
label
;
80
/* GPIO line providing the key - Mandatory */
81
struct
acpi_gpio
gpio
;
82
/* Is this a polled GPIO button? - Optional */
83
bool
is_polled
;
84
/* Poll interval - Mandatory only if GPIO is polled. */
85
uint32_t
poll_interval
;
86
/* Details about the key - Mandatory */
87
struct
key_info
key
;
88
};
89
90
#endif
/* __DRIVERS_GENERIC_GPIO_KEYS_H__ */
acpi_device.h
EV_SW
@ EV_SW
Definition:
chip.h:12
EV_ACT_ANY
@ EV_ACT_ANY
Definition:
chip.h:23
EV_ACT_DEASSERTED
@ EV_ACT_DEASSERTED
Definition:
chip.h:25
EV_ACT_ASSERTED
@ EV_ACT_ASSERTED
Definition:
chip.h:24
WAKEUP_ROUTE_GPIO_IRQ
@ WAKEUP_ROUTE_GPIO_IRQ
Definition:
chip.h:45
WAKEUP_ROUTE_DISABLED
@ WAKEUP_ROUTE_DISABLED
Definition:
chip.h:47
WAKEUP_ROUTE_SCI
@ WAKEUP_ROUTE_SCI
Definition:
chip.h:36
SW_PEN_INSERTED
@ SW_PEN_INSERTED
Definition:
chip.h:18
SW_MUTE_DEVICE
@ SW_MUTE_DEVICE
Definition:
chip.h:17
stdint.h
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
acpi_gpio
Definition:
acpi_device.h:164
drivers_generic_gpio_keys_config
Definition:
chip.h:75
drivers_generic_gpio_keys_config::poll_interval
uint32_t poll_interval
Definition:
chip.h:85
drivers_generic_gpio_keys_config::key
struct key_info key
Definition:
chip.h:87
drivers_generic_gpio_keys_config::name
const char * name
Definition:
chip.h:77
drivers_generic_gpio_keys_config::label
const char * label
Definition:
chip.h:79
drivers_generic_gpio_keys_config::is_polled
bool is_polled
Definition:
chip.h:83
gpio
Definition:
pinmux.c:36
key_info
Definition:
chip.h:51
key_info::linux_input_type
uint32_t linux_input_type
Definition:
chip.h:60
key_info::linux_code
uint32_t linux_code
Definition:
chip.h:55
key_info::wakeup_route
unsigned int wakeup_route
Definition:
chip.h:64
key_info::dev_name
const char * dev_name
Definition:
chip.h:53
key_info::can_be_disabled
bool can_be_disabled
Definition:
chip.h:70
key_info::label
const char * label
Definition:
chip.h:62
key_info::debounce_interval
uint32_t debounce_interval
Definition:
chip.h:72
key_info::wake_gpe
unsigned int wake_gpe
Definition:
chip.h:66
key_info::wakeup_event_action
unsigned int wakeup_event_action
Definition:
chip.h:68
src
drivers
generic
gpio_keys
chip.h
Generated by
1.9.1