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>
Showing
Please register or sign in to comment