power: qpnp-smbcharger: remove current limit vote on charger removal

Remove vote for input current limit(ICL) on  charger removal, this
will make sure ICL voter state is updated on charger removal and
vote for next insertion is not discarded as duplicate request.

CRs-Fixed: 981047
Change-Id: Iab16d12d27920183251820659c40d149c01b731e
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
This commit is contained in:
Ashay Jaiswal 2016-03-23 15:46:19 +05:30 committed by Gerrit - the friendly Code Review server
parent e8d2d9090d
commit 53357feb74
1 changed files with 11 additions and 2 deletions

View File

@ -4191,9 +4191,18 @@ static int smbchg_change_usb_supply_type(struct smbchg_chip *chip,
if (!chip->skip_usb_notification)
power_supply_set_supply_type(chip->usb_psy, type);
/* otherwise if it is unknown, set type after the vote */
if (type == POWER_SUPPLY_TYPE_UNKNOWN)
/*
* otherwise if it is unknown, remove vote
* and set type after the vote
*/
if (type == POWER_SUPPLY_TYPE_UNKNOWN) {
rc = vote(chip->usb_icl_votable, PSY_ICL_VOTER, false,
current_limit_ma);
if (rc < 0)
pr_err("Couldn't remove ICL vote rc=%d\n", rc);
chip->usb_supply_type = type;
}
/* set the correct buck switching frequency */
rc = smbchg_set_optimal_charging_mode(chip, type);