Eric Lai has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84713?usp=email )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: mb/google/brya/var/glassway: Add Stylus Function ......................................................................
mb/google/brya/var/glassway: Add Stylus Function
1. Add STYLUS fw_config setting. 2. Enable stylus device settings. 3. Disable the stylus GPIO pins based on fw_config.
BUG=b:364798563 BRANCH=firmware-nissa-15217.B TEST=1. emerge-nissa coreboot 2. Confirm command evtest for stylus PRP0001:00 and workable.
Change-Id: Ifa8555eed1c31e9342a50a735fc618106f26d41a Signed-off-by: Daniel Peng Daniel_Peng@pegatron.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/84713 Reviewed-by: Eric Lai ericllai@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Subrata Banik subratabanik@google.com Reviewed-by: Daniel Peng daniel_peng@pegatron.corp-partner.google.com Reviewed-by: Paul Menzel paulepanter@mailbox.org --- M src/mainboard/google/brya/variants/glassway/Makefile.mk A src/mainboard/google/brya/variants/glassway/fw_config.c M src/mainboard/google/brya/variants/glassway/gpio.c M src/mainboard/google/brya/variants/glassway/overridetree.cb 4 files changed, 41 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Eric Lai: Looks good to me, approved Subrata Banik: Looks good to me, approved Paul Menzel: Looks good to me, but someone else must approve Daniel Peng: Looks good to me, but someone else must approve
diff --git a/src/mainboard/google/brya/variants/glassway/Makefile.mk b/src/mainboard/google/brya/variants/glassway/Makefile.mk index e409037..b469805 100644 --- a/src/mainboard/google/brya/variants/glassway/Makefile.mk +++ b/src/mainboard/google/brya/variants/glassway/Makefile.mk @@ -3,6 +3,7 @@
romstage-y += gpio.c
+ramstage-$(CONFIG_FW_CONFIG) += fw_config.c ramstage-y += gpio.c
ramstage-y += variant.c diff --git a/src/mainboard/google/brya/variants/glassway/fw_config.c b/src/mainboard/google/brya/variants/glassway/fw_config.c new file mode 100644 index 0000000..b4dfc50 --- /dev/null +++ b/src/mainboard/google/brya/variants/glassway/fw_config.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/gpio.h> +#include <baseboard/variants.h> +#include <console/console.h> +#include <fw_config.h> + +static const struct pad_config stylus_disable_pads[] = { + /* F13 : SOC_PEN_DETECT_R_ODL */ + PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG), + /* F15 : SOC_PEN_DETECT_ODL */ + PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG), +}; + +void fw_config_gpio_padbased_override(struct pad_config *padbased_table) +{ + if (fw_config_probe(FW_CONFIG(STYLUS, STYLUS_ABSENT))) { + printk(BIOS_INFO, "Disable Stylus GPIO pins.\n"); + gpio_padbased_override(padbased_table, stylus_disable_pads, + ARRAY_SIZE(stylus_disable_pads)); + } +} diff --git a/src/mainboard/google/brya/variants/glassway/gpio.c b/src/mainboard/google/brya/variants/glassway/gpio.c index 79697d5..f9e5c41 100644 --- a/src/mainboard/google/brya/variants/glassway/gpio.c +++ b/src/mainboard/google/brya/variants/glassway/gpio.c @@ -32,10 +32,6 @@ PAD_NC_LOCK(GPP_E21, NONE, LOCK_CONFIG), /* F12 : WWAN_RST_L */ PAD_CFG_GPO_LOCK(GPP_F12, 1, LOCK_CONFIG), - /* F13 : GSXSLOAD ==> NC */ - PAD_NC_LOCK(GPP_F13, NONE, LOCK_CONFIG), - /* F15 : GSXSRESET# ==> NC */ - PAD_NC_LOCK(GPP_F15, NONE, LOCK_CONFIG), /* H19 : SOC_I2C_SUB_INT_ODL */ PAD_CFG_GPI_APIC(GPP_H19, NONE, PLTRST, LEVEL, NONE), /* H22 : IMGCLKOUT3 ==> NC */ diff --git a/src/mainboard/google/brya/variants/glassway/overridetree.cb b/src/mainboard/google/brya/variants/glassway/overridetree.cb index 9e0f742..9e2738e 100644 --- a/src/mainboard/google/brya/variants/glassway/overridetree.cb +++ b/src/mainboard/google/brya/variants/glassway/overridetree.cb @@ -21,6 +21,10 @@ option WIFI_SAR_ID_0 0 option WIFI_SAR_ID_1 1 end + field STYLUS 14 + option STYLUS_ABSENT 0 + option STYLUS_PRESENT 1 + end field WFC 16 17 option WFC_ABSENT 0 option WFC_PRESENT 1 @@ -368,6 +372,20 @@ probe TOUCHSCREEN_SOURCE TOUCHSCREEN_GTCH7503 end end + chip drivers/generic/gpio_keys + register "name" = ""PENH"" + register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_LOW(GPP_F13)" + register "key.wake_gpe" = "GPE0_DW2_15" + register "key.wakeup_route" = "WAKEUP_ROUTE_SCI" + 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 + probe STYLUS STYLUS_PRESENT + end + end end #I2C1 device ref i2c3 on chip drivers/i2c/generic