Skip to content

Commit

Permalink
regulator: core: Allow fixed enable_time to be set in the regulator_desc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Jul 3, 2012
1 parent 5260cd2 commit 79511ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
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);
}

Expand Down
4 changes: 4 additions & 0 deletions include/linux/regulator/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -201,6 +203,8 @@ struct regulator_desc {
unsigned int vsel_mask;
unsigned int enable_reg;
unsigned int enable_mask;

unsigned int enable_time;
};

/**
Expand Down

0 comments on commit 79511ed

Please sign in to comment.