summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlschyi <lschyi@google.com>2023-05-04 09:35:52 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-05 08:43:17 +0000
commit2c3bba532615ed7261fcf6a50e042abf1e4f097c (patch)
tree721473f4f9f71a0f92f73dd3b1b9958eeb9a40ad
parentc80b085203bfb1b9b69e1bb4347ace692464f8b3 (diff)
downloadchrome-ec-2c3bba532615ed7261fcf6a50e042abf1e4f097c.tar.gz
corsola: Update implementation for no daughter board
CORSOLA_DB_NONE was treated as no daughter board connected, however, there are 2 cases fall into this category: 1. There is no port 1 design on that board. 2. There is port 1 design on that board, yet it is not connected during development. As we update the implementation of configuring USB-C port in "corosla: Improve USB-C port configuration", we can defer the case 1 to dts configuration, so CORSOLA_DB_NONE is now dedicated for case 2. Update the returned pd port count so that if there is only 1 USB-C port, the only port still functions normally. BUG=b:274723043 TEST=By (1) removing port 1 configurations in Krabby, (2) setting `VARIANT_CORSOLA_DB_DETECTION` to no in Krabby, and build, flash onto Krabby proto 1 board, only port 0 is functioning with a. Accepting charging. b. USB device is working. c. DP works with external display (kernel is modified accordingly). Change-Id: I1aadb63a83b452ea8de83309d464918f76c7a511 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4505772 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Sung-Chi Li <lschyi@chromium.org>
-rw-r--r--zephyr/program/corsola/src/usbc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zephyr/program/corsola/src/usbc.c b/zephyr/program/corsola/src/usbc.c
index 5a97744724..181b3df141 100644
--- a/zephyr/program/corsola/src/usbc.c
+++ b/zephyr/program/corsola/src/usbc.c
@@ -56,8 +56,6 @@ __override uint8_t board_get_usb_pd_port_count(void)
} else {
return CONFIG_USB_PD_PORT_MAX_COUNT - 1;
}
- } else if (corsola_get_db_type() == CORSOLA_DB_NONE) {
- return CONFIG_USB_PD_PORT_MAX_COUNT - 1;
}
return CONFIG_USB_PD_PORT_MAX_COUNT;
@@ -65,7 +63,9 @@ __override uint8_t board_get_usb_pd_port_count(void)
uint8_t board_get_adjusted_usb_pd_port_count(void)
{
- if (corsola_get_db_type() == CORSOLA_DB_TYPEC) {
+ const enum corsola_db_type db = corsola_get_db_type();
+
+ if (db == CORSOLA_DB_TYPEC || db == CORSOLA_DB_NONE) {
return CONFIG_USB_PD_PORT_MAX_COUNT;
} else {
return CONFIG_USB_PD_PORT_MAX_COUNT - 1;