Date: | 2013-12-17 23:09:25 (9 years 9 months ago) |
---|---|
Author: | Apelete Seketeli |
Commit: | f715ea4ba25eb4e18a5542e2f6fff43c28fc1c51 |
Message: | usb: musb_gadget: use is_otg flag to set gadget peripheral mode on
reset Since jz4740 is not OTG compatible, rely on is_otg flag to set gadget peripheral mode on reset instead of accessing devct register which does not exists. Signed-off-by: Apelete Seketeli <apelete@seketeli.net> |
Files: |
drivers/usb/musb/musb_gadget.c (1 diff) |
Change Details
drivers/usb/musb/musb_gadget.c | ||
---|---|---|
2115 | 2115 | /* Normal reset, as B-Device; |
2116 | 2116 | * or else after HNP, as A-Device |
2117 | 2117 | */ |
2118 | #if defined(CONFIG_USB_MUSB_JZ4740) || defined(CONFIG_USB_MUSB_JZ4740_MODULE) | |
2119 | /* JZ4740 UDC Controller is not OTG compatible and does not | |
2120 | * have DEVCTL register in silicon: do not rely on devctl for | |
2121 | * setting peripheral mode. | |
2122 | */ | |
2123 | musb->xceiv->state = OTG_STATE_B_PERIPHERAL; | |
2124 | musb->g.is_a_peripheral = 0; | |
2125 | #else | |
2126 | if (devctl & MUSB_DEVCTL_BDEVICE) { | |
2118 | if (!musb->g.is_otg) { | |
2119 | /* JZ4740 UDC Controller is not OTG compatible, thus | |
2120 | * does not have DEVCTL register in silicon: do not | |
2121 | * rely on devctl for setting peripheral mode. | |
2122 | */ | |
2123 | musb->xceiv->state = OTG_STATE_B_PERIPHERAL; | |
2124 | musb->g.is_a_peripheral = 0; | |
2125 | } else if (devctl & MUSB_DEVCTL_BDEVICE) { | |
2127 | 2126 | musb->xceiv->state = OTG_STATE_B_PERIPHERAL; |
2128 | 2127 | musb->g.is_a_peripheral = 0; |
2129 | 2128 | } else { |
2130 | 2129 | musb->xceiv->state = OTG_STATE_A_PERIPHERAL; |
2131 | 2130 | musb->g.is_a_peripheral = 1; |
2132 | 2131 | } |
2133 | #endif | |
2132 | ||
2134 | 2133 | |
2135 | 2134 | /* start with default limits on VBUS power draw */ |
2136 | 2135 | (void) musb_gadget_vbus_draw(&musb->g, 8); |
Branches:
ben-wpan
ben-wpan-stefan
5396a9238205f20f811ea57898980d3ca82df0b6
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9