Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303935
b: refs/heads/master
c: e44694e
h: refs/heads/master
i:
  303933: 49d0841
  303931: ce95532
  303927: 55bcee3
  303919: 82e5a34
  303903: a9834b1
  303871: b70ed04
v: v3
  • Loading branch information
Shinya Kuribayashi authored and Greg Kroah-Hartman committed May 14, 2012
1 parent cd71594 commit 9a32d3d
Show file tree
Hide file tree
Showing 2 changed files with 11 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: a6dc9cf76b9c39ccffe083f09f995ce2502f5773
refs/heads/master: e44694e858ed000ef11ee37861c7f7c86d8ddbda
12 changes: 10 additions & 2 deletions trunk/drivers/usb/otg/gpio_vbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct gpio_vbus_data {
int vbus_draw_enabled;
unsigned mA;
struct delayed_work work;
int vbus;
};


Expand Down Expand Up @@ -96,18 +97,24 @@ static void gpio_vbus_work(struct work_struct *work)
struct gpio_vbus_data *gpio_vbus =
container_of(work, struct gpio_vbus_data, work.work);
struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
int gpio, status;
int gpio, status, vbus;

if (!gpio_vbus->phy.otg->gadget)
return;

vbus = is_vbus_powered(pdata);
if ((vbus ^ gpio_vbus->vbus) == 0)
return;
gpio_vbus->vbus = vbus;

/* Peripheral controllers which manage the pullup themselves won't have
* gpio_pullup configured here. If it's configured here, we'll do what
* isp1301_omap::b_peripheral() does and enable the pullup here... although
* that may complicate usb_gadget_{,dis}connect() support.
*/
gpio = pdata->gpio_pullup;
if (is_vbus_powered(pdata)) {

if (vbus) {
status = USB_EVENT_VBUS;
gpio_vbus->phy.state = OTG_STATE_B_PERIPHERAL;
gpio_vbus->phy.last_event = status;
Expand Down Expand Up @@ -195,6 +202,7 @@ static int gpio_vbus_set_peripheral(struct usb_otg *otg,
dev_dbg(&pdev->dev, "registered gadget '%s'\n", gadget->name);

/* initialize connection state */
gpio_vbus->vbus = 0; /* start with disconnected */
gpio_vbus_irq(irq, pdev);
return 0;
}
Expand Down

0 comments on commit 9a32d3d

Please sign in to comment.