mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-05 14:31:31 +00:00
Bug fixes for USB PD policies
We used the incorrect src_caps index when choosing PD voltage. Let's fix it to ask for all available power until we are able to ask only for what we need. BUG=None TEST=make buildall BRANCH=None Change-Id: I068264246c2586b8192220eff47838da438899b0 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/207802 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
6e9cd48917
commit
e9d8a8cfb5
@@ -60,7 +60,7 @@ int pd_choose_voltage(int cnt, uint32_t *src_caps, uint32_t *rdo)
|
||||
|
||||
/* request all the power ... */
|
||||
if ((src_caps[max_i] & PDO_TYPE_MASK) == PDO_TYPE_BATTERY) {
|
||||
int uw = 250000 * (src_caps[i] & 0x3FF);
|
||||
int uw = 250000 * (src_caps[max_i] & 0x3FF);
|
||||
*rdo = RDO_BATT(max_i + 1, uw/2, uw, 0);
|
||||
ccprintf("Request [%d] %dV %d/%d mW\n",
|
||||
max_i, sel_mv/1000, uw/1000, uw/1000);
|
||||
|
||||
@@ -61,7 +61,7 @@ int pd_choose_voltage(int cnt, uint32_t *src_caps, uint32_t *rdo)
|
||||
|
||||
/* request all the power ... */
|
||||
if ((src_caps[max_i] & PDO_TYPE_MASK) == PDO_TYPE_BATTERY) {
|
||||
int uw = 250000 * (src_caps[i] & 0x3FF);
|
||||
int uw = 250000 * (src_caps[max_i] & 0x3FF);
|
||||
*rdo = RDO_BATT(max_i + 1, uw/2, uw, 0);
|
||||
ccprintf("Request [%d] %dV %d/%d mW\n",
|
||||
max_i, sel_mv/1000, uw/1000, uw/1000);
|
||||
|
||||
@@ -68,7 +68,7 @@ int pd_choose_voltage(int cnt, uint32_t *src_caps, uint32_t *rdo)
|
||||
|
||||
/* request all the power ... */
|
||||
if ((src_caps[max_i] & PDO_TYPE_MASK) == PDO_TYPE_BATTERY) {
|
||||
int uw = 250000 * (src_caps[i] & 0x3FF);
|
||||
int uw = 250000 * (src_caps[max_i] & 0x3FF);
|
||||
*rdo = RDO_BATT(max_i + 1, uw/2, uw, 0);
|
||||
ccprintf("Request [%d] %dV %d/%d mW\n",
|
||||
max_i, sel_mv/1000, uw/1000, uw/1000);
|
||||
|
||||
Reference in New Issue
Block a user