diff options
author | Aaron Massey <aaronmassey@google.com> | 2022-01-18 16:28:59 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-21 22:44:08 +0000 |
commit | db0ed1b91ce7d3265128e6f93436d8eb949fd0b2 (patch) | |
tree | c500d94ed38e3d24793405eb2dc7a473e3972180 /board/host | |
parent | b2f8f3f7776fb62cec7d7a7267fffa56304b625f (diff) | |
download | chrome-ec-db0ed1b91ce7d3265128e6f93436d8eb949fd0b2.tar.gz |
charge_manager: test can EC_CMD_USB_PD_POWER_INFO
Enable the implementation of EC_CMD_USB_PD_POWER_INFO in test builds.
Add a mock implementation of ADCs.
BRANCH=none
BUG=b:215389861
TEST=make buildall
TEST=zmake configure --test test-drivers
Signed-off-by: Aaron Massey <aaronmassey@google.com>
Change-Id: Icdef25cfb8e01e62b680af87683ca1dd34f04542
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3399877
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'board/host')
-rw-r--r-- | board/host/board.c | 5 | ||||
-rw-r--r-- | board/host/board.h | 1 | ||||
-rw-r--r-- | board/host/usb_pd_policy.c | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/board/host/board.c b/board/host/board.c index b681ca98fb..e639b6bc99 100644 --- a/board/host/board.c +++ b/board/host/board.c @@ -20,6 +20,7 @@ #include "temp_sensor.h" #include "test_util.h" #include "timer.h" +#include "usb_pd_tcpm.h" #include "util.h" /* @@ -31,6 +32,10 @@ #include "gpio_list.h" +test_mockable const struct tcpc_config_t tcpc_config[] = { + [0] = {}, +}; + test_mockable enum battery_present battery_is_present(void) { return BP_YES; diff --git a/board/host/board.h b/board/host/board.h index f9d00961e7..979763af4e 100644 --- a/board/host/board.h +++ b/board/host/board.h @@ -44,6 +44,7 @@ enum temp_sensor_id { enum adc_channel { ADC_CH_CHARGER_CURRENT, ADC_AC_ADAPTER_ID_VOLTAGE, + ADC_VBUS, ADC_CH_COUNT }; diff --git a/board/host/usb_pd_policy.c b/board/host/usb_pd_policy.c index b02891ee29..b90db882ce 100644 --- a/board/host/usb_pd_policy.c +++ b/board/host/usb_pd_policy.c @@ -23,8 +23,8 @@ test_mockable void pd_power_supply_reset(int port) /* Not implemented */ } -void pd_set_input_current_limit(int port, uint32_t max_ma, - uint32_t supply_voltage) +__overridable void pd_set_input_current_limit(int port, uint32_t max_ma, + uint32_t supply_voltage) { /* Not implemented */ } |