aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2020-06-22 18:11:07 +0530
committerMark Brown <broonie@kernel.org>2020-07-15 15:47:15 +0100
commitf7d7ad42a9dc2d63cab6a79fe31e6732a30dacf5 (patch)
tree754388c8a5bef1986a093f27c2849c47b145055e /include/linux/regulator
parentregulator: cros-ec: Constify cros_ec_regulator_voltage_ops (diff)
downloadlinux-dev-f7d7ad42a9dc2d63cab6a79fe31e6732a30dacf5.tar.xz
linux-dev-f7d7ad42a9dc2d63cab6a79fe31e6732a30dacf5.zip
regulator: Allow regulators to verify enabled during enable()
Some regulators might need to verify that they have indeed been enabled after the enable() call is made and enable_time delay has passed. This is implemented by repeatedly checking is_enabled() upto poll_enabled_time, waiting for the already calculated enable delay in each iteration. Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: https://lore.kernel.org/r/20200622124110.20971-2-sumit.semwal@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/driver.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 7eb9fea8e482..436df3ba0b2a 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -305,6 +305,9 @@ enum regulator_type {
* @enable_time: Time taken for initial enable of regulator (in uS).
* @off_on_delay: guard time (in uS), before re-enabling a regulator
*
+ * @poll_enabled_time: The polling interval (in uS) to use while checking that
+ * the regulator was actually enabled. Max upto enable_time.
+ *
* @of_map_mode: Maps a hardware mode defined in a DeviceTree to a standard mode
*/
struct regulator_desc {
@@ -372,6 +375,8 @@ struct regulator_desc {
unsigned int off_on_delay;
+ unsigned int poll_enabled_time;
+
unsigned int (*of_map_mode)(unsigned int mode);
};