diff options
author | Scott Collyer <scollyer@google.com> | 2019-04-02 17:35:02 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-01 12:42:18 +0000 |
commit | 4864eef4d84624a6fcc7f4fe428ae5a377a506ae (patch) | |
tree | 86357d7896e9afec4c588bcafd005bbbdab0b43b /board/glkrvp/chg_usb_pd.c | |
parent | bd2a9f4088eb9de327d6ca1b0de1ff9bc566dab0 (diff) | |
download | chrome-ec-4864eef4d84624a6fcc7f4fe428ae5a377a506ae.tar.gz |
tcpm: Refactor tcpc_config to include a flags field
tcpc_config contained a field for both the alert polarity and open
drain/push pull configuration. There is also a possible difference in TCPC
reset polarity. Instead of adding yet another field to describe this
configuration, it would be better to convert alert polairty, open
drain and reset polarity into a single flags field.
This CL modifies the tcpc_config struct to use a single flags field
and adds defines for what existing flag options can be.
BUG=b:130194031
BRANCH=none
TEST=make -j buildall
Change-Id: Ifb7e7604edb7021fb2d36ee279049eb52fefc99e
Signed-off-by: Scott Collyer <scollyer@google.com>
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1551581
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2315960
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Marco Chen <marcochen@chromium.org>
Commit-Queue: Marco Chen <marcochen@chromium.org>
Diffstat (limited to 'board/glkrvp/chg_usb_pd.c')
-rw-r--r-- | board/glkrvp/chg_usb_pd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/board/glkrvp/chg_usb_pd.c b/board/glkrvp/chg_usb_pd.c index 6ca5006860..3e4d739d56 100644 --- a/board/glkrvp/chg_usb_pd.c +++ b/board/glkrvp/chg_usb_pd.c @@ -31,8 +31,10 @@ enum glkrvp_charge_ports { }; const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { - {NPCX_I2C_PORT7_0, 0xA0, &tcpci_tcpm_drv, TCPC_ALERT_ACTIVE_LOW}, - {NPCX_I2C_PORT7_0, 0xA4, &tcpci_tcpm_drv, TCPC_ALERT_ACTIVE_LOW}, + /* Alert is active-low, push-pull */ + {NPCX_I2C_PORT7_0, 0xA0, &tcpci_tcpm_drv, 0}, + /* Alert is active-low, push-pull */ + {NPCX_I2C_PORT7_0, 0xA4, &tcpci_tcpm_drv, 0}, }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == CONFIG_USB_PD_PORT_MAX_COUNT); |