Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05c7ab49 authored by Harry Yang's avatar Harry Yang
Browse files

power: smb1355: put in suspend before shutdown



SMB1355 is not reset on device reboot, so its state will remain.
Suspend charging in shutdown hook to prevent parallel charging
before charger drivers are ready after reboot.

CRs-Fixed: 2044532
Change-Id: I128d7e17e7adfda7be7ed60c4961b1ba4dbd3cbf
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent b4b304e5
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -763,6 +763,17 @@ static int smb1355_remove(struct platform_device *pdev)
	return 0;
}

static void smb1355_shutdown(struct platform_device *pdev)
{
	struct smb1355 *chip = platform_get_drvdata(pdev);
	int rc;

	/* disable parallel charging path */
	rc = smb1355_set_parallel_charging(chip, true);
	if (rc < 0)
		pr_err("Couldn't disable parallel path rc=%d\n", rc);
}

static struct platform_driver smb1355_driver = {
	.driver	= {
		.name		= "qcom,smb1355-charger",
@@ -771,6 +782,7 @@ static struct platform_driver smb1355_driver = {
	},
	.probe		= smb1355_probe,
	.remove		= smb1355_remove,
	.shutdown	= smb1355_shutdown,
};
module_platform_driver(smb1355_driver);