ehci-fsl.c (ffd76d8be36da09f8456c55569c008f5aa93095e) | ehci-fsl.c (b96d3b08365f5a9603f50f3aadca6012f7eaffa1) |
---|---|
1/* 2 * Copyright 2005-2009 MontaVista Software, Inc. 3 * Copyright 2008 Freescale Semiconductor, Inc. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License as published by the 7 * Free Software Foundation; either version 2 of the License, or (at your 8 * option) any later version. --- 128 unchanged lines hidden (view full) --- 137 retval = usb_add_hcd(hcd, irq, IRQF_SHARED); 138 if (retval != 0) 139 goto err4; 140 141#ifdef CONFIG_USB_OTG 142 if (pdata->operating_mode == FSL_USB2_DR_OTG) { 143 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 144 | 1/* 2 * Copyright 2005-2009 MontaVista Software, Inc. 3 * Copyright 2008 Freescale Semiconductor, Inc. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License as published by the 7 * Free Software Foundation; either version 2 of the License, or (at your 8 * option) any later version. --- 128 unchanged lines hidden (view full) --- 137 retval = usb_add_hcd(hcd, irq, IRQF_SHARED); 138 if (retval != 0) 139 goto err4; 140 141#ifdef CONFIG_USB_OTG 142 if (pdata->operating_mode == FSL_USB2_DR_OTG) { 143 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 144 |
145 ehci->transceiver = otg_get_transceiver(); | 145 ehci->transceiver = usb_get_transceiver(); |
146 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", 147 hcd, ehci, ehci->transceiver); 148 149 if (ehci->transceiver) { 150 retval = otg_set_host(ehci->transceiver, 151 &ehci_to_hcd(ehci)->self); 152 if (retval) { 153 if (ehci->transceiver) --- 80 unchanged lines hidden (view full) --- 234 portsc |= PORT_PTS_UTMI; 235 break; 236 case FSL_USB2_PHY_NONE: 237 break; 238 } 239 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); 240} 241 | 146 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", 147 hcd, ehci, ehci->transceiver); 148 149 if (ehci->transceiver) { 150 retval = otg_set_host(ehci->transceiver, 151 &ehci_to_hcd(ehci)->self); 152 if (retval) { 153 if (ehci->transceiver) --- 80 unchanged lines hidden (view full) --- 234 portsc |= PORT_PTS_UTMI; 235 break; 236 case FSL_USB2_PHY_NONE: 237 break; 238 } 239 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); 240} 241 |
242static int ehci_fsl_usb_setup(struct ehci_hcd *ehci) | 242static void ehci_fsl_usb_setup(struct ehci_hcd *ehci) |
243{ 244 struct usb_hcd *hcd = ehci_to_hcd(ehci); 245 struct fsl_usb2_platform_data *pdata; 246 void __iomem *non_ehci = hcd->regs; 247 u32 temp; 248 249 pdata = hcd->self.controller->platform_data; 250 --- 43 unchanged lines hidden (view full) --- 294 out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008); 295 out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080); 296#else 297 out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x0000000c); 298 out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000040); 299#endif 300 out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001); 301 } | 243{ 244 struct usb_hcd *hcd = ehci_to_hcd(ehci); 245 struct fsl_usb2_platform_data *pdata; 246 void __iomem *non_ehci = hcd->regs; 247 u32 temp; 248 249 pdata = hcd->self.controller->platform_data; 250 --- 43 unchanged lines hidden (view full) --- 294 out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008); 295 out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080); 296#else 297 out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x0000000c); 298 out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000040); 299#endif 300 out_be32(non_ehci + FSL_SOC_USB_SICTRL, 0x00000001); 301 } |
302 303 if (!(in_be32(non_ehci + FSL_SOC_USB_CTRL) & CTRL_PHY_CLK_VALID)) { 304 printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n"); 305 return -ENODEV; 306 } 307 return 0; | |
308} 309 310/* called after powerup, by probe or system-pm "wakeup" */ 311static int ehci_fsl_reinit(struct ehci_hcd *ehci) 312{ | 302} 303 304/* called after powerup, by probe or system-pm "wakeup" */ 305static int ehci_fsl_reinit(struct ehci_hcd *ehci) 306{ |
313 if (ehci_fsl_usb_setup(ehci)) 314 return -ENODEV; | 307 ehci_fsl_usb_setup(ehci); |
315 ehci_port_power(ehci, 0); 316 317 return 0; 318} 319 320/* called during probe() after chip reset completes */ 321static int ehci_fsl_setup(struct usb_hcd *hcd) 322{ --- 371 unchanged lines hidden --- | 308 ehci_port_power(ehci, 0); 309 310 return 0; 311} 312 313/* called during probe() after chip reset completes */ 314static int ehci_fsl_setup(struct usb_hcd *hcd) 315{ --- 371 unchanged lines hidden --- |