Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Claudiu Beznea and committed by
Mark Brown
b5ebba46 03ffbf9c

+11
+11
drivers/regulator/act8945a-regulator.c
··· 339 339 340 340 SIMPLE_DEV_PM_OPS(act8945a_pm, act8945a_suspend, NULL); 341 341 342 + static void act8945a_pmic_shutdown(struct platform_device *pdev) 343 + { 344 + struct act8945a_pmic *act8945a = platform_get_drvdata(pdev); 345 + 346 + /* 347 + * Ask the PMIC to shutdown everything on the next PWRHLD transition. 348 + */ 349 + regmap_write(act8945a->regmap, ACT8945A_SYS_CTRL, 0x0); 350 + } 351 + 342 352 static struct platform_driver act8945a_pmic_driver = { 343 353 .driver = { 344 354 .name = "act8945a-regulator", 345 355 .pm = &act8945a_pm, 346 356 }, 347 357 .probe = act8945a_pmic_probe, 358 + .shutdown = act8945a_pmic_shutdown, 348 359 }; 349 360 module_platform_driver(act8945a_pmic_driver); 350 361