diff options
-rw-r--r-- | src/ec/google/chromeec/mux/conn/chip.h | 13 | ||||
-rw-r--r-- | src/ec/google/chromeec/mux/conn/conn.c | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/mux/conn/chip.h b/src/ec/google/chromeec/mux/conn/chip.h new file mode 100644 index 0000000000..953b625ddd --- /dev/null +++ b/src/ec/google/chromeec/mux/conn/chip.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef EC_GOOGLE_CHROMEEC_MUX_CONN_CHIP_H +#define EC_GOOGLE_CHROMEEC_MUX_CONN_CHIP_H + +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. */ + bool mode_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 43f5595aa7..cb7478ab12 100644 --- a/src/ec/google/chromeec/mux/conn/conn.c +++ b/src/ec/google/chromeec/mux/conn/conn.c @@ -2,6 +2,8 @@ #include <acpi/acpigen.h> +#include "chip.h" + static const char *conn_acpi_name(const struct device *dev) { static char name[5]; @@ -11,6 +13,7 @@ static const char *conn_acpi_name(const struct device *dev) static void conn_fill_ssdt(const struct device *dev) { + const struct ec_google_chromeec_mux_conn_config *config = dev->chip_info; const char *name; name = acpi_device_name(dev); if (!name) @@ -21,6 +24,12 @@ static void conn_fill_ssdt(const struct device *dev) acpigen_write_name_integer("_ADR", dev->path.generic.id); + if (config && config->mode_switch) { + struct acpi_dp *dsd = acpi_dp_new_table("_DSD"); + acpi_dp_add_integer(dsd, "mode-switch", 1); + acpi_dp_write(dsd); + } + acpigen_write_device_end(); acpigen_write_scope_end(); } |