]> git.openfabrics.org - ~emulex/infiniband.git/commit
regulator: core: Support setting suspend_[mode|voltage] if set_suspend_[en|dis]able...
authorAxel Lin <axel.lin@gmail.com>
Sat, 14 Apr 2012 01:14:34 +0000 (09:14 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 16 Apr 2012 09:20:16 +0000 (10:20 +0100)
commit8ac0e95d6467ced054565312ecdf0a55a5333c64
tree95b3424f56d4e17dafeeae74845611af688efad1
parent3f24f5ada638dd07705bd83ebcc80044d587f374
regulator: core: Support setting suspend_[mode|voltage] if set_suspend_[en|dis]able is NULL

In current implementation, to support set_suspend_voltage and set_suspend_mode
the regulator code needs the regulator driver to implement both
set_suspend_enable and set_suspend_disable callbacks.

This patch removes this limitation. In the case set_suspend_enable and/or
set_suspend_disable are NULL, the regulator code assumes we don't need to
do any thing to enable/disable regulator when system is suspended and
then will continue to handle set_suspend_mode and set_suspend_voltage.

Currently the regulator core creates suspend state related sysfs entries only
if both set_suspend_enable and set_suspend_disable callbacks are not NULL.
A side-effect of this change is that the regulator core will create suspend
state related sysfs entries unconditionally now.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c