Merge "qcom: smb-lib: rerun APSD on insertion for micro USB mode"
This commit is contained in:
commit
0293b8a7d0
2 changed files with 14 additions and 0 deletions
|
@ -685,6 +685,7 @@ static void smblib_uusb_removal(struct smb_charger *chg)
|
|||
chg->voltage_max_uv = MICRO_5V;
|
||||
chg->usb_icl_delta_ua = 0;
|
||||
chg->pulse_cnt = 0;
|
||||
chg->uusb_apsd_rerun_done = false;
|
||||
|
||||
/* clear USB ICL vote for USB_PSY_VOTER */
|
||||
rc = vote(chg->usb_icl_votable, USB_PSY_VOTER, false, 0);
|
||||
|
@ -752,6 +753,7 @@ int smblib_rerun_apsd_if_required(struct smb_charger *chg)
|
|||
rc);
|
||||
}
|
||||
|
||||
chg->uusb_apsd_rerun_done = true;
|
||||
smblib_rerun_apsd(chg);
|
||||
|
||||
return 0;
|
||||
|
@ -3482,6 +3484,17 @@ irqreturn_t smblib_handle_usb_source_change(int irq, void *data)
|
|||
}
|
||||
smblib_dbg(chg, PR_REGISTER, "APSD_STATUS = 0x%02x\n", stat);
|
||||
|
||||
if (chg->micro_usb_mode && (stat & APSD_DTC_STATUS_DONE_BIT)
|
||||
&& !chg->uusb_apsd_rerun_done) {
|
||||
/*
|
||||
* Force re-run APSD to handle slow insertion related
|
||||
* charger-mis-detection.
|
||||
*/
|
||||
chg->uusb_apsd_rerun_done = true;
|
||||
smblib_rerun_apsd(chg);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
smblib_handle_apsd_done(chg,
|
||||
(bool)(stat & APSD_DTC_STATUS_DONE_BIT));
|
||||
|
||||
|
|
|
@ -312,6 +312,7 @@ struct smb_charger {
|
|||
int vconn_attempts;
|
||||
int default_icl_ua;
|
||||
int otg_cl_ua;
|
||||
bool uusb_apsd_rerun_done;
|
||||
|
||||
/* workaround flag */
|
||||
u32 wa_flags;
|
||||
|
|
Loading…
Add table
Reference in a new issue