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 <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90166
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2025-10-15 10:57:00 -05:00
commit 6be83443e5
2 changed files with 39 additions and 0 deletions

View file

@ -5,6 +5,20 @@
#include <ec/google/chromeec/cfr.h>
#include <soc/cfr.h>
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
};

View file

@ -1,7 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpigen.h>
#include <device/device.h>
#include <drivers/intel/gma/int15.h>
#include <option.h>
#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);
}