power: smb1351-charger: Disable parallel charging in shutdown path

Add parallel charger disabling logic to the shutdown path for
disabling parallel charger earlier to prevent over volatge
lockout issues.

Change-Id: I2f6838780f35b0a86baaa663d320316e51e38675
Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
This commit is contained in:
Umang Agrawal 2018-01-09 12:11:18 +05:30
parent 55cc722ec6
commit f8c4ccdcc5

View file

@ -3264,6 +3264,14 @@ static int smb1351_charger_remove(struct i2c_client *client)
return 0;
}
static void smb1351_charger_shutdown(struct i2c_client *client)
{
struct smb1351_charger *chip = i2c_get_clientdata(client);
if (chip->chg_present)
smb1351_usb_suspend(chip, USER, true);
}
static int smb1351_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@ -3343,6 +3351,7 @@ static struct i2c_driver smb1351_charger_driver = {
},
.probe = smb1351_charger_probe,
.remove = smb1351_charger_remove,
.shutdown = smb1351_charger_shutdown,
.id_table = smb1351_charger_id,
};