Commit 481046e
fwk: pd: return 0 voltage when no active charge port
For commit c7d2e2c.
When no AC is connected, prev_charge_port is -1. In such cases,
cypd_get_active_port_voltage() should return 0 instead of accessing
pd_port_states[-1], since there is no valid PD voltage without AC.
BRANCH=fwk-main
BUG=PD voltage gets a non 0 value when unplugging the AC
TEST=unplug AC and check the EC log "3lv-buck update! V:0mV"
Signed-off-by: johnwc_yeh <JohnWC_Yeh@compal.com>
(cherry picked from commit 3712efbeae1a3604f02e4aa5e7223f3e3778e52a)1 parent 259a1d9 commit 481046e
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1405 | 1405 | | |
1406 | 1406 | | |
1407 | 1407 | | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
1408 | 1411 | | |
1409 | 1412 | | |
1410 | 1413 | | |
| |||
0 commit comments