From 9a2676a949dad2a013ab7aaa6ff29ba04d64ebeb Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Tue, 8 Aug 2017 13:18:28 -0700 Subject: qpnp-qnovo: disable while shutting down While shutting down set the not_ok_to_qnovo votable to true, so that we skip measuring ESR if a pulse train done interrupt triggers right during the shutdown. Change-Id: If3a0a8e9b1d60920cbbedc16af91c05caec8dcb2 Signed-off-by: Abhijeet Dharmapurikar --- drivers/power/supply/qcom/qpnp-qnovo.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/power/supply/qcom/qpnp-qnovo.c b/drivers/power/supply/qcom/qpnp-qnovo.c index 98bb939f47ac..b70d97a7edf6 100644 --- a/drivers/power/supply/qcom/qpnp-qnovo.c +++ b/drivers/power/supply/qcom/qpnp-qnovo.c @@ -112,6 +112,7 @@ #define GAIN_LSB_FACTOR 976560 #define USER_VOTER "user_voter" +#define SHUTDOWN_VOTER "user_voter" #define OK_TO_QNOVO_VOTER "ok_to_qnovo_voter" #define QNOVO_VOTER "qnovo_voter" @@ -1726,6 +1727,13 @@ static int qnovo_remove(struct platform_device *pdev) return 0; } +static void qnovo_shutdown(struct platform_device *pdev) +{ + struct qnovo *chip = platform_get_drvdata(pdev); + + vote(chip->not_ok_to_qnovo_votable, SHUTDOWN_VOTER, true, 0); +} + static const struct of_device_id match_table[] = { { .compatible = "qcom,qpnp-qnovo", }, { }, @@ -1739,6 +1747,7 @@ static struct platform_driver qnovo_driver = { }, .probe = qnovo_probe, .remove = qnovo_remove, + .shutdown = qnovo_shutdown, }; module_platform_driver(qnovo_driver); -- cgit v1.2.3