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>
This commit is contained in:
parent
e1e762716c
commit
1e0d2e051b
|
@ -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 */
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue