]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regulator: max77802: Add .set_suspend_{enable,disable} callbacks
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>
Wed, 15 Oct 2014 16:20:31 +0000 (18:20 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 20 Oct 2014 11:23:49 +0000 (12:23 +0100)
commite6fb2aac552ab229e01169776199c13e2524c318
treeb604d2c35a87c83d2cdf2c815639868f29416eef
parentf114040e3ea6e07372334ade75d1ee0775c355e1
regulator: max77802: Add .set_suspend_{enable,disable} callbacks

The max77802 PMIC has an enable pin (PWRREQ) that can be used to switch
regulators ON and OFF automatically by the Application Processor when
the system is leaving and entering sleep mode.

Only the BUCKs regulators had a .set_suspend_disable function handler
that used the enable pin to turn OFF the regulators during suspend.

But most LDOs also support that functionality (besides 1, 3, 20 and 21)
so rename the function to a more generic name and use the same function
for the LDOs. Also add a .set_suspend_enable handler for all regulators
and use the same function used for the .enable operation.

Finally, don't treat output ON/OFF controlled by PWRREQ as an operating
mode using the ambiguous MAX77802_OPMODE_STANDBY since it's not an opmode.
Instead make it clear that is a control value to switch the regulator OFF
by PWRREQ when the system is entering in a suspend state.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max77802.c