diff options
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 32fb057c03f5..d4aa779339f1 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1727,14 +1727,14 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 epnum, int is_in) | |||
1727 | ep->end_point.name = ep->name; | 1727 | ep->end_point.name = ep->name; |
1728 | INIT_LIST_HEAD(&ep->end_point.ep_list); | 1728 | INIT_LIST_HEAD(&ep->end_point.ep_list); |
1729 | if (!epnum) { | 1729 | if (!epnum) { |
1730 | ep->end_point.maxpacket = 64; | 1730 | usb_ep_set_maxpacket_limit(&ep->end_point, 64); |
1731 | ep->end_point.ops = &musb_g_ep0_ops; | 1731 | ep->end_point.ops = &musb_g_ep0_ops; |
1732 | musb->g.ep0 = &ep->end_point; | 1732 | musb->g.ep0 = &ep->end_point; |
1733 | } else { | 1733 | } else { |
1734 | if (is_in) | 1734 | if (is_in) |
1735 | ep->end_point.maxpacket = hw_ep->max_packet_sz_tx; | 1735 | usb_ep_set_maxpacket_limit(&ep->end_point, hw_ep->max_packet_sz_tx); |
1736 | else | 1736 | else |
1737 | ep->end_point.maxpacket = hw_ep->max_packet_sz_rx; | 1737 | usb_ep_set_maxpacket_limit(&ep->end_point, hw_ep->max_packet_sz_rx); |
1738 | ep->end_point.ops = &musb_ep_ops; | 1738 | ep->end_point.ops = &musb_ep_ops; |
1739 | list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); | 1739 | list_add_tail(&ep->end_point.ep_list, &musb->g.ep_list); |
1740 | } | 1740 | } |
@@ -2119,7 +2119,15 @@ __acquires(musb->lock) | |||
2119 | /* Normal reset, as B-Device; | 2119 | /* Normal reset, as B-Device; |
2120 | * or else after HNP, as A-Device | 2120 | * or else after HNP, as A-Device |
2121 | */ | 2121 | */ |
2122 | if (devctl & MUSB_DEVCTL_BDEVICE) { | 2122 | if (!musb->g.is_otg) { |
2123 | /* USB device controllers that are not OTG compatible | ||
2124 | * may not have DEVCTL register in silicon. | ||
2125 | * In that case, do not rely on devctl for setting | ||
2126 | * peripheral mode. | ||
2127 | */ | ||
2128 | musb->xceiv->state = OTG_STATE_B_PERIPHERAL; | ||
2129 | musb->g.is_a_peripheral = 0; | ||
2130 | } else if (devctl & MUSB_DEVCTL_BDEVICE) { | ||
2123 | musb->xceiv->state = OTG_STATE_B_PERIPHERAL; | 2131 | musb->xceiv->state = OTG_STATE_B_PERIPHERAL; |
2124 | musb->g.is_a_peripheral = 0; | 2132 | musb->g.is_a_peripheral = 0; |
2125 | } else { | 2133 | } else { |