diff options
author | Matthieu CASTET <matthieu.castet@parrot.com> | 2010-09-06 12:26:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:21:29 -0400 |
commit | 65fd42724aee31018b0bb53f4cb04971423be664 (patch) | |
tree | 54fa9d5551875be65d979ea34d58e8313461d6f5 /drivers/usb/host/ehci-fsl.c | |
parent | eabf0f5f09b1f1538d22c14aa0a703c11791bd1e (diff) |
USB: ehci tdi : let's tdi_reset set host mode
tdi_reset is already taking care of setting host mode for tdi devices.
Don't duplicate code in platform driver.
Make ehci_halt a nop if the controller is not in host mode (otherwise it
will fail), and let's ehci_reset do the tdi_reset.
We need to move hcd->has_tt flags before ehci_halt, in order ehci_halt
knows we are a tdi device.
Before the setup routine was doing :
- put controller in host mode
- ehci_halt
- ehci_init
- hcd->has_tt = 1;
- ehci_reset
Now we do :
- hcd->has_tt = 1;
- ehci_halt
- ehci_init
- ehci_reset
PS : now we handle correctly the device -> host transition.
Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-fsl.c')
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index a416421abfa2..8600317bd60b 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c | |||
@@ -233,8 +233,6 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd) | |||
233 | mpc83xx_setup_phy(ehci, pdata->phy_mode, 1); | 233 | mpc83xx_setup_phy(ehci, pdata->phy_mode, 1); |
234 | } | 234 | } |
235 | 235 | ||
236 | /* put controller in host mode. */ | ||
237 | ehci_writel(ehci, 0x00000003, non_ehci + FSL_SOC_USB_USBMODE); | ||
238 | #ifdef CONFIG_PPC_85xx | 236 | #ifdef CONFIG_PPC_85xx |
239 | out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008); | 237 | out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008); |
240 | out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080); | 238 | out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080); |
@@ -270,6 +268,8 @@ static int ehci_fsl_setup(struct usb_hcd *hcd) | |||
270 | /* cache this readonly data; minimize chip reads */ | 268 | /* cache this readonly data; minimize chip reads */ |
271 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); | 269 | ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); |
272 | 270 | ||
271 | hcd->has_tt = 1; | ||
272 | |||
273 | retval = ehci_halt(ehci); | 273 | retval = ehci_halt(ehci); |
274 | if (retval) | 274 | if (retval) |
275 | return retval; | 275 | return retval; |
@@ -279,8 +279,6 @@ static int ehci_fsl_setup(struct usb_hcd *hcd) | |||
279 | if (retval) | 279 | if (retval) |
280 | return retval; | 280 | return retval; |
281 | 281 | ||
282 | hcd->has_tt = 1; | ||
283 | |||
284 | ehci->sbrn = 0x20; | 282 | ehci->sbrn = 0x20; |
285 | 283 | ||
286 | ehci_reset(ehci); | 284 | ehci_reset(ehci); |