Loading drivers/power/supply/qcom/smb5-lib.c +17 −15 Original line number Diff line number Diff line Loading @@ -1102,9 +1102,6 @@ static void smblib_uusb_removal(struct smb_charger *chg) cancel_delayed_work_sync(&chg->pl_enable_work); if (chg->wa_flags & CHG_TERMINATION_WA) alarm_cancel(&chg->chg_termination_alarm); if (chg->wa_flags & BOOST_BACK_WA) { data = chg->irq_info[SWITCHER_POWER_OK_IRQ].irq_data; if (data) { Loading Loading @@ -5356,9 +5353,6 @@ static void typec_src_removal(struct smb_charger *chg) cancel_delayed_work_sync(&chg->pl_enable_work); if (chg->wa_flags & CHG_TERMINATION_WA) alarm_cancel(&chg->chg_termination_alarm); /* reset input current limit voters */ vote(chg->usb_icl_votable, SW_ICL_MAX_VOTER, true, is_flash_active(chg) ? SDP_CURRENT_UA : SDP_100_MA); Loading Loading @@ -5706,18 +5700,21 @@ irqreturn_t dc_plugin_irq_handler(int irq, void *data) dev_err(chg->dev, "Couldn't enable secondary chargers rc=%d\n", rc); } } else if (chg->cp_reason == POWER_SUPPLY_CP_WIRELESS) { } else { if (chg->cp_reason == POWER_SUPPLY_CP_WIRELESS) { sec_charger = chg->sec_pl_present ? POWER_SUPPLY_CHARGER_SEC_PL : POWER_SUPPLY_CHARGER_SEC_NONE; rc = smblib_select_sec_charger(chg, sec_charger, POWER_SUPPLY_CP_NONE, false); if (rc < 0) dev_err(chg->dev, "Couldn't disable secondary charger rc=%d\n", dev_err(chg->dev, "Couldn't disable secondary charger rc=%d\n", rc); } vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, false, 0); } power_supply_changed(chg->dc_psy); smblib_dbg(chg, PR_WLS, "dcin_present= %d, usbin_present= %d, cp_reason = %d\n", Loading Loading @@ -6257,6 +6254,7 @@ static void smblib_chg_termination_work(struct work_struct *work) rc = smblib_get_prop_from_bms(chg, POWER_SUPPLY_PROP_CAPACITY, &pval); if ((rc < 0) || (pval.intval < 100)) { vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, false, 0); vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, false, 0); goto out; } Loading Loading @@ -6297,8 +6295,12 @@ static void smblib_chg_termination_work(struct work_struct *work) delay = CHG_TERM_WA_ENTRY_DELAY_MS; } else if (pval.intval > DIV_ROUND_CLOSEST(chg->cc_soc_ref * 10075, 10000)) { vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, true, 0); vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, true, 0); if (input_present & INPUT_PRESENT_USB) vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, true, 0); if (input_present & INPUT_PRESENT_DC) vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, true, 0); delay = CHG_TERM_WA_EXIT_DELAY_MS; } Loading Loading
drivers/power/supply/qcom/smb5-lib.c +17 −15 Original line number Diff line number Diff line Loading @@ -1102,9 +1102,6 @@ static void smblib_uusb_removal(struct smb_charger *chg) cancel_delayed_work_sync(&chg->pl_enable_work); if (chg->wa_flags & CHG_TERMINATION_WA) alarm_cancel(&chg->chg_termination_alarm); if (chg->wa_flags & BOOST_BACK_WA) { data = chg->irq_info[SWITCHER_POWER_OK_IRQ].irq_data; if (data) { Loading Loading @@ -5356,9 +5353,6 @@ static void typec_src_removal(struct smb_charger *chg) cancel_delayed_work_sync(&chg->pl_enable_work); if (chg->wa_flags & CHG_TERMINATION_WA) alarm_cancel(&chg->chg_termination_alarm); /* reset input current limit voters */ vote(chg->usb_icl_votable, SW_ICL_MAX_VOTER, true, is_flash_active(chg) ? SDP_CURRENT_UA : SDP_100_MA); Loading Loading @@ -5706,18 +5700,21 @@ irqreturn_t dc_plugin_irq_handler(int irq, void *data) dev_err(chg->dev, "Couldn't enable secondary chargers rc=%d\n", rc); } } else if (chg->cp_reason == POWER_SUPPLY_CP_WIRELESS) { } else { if (chg->cp_reason == POWER_SUPPLY_CP_WIRELESS) { sec_charger = chg->sec_pl_present ? POWER_SUPPLY_CHARGER_SEC_PL : POWER_SUPPLY_CHARGER_SEC_NONE; rc = smblib_select_sec_charger(chg, sec_charger, POWER_SUPPLY_CP_NONE, false); if (rc < 0) dev_err(chg->dev, "Couldn't disable secondary charger rc=%d\n", dev_err(chg->dev, "Couldn't disable secondary charger rc=%d\n", rc); } vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, false, 0); } power_supply_changed(chg->dc_psy); smblib_dbg(chg, PR_WLS, "dcin_present= %d, usbin_present= %d, cp_reason = %d\n", Loading Loading @@ -6257,6 +6254,7 @@ static void smblib_chg_termination_work(struct work_struct *work) rc = smblib_get_prop_from_bms(chg, POWER_SUPPLY_PROP_CAPACITY, &pval); if ((rc < 0) || (pval.intval < 100)) { vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, false, 0); vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, false, 0); goto out; } Loading Loading @@ -6297,8 +6295,12 @@ static void smblib_chg_termination_work(struct work_struct *work) delay = CHG_TERM_WA_ENTRY_DELAY_MS; } else if (pval.intval > DIV_ROUND_CLOSEST(chg->cc_soc_ref * 10075, 10000)) { vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, true, 0); vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, true, 0); if (input_present & INPUT_PRESENT_USB) vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, true, 0); if (input_present & INPUT_PRESENT_DC) vote(chg->dc_suspend_votable, CHG_TERMINATION_VOTER, true, 0); delay = CHG_TERM_WA_EXIT_DELAY_MS; } Loading