Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226975
b: refs/heads/master
c: c036019
h: refs/heads/master
i:
  226973: e7a6b93
  226971: cb47124
  226967: d09fdac
  226959: 16de3f8
  226943: 1485e35
v: v3
  • Loading branch information
Pavankumar Kondeti authored and Greg Kroah-Hartman committed Dec 10, 2010
1 parent 3d4f35e commit df174c9
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 33f82f387b9cb27bc903e1368fce88b73213910a
refs/heads/master: c036019ed2b729cb9517806c2b388b4f4323a904
10 changes: 10 additions & 0 deletions trunk/drivers/usb/gadget/ci13xxx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
Expand Down Expand Up @@ -2348,6 +2349,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)

if (gadget_ready) {
if (is_active) {
pm_runtime_get_sync(&_gadget->dev);
hw_device_reset(udc);
hw_device_state(udc->ci13xxx_ep[0].qh[RX].dma);
} else {
Expand All @@ -2356,6 +2358,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
udc->udc_driver->notify_event(udc,
CI13XXX_CONTROLLER_STOPPED_EVENT);
_gadget_stop_activity(&udc->gadget);
pm_runtime_put_sync(&_gadget->dev);
}
}

Expand Down Expand Up @@ -2473,16 +2476,20 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
goto done;
}

pm_runtime_get_sync(&udc->gadget.dev);
if (udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) {
if (udc->vbus_active) {
if (udc->udc_driver->flags & CI13XXX_REGS_SHARED)
hw_device_reset(udc);
} else {
pm_runtime_put_sync(&udc->gadget.dev);
goto done;
}
}

retval = hw_device_state(udc->ci13xxx_ep[0].qh[RX].dma);
if (retval)
pm_runtime_put_sync(&udc->gadget.dev);

done:
spin_unlock_irqrestore(udc->lock, flags);
Expand Down Expand Up @@ -2522,6 +2529,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
udc->udc_driver->notify_event(udc,
CI13XXX_CONTROLLER_STOPPED_EVENT);
_gadget_stop_activity(&udc->gadget);
pm_runtime_put(&udc->gadget.dev);
}

/* unbind gadget */
Expand Down Expand Up @@ -2723,6 +2731,8 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
if (retval)
goto remove_dbg;
}
pm_runtime_no_callbacks(&udc->gadget.dev);
pm_runtime_enable(&udc->gadget.dev);

_udc = udc;
return retval;
Expand Down

0 comments on commit df174c9

Please sign in to comment.