]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: add PM suspend and resume hooks
authorChunyan Zhang <zhang.chunyan@linaro.org>
Fri, 26 Jan 2018 13:08:47 +0000 (21:08 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jan 2018 14:43:55 +0000 (14:43 +0000)
commitcb37572bb537e3c223e9e05b454edc0fadf0b125
tree10ca83d0c4c018b03cdaf9a9597e3d75bf2e1a1c
parent5046829788abd6080612ca962e92e2f86d355d7f
regulator: add PM suspend and resume hooks

In this patch, consumers are allowed to set suspend voltage, and this
actually just set the "uV" in constraint::regulator_state, when the
regulator_suspend_late() was called by PM core through callback when
the system is entering into suspend, the regulator device would act
suspend activity then.

And it assumes that if any consumer set suspend voltage, the regulator
device should be enabled in the suspend state.  And if the suspend
voltage of a regulator device for all consumers was set zero, the
regulator device would be off in the suspend state.

This patch also provides a new function hook to regulator devices for
resuming from suspend states.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
drivers/regulator/of_regulator.c
include/linux/regulator/driver.h
include/linux/regulator/machine.h