summaryrefslogtreecommitdiff
path: root/drivers/regulator/act8945a-regulator.c
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2018-12-11 18:56:50 +0300
committerMark Brown <broonie@kernel.org>2018-12-12 19:59:35 +0300
commitb5ebba46e694a6e8e4322a80bb2a5a448f8f8b04 (patch)
tree124f11e7254b22c4a34178cc8388c3c1c3e5027d /drivers/regulator/act8945a-regulator.c
parent03ffbf9c0891caf8723c81967ceea5faf5d099d5 (diff)
downloadlinux-b5ebba46e694a6e8e4322a80bb2a5a448f8f8b04.tar.xz
regulator: act8945a-regulator: add shutdown function
Implement shutdown method to make sure the PMIC will not enter the suspend state when the system is shutdown. This work is based on work done by Borris Brezillon on [1]. [1] https://www.spinics.net/lists/kernel/msg2942960.html Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/act8945a-regulator.c')
-rw-r--r--drivers/regulator/act8945a-regulator.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/regulator/act8945a-regulator.c b/drivers/regulator/act8945a-regulator.c
index f4d60743efb3..90572b6370c6 100644
--- a/drivers/regulator/act8945a-regulator.c
+++ b/drivers/regulator/act8945a-regulator.c
@@ -339,12 +339,23 @@ static int act8945a_suspend(struct device *pdev)
SIMPLE_DEV_PM_OPS(act8945a_pm, act8945a_suspend, NULL);
+static void act8945a_pmic_shutdown(struct platform_device *pdev)
+{
+ struct act8945a_pmic *act8945a = platform_get_drvdata(pdev);
+
+ /*
+ * Ask the PMIC to shutdown everything on the next PWRHLD transition.
+ */
+ regmap_write(act8945a->regmap, ACT8945A_SYS_CTRL, 0x0);
+}
+
static struct platform_driver act8945a_pmic_driver = {
.driver = {
.name = "act8945a-regulator",
.pm = &act8945a_pm,
},
.probe = act8945a_pmic_probe,
+ .shutdown = act8945a_pmic_shutdown,
};
module_platform_driver(act8945a_pmic_driver);