summaryrefslogtreecommitdiff
path: root/board/servo_v4
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-04-06 15:02:55 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-13 01:36:59 +0000
commit33d4fba9daf641d8f52171bc1a1de823a1afb650 (patch)
tree0f815ed6c8e4fe2e614e1c9bd30fe6a25fe52108 /board/servo_v4
parent882d9d5f607437f8be042df43730c5bdc8c7931e (diff)
downloadchrome-ec-33d4fba9daf641d8f52171bc1a1de823a1afb650.tar.gz
ec: Filter non-FIXED PDOs in servo_v4{p1}
Add a new config CONFIG_USB_PD_ONLY_FIXED_PDOS. If that config is enabled, ignore non-FIXED PDOs in both the console command `ada_srccaps` and also when selecting the preferred PDO for a voltage. Enable CONFIG_USB_PD_ONLY_FIXED_PDOS for servo_v4 and servo_v4p1, since they don't expose non-fixed PDO in their srccaps. Without this change, there is a risk that the "best" PDO for a given voltage will be non-FIXED and then that voltage just won't be supported at all. BRANCH=none BUG=b:178484932 TEST=added Change-Id: I0d1187ca372120c7fe21d627e1b82b59f6334add Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809353 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/servo_v4')
-rw-r--r--board/servo_v4/board.h1
-rw-r--r--board/servo_v4/usb_pd_policy.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/board/servo_v4/board.h b/board/servo_v4/board.h
index 5583af223d..9a0973fe41 100644
--- a/board/servo_v4/board.h
+++ b/board/servo_v4/board.h
@@ -131,6 +131,7 @@
#undef CONFIG_USB_PD_PULLUP
#define CONFIG_USB_PD_PULLUP TYPEC_RP_USB
#define CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT
+#define CONFIG_USB_PD_ONLY_FIXED_PDOS
/* Don't automatically change roles */
#undef CONFIG_USB_PD_INITIAL_DRP_STATE
diff --git a/board/servo_v4/usb_pd_policy.c b/board/servo_v4/usb_pd_policy.c
index e85c6b0328..f3df427851 100644
--- a/board/servo_v4/usb_pd_policy.c
+++ b/board/servo_v4/usb_pd_policy.c
@@ -1214,8 +1214,8 @@ static int cmd_ada_srccaps(int argc, char *argv[])
for (i = 0; i < pd_get_src_cap_cnt(CHG); ++i) {
uint32_t max_ma, max_mv, unused;
- /* It's an supported Augmented PDO (PD3.0) */
- if ((ada_srccaps[i] & PDO_TYPE_MASK) == PDO_TYPE_AUGMENTED)
+ if (IS_ENABLED(CONFIG_USB_PD_ONLY_FIXED_PDOS) &&
+ (ada_srccaps[i] & PDO_TYPE_MASK) != PDO_TYPE_FIXED)
continue;
pd_extract_pdo_power(ada_srccaps[i], &max_ma, &max_mv, &unused);