summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2020-05-28 12:30:15 +0530
committerSumit Semwal <sumit.semwal@linaro.org>2020-06-25 20:08:21 +0530
commitd4a2c0b63516e2faecb6cbcc1dc10d7a1fbb3ecb (patch)
tree0060aca0e09ba93acf280e6f850b7997a514255d /include
parentfb00484d14c0b839a048dff09dec021c1701410c (diff)
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> Change-Id: I8f0c9f6aaa1be5373628b1bcd77dbd6a53c65d0e --- v3: addressed minor review comments, improved kernel doc v2: Address review comments, including swapping enable_time and poll_enabled_time.
Diffstat (limited to 'include')
-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);
};