diff options
author | Patryk Duda <pdk@semihalf.com> | 2020-12-15 18:01:06 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-22 09:44:52 +0000 |
commit | 0fcc700324d8f8517e752e88b05fda49b0689c2c (patch) | |
tree | 505e9b4a66eb65fe7259dfdea95424aec1bb8840 /common/usb_pd_protocol.c | |
parent | 94a436afae45007cbb06f03bd933aab3f57c63a6 (diff) | |
download | chrome-ec-0fcc700324d8f8517e752e88b05fda49b0689c2c.tar.gz |
TCPMv1/TCPMv2: Add functions providing requested voltage and current
This patch adds functions responsible for providing voltage and current
requested from charger.
This patch doesn't introduce any logical changes.
BUG=b:161775827
BRANCH=none
TEST=make -j buildall
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: Ib86285e4c4e6f2da3f922a8a4389e78706f1de96
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592497
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r-- | common/usb_pd_protocol.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 43db22664b..29b07a0767 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -2619,6 +2619,18 @@ uint8_t pd_get_task_state(int port) return pd[port].task_state; } +#ifdef CONFIG_USB_PD_DUAL_ROLE +uint32_t pd_get_requested_voltage(int port) +{ + return pd[port].supply_voltage; +} + +uint32_t pd_get_requested_current(int port) +{ + return pd[port].curr_limit; +} +#endif + const char *pd_get_task_state_name(int port) { #ifdef CONFIG_USB_PD_TCPMV1_DEBUG |