From 8c3fa461f331485f37279ec9207b21b8b29938bd Mon Sep 17 00:00:00 2001 From: Prashant Malani Date: Thu, 29 Dec 2022 18:46:47 +0000 Subject: ec/google/chromeec: Add retimer flag for mux device Not all ports have retimers. Add a property to denote that a particular port has a retimer (instead of assuming that all ports have retimers). BUG=b:263964979 TEST=Verified on guybrush; SSDT shows retimer-switch on port1 when device tree is updated accordingly. Change-Id: I754323236d2912777b63cede0fce2ccf7882cfea Signed-off-by: Prashant Malani Reviewed-on: https://review.coreboot.org/c/coreboot/+/71663 Reviewed-by: Robert Zieba Reviewed-by: Caveh Jalali Tested-by: build bot (Jenkins) --- src/ec/google/chromeec/mux/conn/chip.h | 6 ++++-- src/ec/google/chromeec/mux/conn/conn.c | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/ec/google/chromeec') diff --git a/src/ec/google/chromeec/mux/conn/chip.h b/src/ec/google/chromeec/mux/conn/chip.h index 953b625ddd..fd0ccf871e 100644 --- a/src/ec/google/chromeec/mux/conn/chip.h +++ b/src/ec/google/chromeec/mux/conn/chip.h @@ -5,9 +5,11 @@ struct ec_google_chromeec_mux_conn_config { /* When set to true, this signifies that the mux device - * is used as a Type-C mode switch in addition to - * a retimer switch. */ + * is used as a Type-C mode switch. */ bool mode_switch; + /* When set to true, this signifies that the mux device + * is used as a Type-C retimer switch. */ + bool retimer_switch; }; #endif /* EC_GOOGLE_CHROMEEC_MUX_CONN_CHIP_H */ diff --git a/src/ec/google/chromeec/mux/conn/conn.c b/src/ec/google/chromeec/mux/conn/conn.c index cb7478ab12..e179c33307 100644 --- a/src/ec/google/chromeec/mux/conn/conn.c +++ b/src/ec/google/chromeec/mux/conn/conn.c @@ -24,9 +24,14 @@ static void conn_fill_ssdt(const struct device *dev) acpigen_write_name_integer("_ADR", dev->path.generic.id); - if (config && config->mode_switch) { + if (config) { struct acpi_dp *dsd = acpi_dp_new_table("_DSD"); - acpi_dp_add_integer(dsd, "mode-switch", 1); + + if (config->mode_switch) + acpi_dp_add_integer(dsd, "mode-switch", 1); + if (config->retimer_switch) + acpi_dp_add_integer(dsd, "retimer-switch", 1); + acpi_dp_write(dsd); } -- cgit v1.2.3