diff options
author | Diana Z <dzigterman@chromium.org> | 2020-11-18 15:54:30 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-21 02:58:23 +0000 |
commit | 5ebe284e2b8bfc7a9d1811c76d87882e4f468649 (patch) | |
tree | 4f1bee05c974531b2fd97e515e9b25e877c469c4 /board | |
parent | 24afe7306b8c35439831144bb67ddb3937e2c7f5 (diff) | |
download | chrome-ec-5ebe284e2b8bfc7a9d1811c76d87882e4f468649.tar.gz |
Drawcia: Handle more DB FW_CONFIG optionsstabilize-rust-13613.B-master
Ensure all reasonable values for the DB can be handled in the current
board code. Note this does not cover a 2C DB, as supporting 3 type-c
OCPC ports would require additional board and OCPC development.
BRANCH=None
BUG=b:171742626
TEST=load on drawcia and confirm correct number of PD ports up
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I781c40951a426766e346767447f6824f10655e4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548269
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/drawcia/board.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/board/drawcia/board.c b/board/drawcia/board.c index 7f96bdaef3..b7fb48ff62 100644 --- a/board/drawcia/board.c +++ b/board/drawcia/board.c @@ -471,18 +471,28 @@ __override void board_power_5v_enable(int enable) __override uint8_t board_get_usb_pd_port_count(void) { - if (get_cbi_fw_config_db() == DB_1A_HDMI) + enum fw_config_db db = get_cbi_fw_config_db(); + + if (db == DB_1A_HDMI || db == DB_NONE) return CONFIG_USB_PD_PORT_MAX_COUNT - 1; - else + else if (db == DB_1C || db == DB_1C_LTE) return CONFIG_USB_PD_PORT_MAX_COUNT; + + ccprints("Unhandled DB configuration: %d", db); + return 0; } __override uint8_t board_get_charger_chip_count(void) { - if (get_cbi_fw_config_db() == DB_1A_HDMI) + enum fw_config_db db = get_cbi_fw_config_db(); + + if (db == DB_1A_HDMI || db == DB_NONE) return CHARGER_NUM - 1; - else + else if (db == DB_1C || db == DB_1C_LTE) return CHARGER_NUM; + + ccprints("Unhandled DB configuration: %d", db); + return 0; } uint16_t tcpc_get_alert_status(void) |