diff options
author | Daniel Peng <Daniel_Peng@pegatron.corp-partner.google.com> | 2024-10-15 09:34:40 +0800 |
---|---|---|
committer | Eric Lai <ericllai@google.com> | 2024-10-16 06:09:10 +0000 |
commit | 9fe0ad0e21fcea6aa1417578794ffbfca58da395 (patch) | |
tree | efb31dcc422c6cf0e3cd422b67f706bb30b6bdce /src | |
parent | 995e763f0921be994992b21dfdce0510003e0659 (diff) |
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>
Diffstat (limited to 'src')
4 files changed, 41 insertions, 4 deletions
diff --git a/src/mainboard/google/brya/variants/glassway/Makefile.mk b/src/mainboard/google/brya/variants/glassway/Makefile.mk index e409037840..b4698058ab 100644 --- a/src/mainboard/google/brya/variants/glassway/Makefile.mk +++ b/src/mainboard/google/brya/variants/glassway/Makefile.mk @@ -3,6 +3,7 @@ bootblock-y += gpio.c 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 0000000000..b4dfc50804 --- /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 79697d533b..f9e5c417cf 100644 --- a/src/mainboard/google/brya/variants/glassway/gpio.c +++ b/src/mainboard/google/brya/variants/glassway/gpio.c @@ -32,10 +32,6 @@ static const struct pad_config override_gpio_table[] = { 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 9e0f742f03..9e2738eef5 100644 --- a/src/mainboard/google/brya/variants/glassway/overridetree.cb +++ b/src/mainboard/google/brya/variants/glassway/overridetree.cb @@ -21,6 +21,10 @@ fw_config 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 @@ chip soc/intel/alderlake 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 |