From a95907b0666c764aaddeaffc7a414c49bbb47d7b Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Mon, 13 Apr 2020 18:03:29 -0600 Subject: ec/google/chromeec: Update the USBC ACPI device hierarchy Type C connector class driver in kernel (v5.4) expects the Type C ACPI device under ChromeEC ACPI device scope. Currently the Type C ACPI device is populated under ChromeEC device's parent. This leads to incorrect casting of Type C's parent device and hence a crash. Move the Type C device under ChromeEC ACPI device. BUG=b:153518804 TEST=Build and boot the mainboard. Ensure that the USBC ACPI device is populated under ChromeEC ACPI device. Scope (\_SB.PCI0.LPCB.EC0.CREC) { Device (USBC) { Name (_HID, "GOOG0014") // _HID: Hardware ID ... } } Change-Id: I628489bc420d7a3db4ad3cb93d085d568c6de507 Signed-off-by: Karthikeyan Ramasubramanian Reviewed-on: https://review.coreboot.org/c/coreboot/+/40354 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Aamir Bohra Reviewed-by: Tim Wawrzynczak --- src/ec/google/chromeec/ec_acpi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ec/google/chromeec/ec_acpi.c b/src/ec/google/chromeec/ec_acpi.c index 47d60d5b75..6bc9693881 100644 --- a/src/ec/google/chromeec/ec_acpi.c +++ b/src/ec/google/chromeec/ec_acpi.c @@ -16,8 +16,9 @@ #include "ec.h" #include "ec_commands.h" -#define GOOGLE_CHROMEEC_USBC_DEVICE_HID "GOOG0014" -#define GOOGLE_CHROMEEC_USBC_DEVICE_NAME "USBC" +#define GOOGLE_CHROMEEC_USBC_DEVICE_PARENT "CREC" +#define GOOGLE_CHROMEEC_USBC_DEVICE_HID "GOOG0014" +#define GOOGLE_CHROMEEC_USBC_DEVICE_NAME "USBC" const char *google_chromeec_acpi_name(const struct device *dev) { @@ -219,8 +220,8 @@ void google_chromeec_fill_ssdt_generator(struct device *dev) if (google_chromeec_get_num_pd_ports(&num_ports)) return; - /* Reference the existing device's scope */ - acpigen_write_scope(acpi_device_path(dev)); + /* Add TypeC device under the existing device + ".CREC" scope */ + acpigen_write_scope(acpi_device_path_join(dev, GOOGLE_CHROMEEC_USBC_DEVICE_PARENT)); fill_ssdt_typec_device(num_ports); acpigen_pop_len(); /* Scope */ } -- cgit v1.2.3