Ben Zhang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/54332 )
Change subject: drivers/gpio_keys: Add label and SW_MUTE_DEVICE ......................................................................
drivers/gpio_keys: Add label and SW_MUTE_DEVICE
Added the label field to the gpio_keys DSD so that the kernel driver can use a meaningful name instead of the generic _HID PRP0001.
Added SW_MUTE_DEVICE event type for mic mute switch.
BUG=b:184593945 TEST=build image and verify with evtest on puff: /dev/input/event3: mic_mute_switch UI event_device_info receives the proper name.
Change-Id: I0377851b9cf23bab31930aed6e7de91b4ac3505b Signed-off-by: Ben Zhang benzh@google.com --- M src/drivers/generic/gpio_keys/chip.h M src/drivers/generic/gpio_keys/gpio_keys.c 2 files changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/54332/1
diff --git a/src/drivers/generic/gpio_keys/chip.h b/src/drivers/generic/gpio_keys/chip.h index a2ff59d..88dfe2e 100644 --- a/src/drivers/generic/gpio_keys/chip.h +++ b/src/drivers/generic/gpio_keys/chip.h @@ -14,6 +14,7 @@
/* Switch events type (Linux code emitted for EV_SW) */ enum { + SW_MUTE_DEVICE = 0xe, SW_PEN_INSERTED = 0xf, };
@@ -74,6 +75,8 @@ struct drivers_generic_gpio_keys_config { /* Device name of the parent gpio-keys node */ const char *name; + /* Name of the input device - Optional */ + const char *label; /* GPIO line providing the key - Mandatory */ struct acpi_gpio gpio; /* Is this a polled GPIO button? - Optional */ diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c index 3d273a0..75ce09f 100644 --- a/src/drivers/generic/gpio_keys/gpio_keys.c +++ b/src/drivers/generic/gpio_keys/gpio_keys.c @@ -76,6 +76,8 @@ /* DSD */ dsd = acpi_dp_new_table("_DSD"); acpi_dp_add_string(dsd, "compatible", drv_string); + if (config->label) + acpi_dp_add_string(dsd, "label", config->label); if (config->is_polled) acpi_dp_add_integer(dsd, "poll-interval", config->poll_interval);