regulator: core: Allow fixed enable_time to be set in the regulator_desc
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 27 Jun 2012 13:23:10 +0000 (14:23 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Jul 2012 19:28:33 +0000 (20:28 +0100)
Many regulators have a fixed specification for their enable time. Allow
this to be set in the regulator_desc as a number to save them having to
implement an explicit operation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c
include/linux/regulator/driver.h

index aa82c0465f4f35ccd1811cf42dbf9c1913850168..6e488aa6f1e810b770d6df438e751840993c675b 100644 (file)
@@ -1189,7 +1189,7 @@ overflow_err:
 static int _regulator_get_enable_time(struct regulator_dev *rdev)
 {
        if (!rdev->desc->ops->enable_time)
-               return 0;
+               return rdev->desc->enable_time;
        return rdev->desc->ops->enable_time(rdev);
 }
 
index 84f999ed394bb1a51398785805c0198f19797c84..176bd4335581701ab73c0d0d8403b0d5d47026c5 100644 (file)
@@ -180,6 +180,8 @@ enum regulator_type {
  * @vsel_mask: Mask for register bitfield used for selector
  * @enable_reg: Register for control when using regmap enable/disable ops
  * @enable_mask: Mask for control when using regmap enable/disable ops
+ *
+ * @enable_time: Time taken for initial enable of regulator (in uS).
  */
 struct regulator_desc {
        const char *name;
@@ -201,6 +203,8 @@ struct regulator_desc {
        unsigned int vsel_mask;
        unsigned int enable_reg;
        unsigned int enable_mask;
+
+       unsigned int enable_time;
 };
 
 /**