Merge "usb: pd: policy_engine: Disable vconn first upon disconnect"

This commit is contained in:
Linux Build Service Account 2017-05-26 00:10:34 -07:00 committed by Gerrit - the friendly Code Review server
commit aa6325414f

View file

@ -1539,6 +1539,11 @@ static void usbpd_sm(struct work_struct *w)
if (pd->current_state == PE_UNKNOWN)
goto sm_done;
if (pd->vconn_enabled) {
regulator_disable(pd->vconn);
pd->vconn_enabled = false;
}
usbpd_info(&pd->dev, "USB Type-C disconnect\n");
if (pd->pd_phy_opened) {
@ -1574,11 +1579,6 @@ static void usbpd_sm(struct work_struct *w)
pd->vbus_enabled = false;
}
if (pd->vconn_enabled) {
regulator_disable(pd->vconn);
pd->vconn_enabled = false;
}
if (pd->current_dr == DR_UFP)
stop_usb_peripheral(pd);
else if (pd->current_dr == DR_DFP)
@ -3187,7 +3187,7 @@ struct usbpd *usbpd_create(struct device *parent)
if (ret)
goto free_pd;
pd->wq = alloc_ordered_workqueue("usbpd_wq", WQ_FREEZABLE);
pd->wq = alloc_ordered_workqueue("usbpd_wq", WQ_FREEZABLE | WQ_HIGHPRI);
if (!pd->wq) {
ret = -ENOMEM;
goto del_pd;