diff options
| -rw-r--r-- | drivers/usb/chipidea/udc.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 7801a3f8be90..32ee8701e199 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
| @@ -78,8 +78,7 @@ static inline int ep_to_bit(struct ci13xxx *ci, int n) | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | /** | 80 | /** |
| 81 | * hw_device_state: enables/disables interrupts & starts/stops device (execute | 81 | * hw_device_state: enables/disables interrupts (execute without interruption) |
| 82 | * without interruption) | ||
| 83 | * @dma: 0 => disable, !0 => enable and set dma engine | 82 | * @dma: 0 => disable, !0 => enable and set dma engine |
| 84 | * | 83 | * |
| 85 | * This function returns an error code | 84 | * This function returns an error code |
| @@ -91,9 +90,7 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma) | |||
| 91 | /* interrupt, error, port change, reset, sleep/suspend */ | 90 | /* interrupt, error, port change, reset, sleep/suspend */ |
| 92 | hw_write(ci, OP_USBINTR, ~0, | 91 | hw_write(ci, OP_USBINTR, ~0, |
| 93 | USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); | 92 | USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); |
| 94 | hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); | ||
| 95 | } else { | 93 | } else { |
| 96 | hw_write(ci, OP_USBCMD, USBCMD_RS, 0); | ||
| 97 | hw_write(ci, OP_USBINTR, ~0, 0); | 94 | hw_write(ci, OP_USBINTR, ~0, 0); |
| 98 | } | 95 | } |
| 99 | return 0; | 96 | return 0; |
| @@ -1420,6 +1417,21 @@ static int ci13xxx_vbus_draw(struct usb_gadget *_gadget, unsigned mA) | |||
| 1420 | return -ENOTSUPP; | 1417 | return -ENOTSUPP; |
| 1421 | } | 1418 | } |
| 1422 | 1419 | ||
| 1420 | /* Change Data+ pullup status | ||
| 1421 | * this func is used by usb_gadget_connect/disconnet | ||
| 1422 | */ | ||
| 1423 | static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on) | ||
| 1424 | { | ||
| 1425 | struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget); | ||
| 1426 | |||
| 1427 | if (is_on) | ||
| 1428 | hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); | ||
| 1429 | else | ||
| 1430 | hw_write(ci, OP_USBCMD, USBCMD_RS, 0); | ||
| 1431 | |||
| 1432 | return 0; | ||
| 1433 | } | ||
| 1434 | |||
| 1423 | static int ci13xxx_start(struct usb_gadget *gadget, | 1435 | static int ci13xxx_start(struct usb_gadget *gadget, |
| 1424 | struct usb_gadget_driver *driver); | 1436 | struct usb_gadget_driver *driver); |
| 1425 | static int ci13xxx_stop(struct usb_gadget *gadget, | 1437 | static int ci13xxx_stop(struct usb_gadget *gadget, |
| @@ -1432,6 +1444,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget, | |||
| 1432 | static const struct usb_gadget_ops usb_gadget_ops = { | 1444 | static const struct usb_gadget_ops usb_gadget_ops = { |
| 1433 | .vbus_session = ci13xxx_vbus_session, | 1445 | .vbus_session = ci13xxx_vbus_session, |
| 1434 | .wakeup = ci13xxx_wakeup, | 1446 | .wakeup = ci13xxx_wakeup, |
| 1447 | .pullup = ci13xxx_pullup, | ||
| 1435 | .vbus_draw = ci13xxx_vbus_draw, | 1448 | .vbus_draw = ci13xxx_vbus_draw, |
| 1436 | .udc_start = ci13xxx_start, | 1449 | .udc_start = ci13xxx_start, |
| 1437 | .udc_stop = ci13xxx_stop, | 1450 | .udc_stop = ci13xxx_stop, |
