qcom: qpnp-smb2: Reset switcher_power_ok irq count when USBIN_UV fires
Currently when 3 switcher_power_ok interrupts are seen within a second, the driver thinks that the switcher is reverse boosting and suspends USB input path. However, switcher_power_ok could happen 3 times within a second while AICL is run from a charger collapse, a valid usecase which ends up in an USB suspended state. Note that AICL run caused switcher_power_ok is accompanied by an USBIN_UV interrupt. Use that to distinguish reverse boost Vs AICL runs. In particular, reset the switcher_power_ok interrupt count updated by storm_watch when an USBIN_UV interrupt is seen. Change-Id: I6817c66319f9af03ac28324a8d863876fdadafb3 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This commit is contained in:
parent
2b9d6a362f
commit
6f4dec2b0c
3 changed files with 17 additions and 1 deletions
|
@ -1738,7 +1738,7 @@ static struct smb_irq_info smb2_irqs[] = {
|
||||||
},
|
},
|
||||||
[USBIN_UV_IRQ] = {
|
[USBIN_UV_IRQ] = {
|
||||||
.name = "usbin-uv",
|
.name = "usbin-uv",
|
||||||
.handler = smblib_handle_debug,
|
.handler = smblib_handle_usbin_uv,
|
||||||
},
|
},
|
||||||
[USBIN_OV_IRQ] = {
|
[USBIN_OV_IRQ] = {
|
||||||
.name = "usbin-ov",
|
.name = "usbin-ov",
|
||||||
|
|
|
@ -2806,6 +2806,21 @@ irqreturn_t smblib_handle_usb_psy_changed(int irq, void *data)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
irqreturn_t smblib_handle_usbin_uv(int irq, void *data)
|
||||||
|
{
|
||||||
|
struct smb_irq_data *irq_data = data;
|
||||||
|
struct smb_charger *chg = irq_data->parent_data;
|
||||||
|
struct storm_watch *wdata;
|
||||||
|
|
||||||
|
smblib_dbg(chg, PR_INTERRUPT, "IRQ: %s\n", irq_data->name);
|
||||||
|
if (!chg->irq_info[SWITCH_POWER_OK_IRQ].irq_data)
|
||||||
|
return IRQ_HANDLED;
|
||||||
|
|
||||||
|
wdata = &chg->irq_info[SWITCH_POWER_OK_IRQ].irq_data->storm_data;
|
||||||
|
reset_storm_count(wdata);
|
||||||
|
return IRQ_HANDLED;
|
||||||
|
}
|
||||||
|
|
||||||
irqreturn_t smblib_handle_usb_plugin(int irq, void *data)
|
irqreturn_t smblib_handle_usb_plugin(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct smb_irq_data *irq_data = data;
|
struct smb_irq_data *irq_data = data;
|
||||||
|
|
|
@ -354,6 +354,7 @@ irqreturn_t smblib_handle_step_chg_soc_update_request(int irq, void *data);
|
||||||
irqreturn_t smblib_handle_batt_temp_changed(int irq, void *data);
|
irqreturn_t smblib_handle_batt_temp_changed(int irq, void *data);
|
||||||
irqreturn_t smblib_handle_batt_psy_changed(int irq, void *data);
|
irqreturn_t smblib_handle_batt_psy_changed(int irq, void *data);
|
||||||
irqreturn_t smblib_handle_usb_psy_changed(int irq, void *data);
|
irqreturn_t smblib_handle_usb_psy_changed(int irq, void *data);
|
||||||
|
irqreturn_t smblib_handle_usbin_uv(int irq, void *data);
|
||||||
irqreturn_t smblib_handle_usb_plugin(int irq, void *data);
|
irqreturn_t smblib_handle_usb_plugin(int irq, void *data);
|
||||||
irqreturn_t smblib_handle_usb_source_change(int irq, void *data);
|
irqreturn_t smblib_handle_usb_source_change(int irq, void *data);
|
||||||
irqreturn_t smblib_handle_icl_change(int irq, void *data);
|
irqreturn_t smblib_handle_icl_change(int irq, void *data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue