aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-mxc.c
diff options
context:
space:
mode:
authorMatthieu CASTET <matthieu.castet@parrot.com>2010-09-06 12:26:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:21:29 -0400
commit65fd42724aee31018b0bb53f4cb04971423be664 (patch)
tree54fa9d5551875be65d979ea34d58e8313461d6f5 /drivers/usb/host/ehci-mxc.c
parenteabf0f5f09b1f1538d22c14aa0a703c11791bd1e (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-mxc.c')
-rw-r--r--drivers/usb/host/ehci-mxc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index a8ad8ac120a2..ac9c4d7c44af 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -26,9 +26,6 @@
26#include <mach/mxc_ehci.h> 26#include <mach/mxc_ehci.h>
27 27
28#define ULPI_VIEWPORT_OFFSET 0x170 28#define ULPI_VIEWPORT_OFFSET 0x170
29#define PORTSC_OFFSET 0x184
30#define USBMODE_OFFSET 0x1a8
31#define USBMODE_CM_HOST 3
32 29
33struct ehci_mxc_priv { 30struct ehci_mxc_priv {
34 struct clk *usbclk, *ahbclk; 31 struct clk *usbclk, *ahbclk;
@@ -51,6 +48,8 @@ static int ehci_mxc_setup(struct usb_hcd *hcd)
51 /* cache this readonly data; minimize chip reads */ 48 /* cache this readonly data; minimize chip reads */
52 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 49 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
53 50
51 hcd->has_tt = 1;
52
54 retval = ehci_halt(ehci); 53 retval = ehci_halt(ehci);
55 if (retval) 54 if (retval)
56 return retval; 55 return retval;
@@ -60,8 +59,6 @@ static int ehci_mxc_setup(struct usb_hcd *hcd)
60 if (retval) 59 if (retval)
61 return retval; 60 return retval;
62 61
63 hcd->has_tt = 1;
64
65 ehci->sbrn = 0x20; 62 ehci->sbrn = 0x20;
66 63
67 ehci_reset(ehci); 64 ehci_reset(ehci);
@@ -191,12 +188,8 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
191 clk_enable(priv->ahbclk); 188 clk_enable(priv->ahbclk);
192 } 189 }
193 190
194 /* set USBMODE to host mode */
195 temp = readl(hcd->regs + USBMODE_OFFSET);
196 writel(temp | USBMODE_CM_HOST, hcd->regs + USBMODE_OFFSET);
197
198 /* set up the PORTSCx register */ 191 /* set up the PORTSCx register */
199 writel(pdata->portsc, hcd->regs + PORTSC_OFFSET); 192 ehci_writel(ehci, pdata->portsc, &ehci->regs->port_status[0]);
200 mdelay(10); 193 mdelay(10);
201 194
202 /* setup specific usb hw */ 195 /* setup specific usb hw */