summaryrefslogtreecommitdiff
path: root/common/usbc
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2020-02-11 16:24:41 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-14 00:17:11 +0000
commiteb3344e698973f61559614f9b0aaa6c0282e9e11 (patch)
treea9f4c1b886c1c7bc016d514a0737dc992d8bcb1d /common/usbc
parent35bb4afa2a1d69b12f77e74c77dfa65cc350781a (diff)
downloadchrome-ec-eb3344e698973f61559614f9b0aaa6c0282e9e11.tar.gz
TCPMv1/v2: Reduce number of arguments of pd_build_request()
BUG=b:148528713 BRANCH=none TEST=Manually tested on Volteer 1. When only one charger connected: Able to negotiate to PD max. 2. When two chargers are connected (one on each port): Non charging port is rejected Swaps the charging port based on charger's priority Change-Id: Ib7fdc5d31bf36189a85f8cd3217bec78f83a9efe Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051318 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usbc')
-rw-r--r--common/usbc/usb_pe_drp_sm.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 1581a26e41..5143bbd3a0 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -835,29 +835,10 @@ static void pe_send_request_msg(int port)
uint32_t rdo;
uint32_t curr_limit;
uint32_t supply_voltage;
- int charging;
- int max_request_allowed;
-
- if (IS_ENABLED(CONFIG_CHARGE_MANAGER))
- charging = (charge_manager_get_active_charge_port() == port);
- else
- charging = 1;
-
- if (IS_ENABLED(CONFIG_USB_PD_CHECK_MAX_REQUEST_ALLOWED))
- max_request_allowed = pd_is_max_request_allowed();
- else
- max_request_allowed = 1;
/* Build and send request RDO */
- /*
- * If this port is not actively charging or we are not allowed to
- * request the max voltage, then select vSafe5V
- */
- pd_build_request(pe[port].src_cap_cnt, pe[port].src_caps,
- pe[port].vpd_vdo, &rdo, &curr_limit,
- &supply_voltage, charging && max_request_allowed ?
- PD_REQUEST_MAX : PD_REQUEST_VSAFE5V,
- pd_get_max_voltage(), port);
+ pd_build_request(pe[port].vpd_vdo, &rdo, &curr_limit,
+ &supply_voltage, port);
CPRINTF("C%d Req [%d] %dmV %dmA", port, RDO_POS(rdo),
supply_voltage, curr_limit);