From 665c58b77a6cab398d600a612d1c14d56a01fd9b Mon Sep 17 00:00:00 2001 From: Ivy Jian Date: Thu, 16 Mar 2023 17:18:35 +0800 Subject: mb/google/rex: Enable USB camera power Add enable_gpio for USB power resource BUG=b:273891168 TEST=Able to detect USB CAM Signed-off-by: Ivy Jian Change-Id: I08ebe560c8b75c8b590c889b7b90dbe678318d2a Reviewed-on: https://review.coreboot.org/c/coreboot/+/73754 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai Reviewed-by: Subrata Banik --- src/mainboard/google/rex/variants/rex0/overridetree.cb | 2 ++ src/mainboard/google/rex/variants/rex0/variant.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/mainboard/google/rex/variants') diff --git a/src/mainboard/google/rex/variants/rex0/overridetree.cb b/src/mainboard/google/rex/variants/rex0/overridetree.cb index bad123be54..d35eb36656 100644 --- a/src/mainboard/google/rex/variants/rex0/overridetree.cb +++ b/src/mainboard/google/rex/variants/rex0/overridetree.cb @@ -194,6 +194,8 @@ chip soc/intel/meteorlake chip drivers/usb/acpi register "desc" = ""USB2 Camera"" register "type" = "UPC_TYPE_INTERNAL" + register "has_power_resource" = "1" + register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_B09)" device ref usb2_port6 on probe UFC UFC_USB end diff --git a/src/mainboard/google/rex/variants/rex0/variant.c b/src/mainboard/google/rex/variants/rex0/variant.c index 6a79780f6e..3aec24b165 100644 --- a/src/mainboard/google/rex/variants/rex0/variant.c +++ b/src/mainboard/google/rex/variants/rex0/variant.c @@ -1,8 +1,23 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include +#include +#include #include +#include const char *get_wifi_sar_cbfs_filename(void) { return "wifi_sar_0.hex"; } + +void variant_generate_s0ix_hook(enum s0ix_entry entry) +{ + if (entry == S0IX_ENTRY) { + if (fw_config_probe(FW_CONFIG(UFC, UFC_USB))) + acpigen_soc_clear_tx_gpio(GPP_B09); + } else if (entry == S0IX_EXIT) { + if (fw_config_probe(FW_CONFIG(UFC, UFC_USB))) + acpigen_soc_set_tx_gpio(GPP_B09); + } +} -- cgit v1.2.3