diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2023-03-10 14:07:47 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-03-10 10:09:00 +0000 |
commit | 55475e86d9d2c070412615dd8e0f7fa0c234299a (patch) | |
tree | 6add9db5fe52678d95982ef0998edcf48297a75e | |
parent | 2e8a4cfaae3a5bce52cf3a84ad4541affec37d35 (diff) | |
download | chrome-ec-55475e86d9d2c070412615dd8e0f7fa0c234299a.tar.gz |
tcpci: fix get_vbus_voltage macro
The scale mask is at b10 and b11. So the shift should be 10 instead.
BUG=b:272664811
TEST=with the next CL, ./twister -c -i -T zephyr/test/drivers
BRANCH=none
Change-Id: I53aa0557a184eec5d49dcfb7ba33869eba764470
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4328913
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Auto-Submit: Eric Yilun Lin <yllin@google.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r-- | include/driver/tcpm/tcpci.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/driver/tcpm/tcpci.h b/include/driver/tcpm/tcpci.h index eb2b4e7f9f..4ded8c23e7 100644 --- a/include/driver/tcpm/tcpci.h +++ b/include/driver/tcpm/tcpci.h @@ -279,7 +279,7 @@ * 11: reserved */ #define TCPC_REG_VBUS_VOLTAGE_SCALE(x) \ - (1 << (((x)&TCPC_REG_VBUS_VOLTAGE_SCALE_FACTOR) >> 9)) + (1 << (((x)&TCPC_REG_VBUS_VOLTAGE_SCALE_FACTOR) >> 10)) #define TCPC_REG_VBUS_VOLTAGE_MEASURE(x) ((x)&TCPC_REG_VBUS_VOLTAGE_MEASUREMENT) #define TCPC_REG_VBUS_VOLTAGE_VBUS(x) \ (TCPC_REG_VBUS_VOLTAGE_SCALE(x) * TCPC_REG_VBUS_VOLTAGE_MEASURE(x) * \ |