From f8b0eb8f3e9ddb3f198a09d1414ab75d9670caff Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Sun, 16 May 2021 08:44:47 -0400 Subject: [PATCH] mb/google/puff/var/dooly: Add gpio_keys for mic mute switch UI monitors this input event and sends global mic mute command to CRAS when the physical switch is toggled. BUG=b:184593945 BRANCH=puff TEST=build image and verify with evtest on DUT. Apply crrev.com/c/2870806 with chrome cmdline flag and verify global mute is triggered. Verify sequences of switch toggle and suspend/resume. Change-Id: Id89947885fdd96c5b5d598bda6db127daf298dc3 Signed-off-by: Ben Zhang Reviewed-on: https://review.coreboot.org/c/coreboot/+/54333 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/mainboard/google/hatch/variants/dooly/gpio.c | 2 +- .../google/hatch/variants/dooly/overridetree.cb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/hatch/variants/dooly/gpio.c b/src/mainboard/google/hatch/variants/dooly/gpio.c index 5fd88c254c..d28f1fe86b 100644 --- a/src/mainboard/google/hatch/variants/dooly/gpio.c +++ b/src/mainboard/google/hatch/variants/dooly/gpio.c @@ -42,7 +42,7 @@ static const struct pad_config gpio_table[] = { PAD_NC(GPP_C19, NONE), /* D16 : DMIC_ON_OFF MIC_SWITCH_L */ - PAD_CFG_GPI(GPP_D16, NONE, DEEP), + PAD_CFG_GPI_GPIO_DRIVER(GPP_D16, NONE, DEEP), /* E2 : EN_PP_MST_OD */ PAD_CFG_GPO(GPP_E2, 1, DEEP), diff --git a/src/mainboard/google/hatch/variants/dooly/overridetree.cb b/src/mainboard/google/hatch/variants/dooly/overridetree.cb index 3d7a4a5bde..1276ed8e7d 100644 --- a/src/mainboard/google/hatch/variants/dooly/overridetree.cb +++ b/src/mainboard/google/hatch/variants/dooly/overridetree.cb @@ -348,6 +348,17 @@ chip soc/intel/cannonlake register "property_list[0].integer" = "1" device i2c 1a on end end + chip drivers/generic/gpio_keys + register "name" = ""MUTE"" + register "label" = ""mic_mute_switch"" + register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_LOW(GPP_D16)" + register "key.wakeup_route" = "WAKEUP_ROUTE_DISABLED" + register "key.dev_name" = ""MMSW"" + register "key.linux_code" = "SW_MUTE_DEVICE" + register "key.linux_input_type" = "EV_SW" + register "key.label" = ""mic_mute_switch_key"" + device generic 0 on end + end end #I2C #4 device pci 1a.0 on end # eMMC device pci 1d.2 on # PCI Express Port 11 (X2 NVMe)