diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2020-01-23 07:19:06 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-28 02:35:08 +0000 |
commit | 50d60e3fe12a852ae412d9502ca22a5b72cb441b (patch) | |
tree | 3d5f925aba3d00f523812acb5238548a6e3dc4a1 /driver/retimer/ps8818.c | |
parent | 43dfea03a49d46677590ac42f2fce4419835e1e7 (diff) | |
download | chrome-ec-50d60e3fe12a852ae412d9502ca22a5b72cb441b.tar.gz |
usb_mux: cleanup: Replace mux state enums with ec_command bit flag
BUG=b:145796172
BRANCH=none
TEST=make buildall -j
Change-Id: Ie4ffaf208745764262931501f0dff77b525a4e59
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2017569
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/retimer/ps8818.c')
-rw-r--r-- | driver/retimer/ps8818.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/driver/retimer/ps8818.c b/driver/retimer/ps8818.c index c542152a16..99802b7fcc 100644 --- a/driver/retimer/ps8818.c +++ b/driver/retimer/ps8818.c @@ -46,12 +46,12 @@ static int ps8818_set_mux(int port, mux_state_t mux_state) int val = 0; if (chipset_in_state(CHIPSET_STATE_HARD_OFF)) - return (mux_state == TYPEC_MUX_NONE) ? EC_SUCCESS + return (mux_state == USB_PD_MUX_NONE) ? EC_SUCCESS : EC_ERROR_NOT_POWERED; - if (mux_state & MUX_USB_ENABLED) + if (mux_state & USB_PD_MUX_USB_ENABLED) val |= PS8818_MODE_USB_ENABLE; - if (mux_state & MUX_DP_ENABLED) + if (mux_state & USB_PD_MUX_DP_ENABLED) val |= PS8818_MODE_DP_ENABLE; rv = ps8818_i2c_write(port, PS8818_REG_MODE, val); @@ -59,7 +59,7 @@ static int ps8818_set_mux(int port, mux_state_t mux_state) return rv; val = 0; - if (mux_state & MUX_POLARITY_INVERTED) + if (mux_state & USB_PD_MUX_POLARITY_INVERTED) val |= PS8818_FLIP_CONFIG; return ps8818_i2c_write(port, PS8818_REG_FLIP, val); |