Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242977
b: refs/heads/master
c: 42ab616
h: refs/heads/master
i:
  242975: f0af1cb
v: v3
  • Loading branch information
Linus Walleij authored and Liam Girdwood committed Mar 26, 2011
1 parent d4234bb commit 95ee5f4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88cd222b259d62148ab8c82398498b1a01314476
refs/heads/master: 42ab616afe8844261828395cc2e4708c867412c2
30 changes: 30 additions & 0 deletions trunk/drivers/regulator/ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* @voltage_mask: mask to control regulator voltage
* @voltages: supported voltage table
* @voltages_len: number of supported voltages for the regulator
* @delay: startup/set voltage delay in us
*/
struct ab8500_regulator_info {
struct device *dev;
Expand All @@ -55,6 +56,7 @@ struct ab8500_regulator_info {
u8 voltage_mask;
int const *voltages;
int voltages_len;
unsigned int delay;
};

/* voltage tables for the vauxn/vintcore supplies */
Expand Down Expand Up @@ -290,13 +292,38 @@ static int ab8500_regulator_set_voltage(struct regulator_dev *rdev,
return ret;
}

static int ab8500_regulator_enable_time(struct regulator_dev *rdev)
{
struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);

return info->delay;
}

static int ab8500_regulator_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int old_sel,
unsigned int new_sel)
{
struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
int ret;

/* If the regulator isn't on, it won't take time here */
ret = ab8500_regulator_is_enabled(rdev);
if (ret < 0)
return ret;
if (!ret)
return 0;
return info->delay;
}

static struct regulator_ops ab8500_regulator_ops = {
.enable = ab8500_regulator_enable,
.disable = ab8500_regulator_disable,
.is_enabled = ab8500_regulator_is_enabled,
.get_voltage = ab8500_regulator_get_voltage,
.set_voltage = ab8500_regulator_set_voltage,
.list_voltage = ab8500_list_voltage,
.enable_time = ab8500_regulator_enable_time,
.set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel,
};

static int ab8500_fixed_get_voltage(struct regulator_dev *rdev)
Expand All @@ -317,6 +344,8 @@ static struct regulator_ops ab8500_regulator_fixed_ops = {
.is_enabled = ab8500_regulator_is_enabled,
.get_voltage = ab8500_fixed_get_voltage,
.list_voltage = ab8500_list_voltage,
.enable_time = ab8500_regulator_enable_time,
.set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel,
};

static struct ab8500_regulator_info
Expand Down Expand Up @@ -426,6 +455,7 @@ static struct ab8500_regulator_info
.owner = THIS_MODULE,
.n_voltages = 1,
},
.delay = 10000,
.fixed_uV = 2000000,
.update_bank = 0x03,
.update_reg = 0x80,
Expand Down

0 comments on commit 95ee5f4

Please sign in to comment.