From 1a368769b905ff5ed2a2ca9ddc1c473f8a2b44ad Mon Sep 17 00:00:00 2001 From: Derek Huang Date: Thu, 30 Sep 2021 21:20:02 +0800 Subject: [PATCH] ec/google/chromeec: Register USB-C mux operations Register USB-C mux operations to the generic interface. BUG=b:192947843 Signed-off-by: Derek Huang Change-Id: I576c9e4c6c82d6b4055b0a0a9a75c677d4b05220 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58061 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/ec/google/chromeec/Makefile.inc | 2 +- src/ec/google/chromeec/usbc_mux.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/ec/google/chromeec/usbc_mux.c diff --git a/src/ec/google/chromeec/Makefile.inc b/src/ec/google/chromeec/Makefile.inc index cb3b97e610..23e7b3d479 100644 --- a/src/ec/google/chromeec/Makefile.inc +++ b/src/ec/google/chromeec/Makefile.inc @@ -20,7 +20,7 @@ endif bootblock-y += ec.c bootblock-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c -ramstage-y += ec.c crosec_proto.c vstore.c +ramstage-y += ec.c crosec_proto.c vstore.c usbc_mux.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_I2C) += ec_i2c.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_LPC) += ec_lpc.c ramstage-$(CONFIG_EC_GOOGLE_CHROMEEC_SPI) += ec_spi.c diff --git a/src/ec/google/chromeec/usbc_mux.c b/src/ec/google/chromeec/usbc_mux.c new file mode 100644 index 0000000000..64195428b0 --- /dev/null +++ b/src/ec/google/chromeec/usbc_mux.c @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +static const struct usbc_ops google_chromeec_usbc_ops = { + .mux_ops = { + .get_mux_info = google_chromeec_get_usbc_mux_info, + }, + .dp_ops = { + .wait_for_connection = google_chromeec_wait_for_displayport, + .enter_dp_mode = google_chromeec_typec_control_enter_dp_mode, + .wait_for_hpd = google_chromeec_wait_for_dp_hpd, + }, +}; + +const struct usbc_ops *usbc_get_ops(void) +{ + return &google_chromeec_usbc_ops; +}