summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@chromium.org>2022-06-13 21:51:52 +0000
committerFelix Held <felix-coreboot@felixheld.de>2022-06-15 23:55:40 +0000
commit1e0d2e051b3623256ecac1f770573b9b7bd05173 (patch)
tree4478ccd2d8ca653397d144fb224f1a625a608305
parente1e762716cf925c621d58163133ed1c3e006a903 (diff)
ec/google/chromeec: Add property to denote mux mode switch
On some systems, the Chrome EC controls both the USB Type-C mux as well as the retimer. Introduce a boolean property "mode-switch" to denote switches which act as a mode-switch. BUG=b:235834631 TEST=None BRANCH=None Signed-off-by: Prashant Malani <pmalani@chromium.org> Change-Id: If209a8529ff7ec424f23fd96875ac95a1fe6267d Reviewed-on: https://review.coreboot.org/c/coreboot/+/65116 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
-rw-r--r--src/ec/google/chromeec/mux/conn/chip.h13
-rw-r--r--src/ec/google/chromeec/mux/conn/conn.c9
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();
}