Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322727
b: refs/heads/master
c: c0a48e6
h: refs/heads/master
i:
  322725: 9f1bdc5
  322723: a3d6893
  322719: ee6aa8a
v: v3
  • Loading branch information
Michael Grzeschik authored and Greg Kroah-Hartman committed Sep 12, 2012
1 parent 16f865d commit aa5308a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 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: 7f67c38bdcb6d8bce02e10521fbf1618b586319f
refs/heads/master: c0a48e6c75f2ac190d812bea5fc339696e434c2e
21 changes: 17 additions & 4 deletions trunk/drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ static inline int ep_to_bit(struct ci13xxx *ci, int n)
}

/**
* hw_device_state: enables/disables interrupts & starts/stops device (execute
* without interruption)
* hw_device_state: enables/disables interrupts (execute without interruption)
* @dma: 0 => disable, !0 => enable and set dma engine
*
* This function returns an error code
Expand All @@ -91,9 +90,7 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma)
/* interrupt, error, port change, reset, sleep/suspend */
hw_write(ci, OP_USBINTR, ~0,
USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
} else {
hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
hw_write(ci, OP_USBINTR, ~0, 0);
}
return 0;
Expand Down Expand Up @@ -1420,6 +1417,21 @@ static int ci13xxx_vbus_draw(struct usb_gadget *_gadget, unsigned mA)
return -ENOTSUPP;
}

/* Change Data+ pullup status
* this func is used by usb_gadget_connect/disconnet
*/
static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on)
{
struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);

if (is_on)
hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
else
hw_write(ci, OP_USBCMD, USBCMD_RS, 0);

return 0;
}

static int ci13xxx_start(struct usb_gadget *gadget,
struct usb_gadget_driver *driver);
static int ci13xxx_stop(struct usb_gadget *gadget,
Expand All @@ -1432,6 +1444,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget,
static const struct usb_gadget_ops usb_gadget_ops = {
.vbus_session = ci13xxx_vbus_session,
.wakeup = ci13xxx_wakeup,
.pullup = ci13xxx_pullup,
.vbus_draw = ci13xxx_vbus_draw,
.udc_start = ci13xxx_start,
.udc_stop = ci13xxx_stop,
Expand Down

0 comments on commit aa5308a

Please sign in to comment.