From 6be83443e5abf6ed07b0beda1fdaef077b986c72 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Wed, 15 Oct 2025 10:57:00 -0500 Subject: [PATCH] mb/google/auron/var/lulu: Add CFR option to enable/disable touchscreen Some LULU boards are equipped with a touchscreen, others are not. Since Broadwell doesn't support the use of the i2c generic driver and runtime detection, add a CFR menu option to allow selective disabling of the touchscreen ACPI device by users whose boards do not have one. This prevents a malfunctioning touchscreen device from appearing in Device Manager under Windows. TEST=build/boot lulu, boot Win11, verify no malfunctoning touchscreen device shown in Device Manager when disabled in CFR option menu. Change-Id: I423ef1cf085bc488b4740092b992a245e3fd7e7e Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/90166 Reviewed-by: Sean Rhodes Tested-by: build bot (Jenkins) --- src/mainboard/google/auron/cfr.c | 24 ++++++++++++++++++++++++ src/mainboard/google/auron/mainboard.c | 15 +++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/mainboard/google/auron/cfr.c b/src/mainboard/google/auron/cfr.c index e1d352665b..90106a5586 100644 --- a/src/mainboard/google/auron/cfr.c +++ b/src/mainboard/google/auron/cfr.c @@ -5,6 +5,20 @@ #include #include +static const struct sm_object touchscreen = SM_DECLARE_ENUM({ + .opt_name = "touchscreen", + .ui_name = "Touchscreen", + .ui_helptext = "Enable or disable the integrated touchscreen device", + .default_value = 1, + .values = (const struct sm_enum_value[]) { + { "Disabled", 0 }, + { "Enabled", 1 }, + SM_ENUM_VALUE_END }, +#if !CONFIG(BOARD_GOOGLE_LULU) + .flags = CFR_OPTFLAG_SUPPRESS, +#endif +}); + static struct sm_obj_form system = { .ui_name = "System", .obj_list = (const struct sm_object *[]) { @@ -21,8 +35,18 @@ static struct sm_obj_form ec = { NULL }, }; + +static struct sm_obj_form devices = { + .ui_name = "Devices", + .obj_list = (const struct sm_object *[]) { + &touchscreen, + NULL + }, +}; + static struct sm_obj_form *sm_root[] = { &system, + &devices, &ec, NULL }; diff --git a/src/mainboard/google/auron/mainboard.c b/src/mainboard/google/auron/mainboard.c index ed2e7b889c..14c8f67642 100644 --- a/src/mainboard/google/auron/mainboard.c +++ b/src/mainboard/google/auron/mainboard.c @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include +#include #include "ec.h" #include "variant.h" @@ -15,6 +17,18 @@ static void mainboard_init(struct device *dev) lan_init(); } +static void mainboard_fill_ssdt(const struct device *dev) +{ + if (CONFIG(BOARD_GOOGLE_LULU)) { + /* Get touchscreen enable option from CFR */ + unsigned int touchscreen_enabled = get_uint_option("touchscreen", 1); + + acpigen_write_scope("\\_SB.PCI0.I2C1"); + acpigen_write_store_int_to_namestr(touchscreen_enabled ? 1 : 0, "S2EN"); + acpigen_pop_len(); /* Scope */ + } +} + static int mainboard_smbios_data(struct device *dev, int *handle, unsigned long *current) { @@ -25,6 +39,7 @@ static void mainboard_enable(struct device *dev) { dev->ops->init = mainboard_init; dev->ops->get_smbios_data = mainboard_smbios_data; + dev->ops->acpi_fill_ssdt = mainboard_fill_ssdt; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); }