Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364754
b: refs/heads/master
c: e8d891f
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed Mar 20, 2013
1 parent f8c4bb1 commit 6266c9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b64a15930c35c3c1046533aadcfe4f3233e70c20
refs/heads/master: e8d891fb7b8fe4ee7311820594323d46dbc31d45
9 changes: 7 additions & 2 deletions trunk/drivers/usb/phy/phy-gpio-vbus-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static void set_vbus_draw(struct gpio_vbus_data *gpio_vbus, unsigned mA)
{
struct regulator *vbus_draw = gpio_vbus->vbus_draw;
int enabled;
int ret;

if (!vbus_draw)
return;
Expand All @@ -69,12 +70,16 @@ static void set_vbus_draw(struct gpio_vbus_data *gpio_vbus, unsigned mA)
if (mA) {
regulator_set_current_limit(vbus_draw, 0, 1000 * mA);
if (!enabled) {
regulator_enable(vbus_draw);
ret = regulator_enable(vbus_draw);
if (ret < 0)
return;
gpio_vbus->vbus_draw_enabled = 1;
}
} else {
if (enabled) {
regulator_disable(vbus_draw);
ret = regulator_disable(vbus_draw);
if (ret < 0)
return;
gpio_vbus->vbus_draw_enabled = 0;
}
}
Expand Down

0 comments on commit 6266c9e

Please sign in to comment.