Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185659
b: refs/heads/master
c: eda79a3
h: refs/heads/master
i:
  185657: 5e09e69
  185655: 4daa343
v: v3
  • Loading branch information
Adrian Hunter authored and Liam Girdwood committed Mar 3, 2010
1 parent d2603a9 commit 6a1b1cc
Show file tree
Hide file tree
Showing 3 changed files with 8 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: 75c8ac22e4b8ebea8169a090e64d034a96758644
refs/heads/master: eda79a3041a2cada0d4ee9491c99c3874b322356
5 changes: 5 additions & 0 deletions trunk/drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
#include <linux/regulator/driver.h>
#include <linux/regulator/fixed.h>
#include <linux/gpio.h>
#include <linux/delay.h>

struct fixed_voltage_data {
struct regulator_desc desc;
struct regulator_dev *dev;
int microvolts;
int gpio;
unsigned startup_delay;
unsigned enable_high:1;
unsigned is_enabled:1;
};
Expand All @@ -48,6 +50,8 @@ static int fixed_voltage_enable(struct regulator_dev *dev)
if (gpio_is_valid(data->gpio)) {
gpio_set_value_cansleep(data->gpio, data->enable_high);
data->is_enabled = 1;
if (data->startup_delay)
udelay(data->startup_delay);
}

return 0;
Expand Down Expand Up @@ -117,6 +121,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)

drvdata->microvolts = config->microvolts;
drvdata->gpio = config->gpio;
drvdata->startup_delay = config->startup_delay;

if (gpio_is_valid(config->gpio)) {
drvdata->enable_high = config->enable_high;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/regulator/fixed.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct regulator_init_data;
* @microvolts: Output voltage of regulator
* @gpio: GPIO to use for enable control
* set to -EINVAL if not used
* @startup_delay: Start-up time in microseconds
* @enable_high: Polarity of enable GPIO
* 1 = Active high, 0 = Active low
* @enabled_at_boot: Whether regulator has been enabled at
Expand All @@ -41,6 +42,7 @@ struct fixed_voltage_config {
const char *supply_name;
int microvolts;
int gpio;
unsigned startup_delay;
unsigned enable_high:1;
unsigned enabled_at_boot:1;
struct regulator_init_data *init_data;
Expand Down

0 comments on commit 6a1b1cc

Please sign in to comment.