diff options
author | Diana Z <dzigterman@chromium.org> | 2021-08-14 15:05:26 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-30 20:33:28 +0000 |
commit | fe3a60e79265658a8e5336c0eaada4977e083cd3 (patch) | |
tree | 09db3f89c5eb663daca1e5a1ed2b20708f37ab5c /include | |
parent | d32885333e9bba9915d5388b08e888e06dfad511 (diff) | |
download | chrome-ec-fe3a60e79265658a8e5336c0eaada4977e083cd3.tar.gz |
USB MUX: Convert usb_mux HPD functions to use mux_state_t
Since we have definitions for HPD IRQ and level in the mux flags, extend
this to the HPD update function in the usb_mux structure as well.
BRANCH=None
BUG=b:172222942
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I19c3a65fc821a341338d73fabd7876339b37fe7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095437
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/driver/tcpm/ps8xxx_public.h | 4 | ||||
-rw-r--r-- | include/ec_commands.h | 2 | ||||
-rw-r--r-- | include/usb_mux.h | 10 |
3 files changed, 9 insertions, 7 deletions
diff --git a/include/driver/tcpm/ps8xxx_public.h b/include/driver/tcpm/ps8xxx_public.h index 4426cda745..0e200cb395 100644 --- a/include/driver/tcpm/ps8xxx_public.h +++ b/include/driver/tcpm/ps8xxx_public.h @@ -8,6 +8,8 @@ #ifndef __CROS_EC_DRIVER_TCPM_PS8XXX_PUBLIC_H #define __CROS_EC_DRIVER_TCPM_PS8XXX_PUBLIC_H +#include "usb_mux.h" + struct usb_mux; /* I2C interface */ @@ -77,7 +79,7 @@ __override_proto uint16_t board_get_ps8xxx_product_id(int port); void ps8xxx_tcpc_update_hpd_status(const struct usb_mux *me, - int hpd_lvl, int hpd_irq); + mux_state_t mux_state); #ifdef CONFIG_CMD_I2C_STRESS_TEST_TCPC extern struct i2c_stress_test_dev ps8xxx_i2c_stress_test_dev; diff --git a/include/ec_commands.h b/include/ec_commands.h index 258c0819c6..9395175e73 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -5855,7 +5855,9 @@ struct ec_params_usb_pd_mux_info { #define USB_PD_MUX_DP_ENABLED BIT(1) /* DP connected */ #define USB_PD_MUX_POLARITY_INVERTED BIT(2) /* CC line Polarity inverted */ #define USB_PD_MUX_HPD_IRQ BIT(3) /* HPD IRQ is asserted */ +#define USB_PD_MUX_HPD_IRQ_DEASSERTED 0 /* HPD IRQ is deasserted */ #define USB_PD_MUX_HPD_LVL BIT(4) /* HPD level is asserted */ +#define USB_PD_MUX_HPD_LVL_DEASSERTED 0 /* HPD level is deasserted */ #define USB_PD_MUX_SAFE_MODE BIT(5) /* DP is in safe mode */ #define USB_PD_MUX_TBT_COMPAT_ENABLED BIT(6) /* TBT compat enabled */ #define USB_PD_MUX_USB4_ENABLED BIT(7) /* USB4 enabled */ diff --git a/include/usb_mux.h b/include/usb_mux.h index f2cd37acdb..c3f673b93a 100644 --- a/include/usb_mux.h +++ b/include/usb_mux.h @@ -136,17 +136,15 @@ struct usb_mux { int (*board_set)(const struct usb_mux *me, mux_state_t mux_state); /* - * TODO: Consider moving this to usb_mux_driver struct - * * USB Type-C DP alt mode support. Notify Type-C controller * there is DP dongle hot-plug. * * @param me usb_mux - * @param hpd_lvl Level - * @param hpd_irq IRQ + * @param mux_state with HPD IRQ and HPD LVL flags set + * accordingly */ void (*hpd_update)(const struct usb_mux *me, - int hpd_lvl, int hpd_irq); + mux_state_t mux_state); }; /* Supported USB mux drivers */ @@ -170,7 +168,7 @@ extern const struct usb_mux usb_muxes[]; #endif /* Supported hpd_update functions */ -void virtual_hpd_update(const struct usb_mux *me, int hpd_lvl, int hpd_irq); +void virtual_hpd_update(const struct usb_mux *me, mux_state_t mux_state); /* * Helper methods that either use tcpc communication or direct i2c |