Ren Kuo has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60185 )
Change subject: mb/google/dedede/var/magolor: Add stylus pen function ......................................................................
mb/google/dedede/var/magolor: Add stylus pen function
Update devicetree and gpio to handle stylus pen detection.
BUG=b:167983049 TEST=Build firmware and check behavior is expected. Wake up from suspend when pen is removed from the garage. Present the stylus menu when pen is removed from the garage.
Change-Id: I62489bb289b18f9aa0823005224eda3ef5218e03 Signed-off-by: Ren Kuo ren.kuo@quanta.corp-partner.google.com --- M src/mainboard/google/dedede/variants/magolor/Makefile.inc A src/mainboard/google/dedede/variants/magolor/gpio.c M src/mainboard/google/dedede/variants/magolor/overridetree.cb 3 files changed, 31 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/60185/1
diff --git a/src/mainboard/google/dedede/variants/magolor/Makefile.inc b/src/mainboard/google/dedede/variants/magolor/Makefile.inc index 24c75d1..3333383 100644 --- a/src/mainboard/google/dedede/variants/magolor/Makefile.inc +++ b/src/mainboard/google/dedede/variants/magolor/Makefile.inc @@ -1,3 +1,4 @@ ## SPDX-License-Identifier: GPL-2.0-or-later
ramstage-$(CONFIG_FW_CONFIG) += variant.c +ramstage-y += gpio.c diff --git a/src/mainboard/google/dedede/variants/magolor/gpio.c b/src/mainboard/google/dedede/variants/magolor/gpio.c new file mode 100644 index 0000000..795d731 --- /dev/null +++ b/src/mainboard/google/dedede/variants/magolor/gpio.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <commonlib/helpers.h> + +/* Pad configuration in ramstage*/ +static const struct pad_config gpio_table[] = { + + /* C12 : AP_PEN_DET_ODL (external pull-high) */ + PAD_CFG_GPI_GPIO_DRIVER(GPP_C12, NONE, DEEP), + +}; + +const struct pad_config *variant_override_gpio_table(size_t *num) +{ + *num = ARRAY_SIZE(gpio_table); + return gpio_table; +} diff --git a/src/mainboard/google/dedede/variants/magolor/overridetree.cb b/src/mainboard/google/dedede/variants/magolor/overridetree.cb index 24b32db..666c3ce 100644 --- a/src/mainboard/google/dedede/variants/magolor/overridetree.cb +++ b/src/mainboard/google/dedede/variants/magolor/overridetree.cb @@ -187,6 +187,17 @@ end end # I2C 0 device pci 15.2 on + chip drivers/generic/gpio_keys + register "name" = ""PENH"" + register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_LOW(GPP_C12)" + register "key.wakeup_route" = "WAKEUP_ROUTE_GPIO_IRQ" + register "key.wakeup_event_action" = "EV_ACT_DEASSERTED" + register "key.dev_name" = ""EJCT"" + register "key.linux_code" = "SW_PEN_INSERTED" + register "key.linux_input_type" = "EV_SW" + register "key.label" = ""pen_eject"" + device generic 0 on end + end chip drivers/i2c/hid register "generic.hid" = ""ELAN6915"" register "generic.desc" = ""ELAN Touchscreen""