Commit 79511ed3 authored by Mark Brown's avatar Mark Brown

regulator: core: Allow fixed enable_time to be set in the regulator_desc

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 5260cd2b
...@@ -1189,7 +1189,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, ...@@ -1189,7 +1189,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
static int _regulator_get_enable_time(struct regulator_dev *rdev) static int _regulator_get_enable_time(struct regulator_dev *rdev)
{ {
if (!rdev->desc->ops->enable_time) if (!rdev->desc->ops->enable_time)
return 0; return rdev->desc->enable_time;
return rdev->desc->ops->enable_time(rdev); return rdev->desc->ops->enable_time(rdev);
} }
......
...@@ -180,6 +180,8 @@ enum regulator_type { ...@@ -180,6 +180,8 @@ enum regulator_type {
* @vsel_mask: Mask for register bitfield used for selector * @vsel_mask: Mask for register bitfield used for selector
* @enable_reg: Register for control when using regmap enable/disable ops * @enable_reg: Register for control when using regmap enable/disable ops
* @enable_mask: Mask 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 { struct regulator_desc {
const char *name; const char *name;
...@@ -201,6 +203,8 @@ struct regulator_desc { ...@@ -201,6 +203,8 @@ struct regulator_desc {
unsigned int vsel_mask; unsigned int vsel_mask;
unsigned int enable_reg; unsigned int enable_reg;
unsigned int enable_mask; unsigned int enable_mask;
unsigned int enable_time;
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment