summaryrefslogtreecommitdiff
path: root/src/mainboard/google/brya/variants
diff options
context:
space:
mode:
authorFrank Chu <Frank_Chu@pegatron.corp-partner.google.com>2023-01-06 11:20:55 +0800
committerEric Lai <eric_lai@quanta.corp-partner.google.com>2023-01-10 00:46:43 +0000
commit3b23fa609210d13cd43ca403c10f904ec5d44dc8 (patch)
treeb4e01b7fc31d1225f417993fbe96f2b3f07bc2dc /src/mainboard/google/brya/variants
parentce6cdb360810938ab5800cb2d9f4f3c6e4d9fad8 (diff)
mb/google/brya/var/marasov: Disable touch panel power for non-touch sku
Disable touch panel power for non-touch sku by fw_config TOUCH field. BUG=b:263452842 BRANCH=firmware-brya-14505.B TEST=emerge-brya coreboot chromeos-bootimage Signed-off-by: Frank Chu <Frank_Chu@pegatron.corp-partner.google.com> Change-Id: I4736f94481512806377b733b26fdc7290046c555 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71691 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/brya/variants')
-rw-r--r--src/mainboard/google/brya/variants/marasov/Makefile.inc1
-rw-r--r--src/mainboard/google/brya/variants/marasov/fw_config.c28
-rw-r--r--src/mainboard/google/brya/variants/marasov/overridetree.cb8
3 files changed, 36 insertions, 1 deletions
diff --git a/src/mainboard/google/brya/variants/marasov/Makefile.inc b/src/mainboard/google/brya/variants/marasov/Makefile.inc
index 139345f260..4d25f34ea1 100644
--- a/src/mainboard/google/brya/variants/marasov/Makefile.inc
+++ b/src/mainboard/google/brya/variants/marasov/Makefile.inc
@@ -2,6 +2,7 @@
bootblock-y += gpio.c
romstage-y += gpio.c
+ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
romstage-y += memory.c
diff --git a/src/mainboard/google/brya/variants/marasov/fw_config.c b/src/mainboard/google/brya/variants/marasov/fw_config.c
new file mode 100644
index 0000000000..73ae600df9
--- /dev/null
+++ b/src/mainboard/google/brya/variants/marasov/fw_config.c
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <bootstate.h>
+#include <console/console.h>
+#include <fw_config.h>
+#include <gpio.h>
+
+static const struct pad_config touch_enable_pads[] = {
+ /* C0 : SMBCLK ==> EN_PP3300_TCHSCR */
+ PAD_CFG_GPO(GPP_C0, 1, DEEP),
+};
+
+static const struct pad_config touch_disable_pads[] = {
+ /* C0 : SMBCLK ==> NC */
+ PAD_NC(GPP_C0, NONE),
+};
+
+static void fw_config_handle(void *unused)
+{
+ if (fw_config_probe(FW_CONFIG(TOUCH, TOUCH_ELAN0001))) {
+ printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to GPO_H.\n");
+ gpio_configure_pads(touch_enable_pads, ARRAY_SIZE(touch_enable_pads));
+ } else {
+ printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to NC.\n");
+ gpio_configure_pads(touch_disable_pads, ARRAY_SIZE(touch_disable_pads));
+ }
+}
+BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);
diff --git a/src/mainboard/google/brya/variants/marasov/overridetree.cb b/src/mainboard/google/brya/variants/marasov/overridetree.cb
index bf9d5e037c..e90df9e8f0 100644
--- a/src/mainboard/google/brya/variants/marasov/overridetree.cb
+++ b/src/mainboard/google/brya/variants/marasov/overridetree.cb
@@ -12,6 +12,10 @@ fw_config
option UFC_USB 0
option UFC_MIPI 1
end
+ field TOUCH 5 5
+ option TOUCH_NONE 0
+ option TOUCH_ELAN0001 1
+ end
field STORAGE 30 31
option STORAGE_UNKNOWN 0
option STORAGE_NVME 1
@@ -163,7 +167,9 @@ chip soc/intel/alderlake
register "stop_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_C6)"
register "stop_off_delay_ms" = "1"
register "has_power_resource" = "1"
- device i2c 10 on end
+ device i2c 10 on
+ probe TOUCH TOUCH_ELAN0001
+ end
end
end #I2C3
device ref i2c5 on