diff options
| author | Jack Pham <jackp@codeaurora.org> | 2016-08-22 16:53:59 -0700 |
|---|---|---|
| committer | Jack Pham <jackp@codeaurora.org> | 2016-08-22 17:03:37 -0700 |
| commit | 4e9330685211bfdbf0095678ba09d4d381b806f7 (patch) | |
| tree | cb6ce051cac81cbc2e36c459d76c52681fe352d2 /drivers/usb | |
| parent | 0c8cf716fa02d0f6b6ef2ef1446f9f4819fc83dd (diff) | |
usb: pd: Clear requested_voltage/current values on disconnect
During valid sink hard reset, if requested_current was non-zero,
the power_supply CURRENT_MAX property is set to 0 to tell the
charger driver to suspend charging while the source resets.
However, for non-PD sources this is not needed, and in fact would
falsely tell the charger to suspend charging indefinitely since
there is no event to restore a non-zero current vote. The bug here
is that although there is a check for non-zero requested_current,
this could be a stale value from a previous PD session, and a
subsequent non-PD adapter plugin results in no charging. Fix this
by clearing requested_voltage and requested_current on disconnect.
Change-Id: Ie770546916e24faa2932b64dee6277435a27ce3b
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Diffstat (limited to 'drivers/usb')
| -rw-r--r-- | drivers/usb/pd/policy_engine.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/pd/policy_engine.c b/drivers/usb/pd/policy_engine.c index b011efe189e7..fa7c5d5a5308 100644 --- a/drivers/usb/pd/policy_engine.c +++ b/drivers/usb/pd/policy_engine.c @@ -1250,6 +1250,8 @@ static void usbpd_sm(struct work_struct *w) pd->caps_count = 0; pd->hard_reset_count = 0; pd->src_cap_id = 0; + pd->requested_voltage = 0; + pd->requested_current = 0; memset(&pd->received_pdos, 0, sizeof(pd->received_pdos)); val.intval = 0; |
