Lines Matching refs:hcd
50 struct usb_hcd *hcd; in fsl_ehci_drv_probe() local
83 hcd = __usb_create_hcd(&fsl_ehci_hc_driver, pdev->dev.parent, in fsl_ehci_drv_probe()
85 if (!hcd) { in fsl_ehci_drv_probe()
91 hcd->regs = devm_ioremap_resource(&pdev->dev, res); in fsl_ehci_drv_probe()
92 if (IS_ERR(hcd->regs)) { in fsl_ehci_drv_probe()
93 retval = PTR_ERR(hcd->regs); in fsl_ehci_drv_probe()
97 hcd->rsrc_start = res->start; in fsl_ehci_drv_probe()
98 hcd->rsrc_len = resource_size(res); in fsl_ehci_drv_probe()
100 pdata->regs = hcd->regs; in fsl_ehci_drv_probe()
103 hcd->power_budget = pdata->power_budget; in fsl_ehci_drv_probe()
115 tmp = ioread32be(hcd->regs + FSL_SOC_USB_CTRL); in fsl_ehci_drv_probe()
118 iowrite32be(tmp, hcd->regs + FSL_SOC_USB_CTRL); in fsl_ehci_drv_probe()
124 iowrite32be(USB_CTRL_USB_EN, hcd->regs + FSL_SOC_USB_CTRL); in fsl_ehci_drv_probe()
131 tmp = ioread32be(hcd->regs + FSL_SOC_USB_CTRL); in fsl_ehci_drv_probe()
134 iowrite32be(tmp, hcd->regs + FSL_SOC_USB_CTRL); in fsl_ehci_drv_probe()
136 writel(PORT_PTS_UTMI, hcd->regs + FSL_SOC_USB_PORTSC1); in fsl_ehci_drv_probe()
141 retval = usb_add_hcd(hcd, irq, IRQF_SHARED); in fsl_ehci_drv_probe()
144 device_wakeup_enable(hcd->self.controller); in fsl_ehci_drv_probe()
148 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in fsl_ehci_drv_probe()
150 hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2); in fsl_ehci_drv_probe()
152 hcd, ehci, hcd->usb_phy); in fsl_ehci_drv_probe()
154 if (!IS_ERR_OR_NULL(hcd->usb_phy)) { in fsl_ehci_drv_probe()
155 retval = otg_set_host(hcd->usb_phy->otg, in fsl_ehci_drv_probe()
158 usb_put_phy(hcd->usb_phy); in fsl_ehci_drv_probe()
167 hcd->skip_phy_initialization = 1; in fsl_ehci_drv_probe()
173 usb_put_hcd(hcd); in fsl_ehci_drv_probe()
181 static bool usb_phy_clk_valid(struct usb_hcd *hcd) in usb_phy_clk_valid() argument
183 void __iomem *non_ehci = hcd->regs; in usb_phy_clk_valid()
192 static int ehci_fsl_setup_phy(struct usb_hcd *hcd, in ehci_fsl_setup_phy() argument
197 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in ehci_fsl_setup_phy()
198 void __iomem *non_ehci = hcd->regs; in ehci_fsl_setup_phy()
199 struct device *dev = hcd->self.controller; in ehci_fsl_setup_phy()
203 dev_warn(hcd->self.controller, "Could not get controller version\n"); in ehci_fsl_setup_phy()
249 pdata->have_sysif_regs && !usb_phy_clk_valid(hcd)) { in ehci_fsl_setup_phy()
279 !usb_phy_clk_valid(hcd)) { in ehci_fsl_setup_phy()
280 dev_warn(hcd->self.controller, "USB PHY clock invalid\n"); in ehci_fsl_setup_phy()
298 struct usb_hcd *hcd = ehci_to_hcd(ehci); in ehci_fsl_usb_setup() local
300 void __iomem *non_ehci = hcd->regs; in ehci_fsl_usb_setup()
302 pdata = dev_get_platdata(hcd->self.controller); in ehci_fsl_usb_setup()
328 if (ehci_fsl_setup_phy(hcd, pdata->phy_mode, 0)) in ehci_fsl_usb_setup()
338 if (ehci_fsl_setup_phy(hcd, pdata->phy_mode, 0)) in ehci_fsl_usb_setup()
342 if (ehci_fsl_setup_phy(hcd, pdata->phy_mode, 1)) in ehci_fsl_usb_setup()
370 static int ehci_fsl_setup(struct usb_hcd *hcd) in ehci_fsl_setup() argument
372 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in ehci_fsl_setup()
377 dev = hcd->self.controller; in ehci_fsl_setup()
378 pdata = dev_get_platdata(hcd->self.controller); in ehci_fsl_setup()
383 ehci->caps = hcd->regs + 0x100; in ehci_fsl_setup()
394 hcd->has_tt = 1; in ehci_fsl_setup()
396 retval = ehci_setup(hcd); in ehci_fsl_setup()
407 hcd->regs + FSL_SOC_USB_SBUSCFG); in ehci_fsl_setup()
428 struct usb_hcd *hcd = dev_get_drvdata(dev); in ehci_fsl_mpc512x_drv_suspend() local
429 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in ehci_fsl_mpc512x_drv_suspend()
434 u32 mode = ehci_readl(ehci, hcd->regs + FSL_SOC_USB_USBMODE); in ehci_fsl_mpc512x_drv_suspend()
436 tmp = ehci_readl(ehci, hcd->regs + 0x140); /* usbcmd */ in ehci_fsl_mpc512x_drv_suspend()
460 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in ehci_fsl_mpc512x_drv_suspend()
480 hcd->regs + FSL_SOC_USB_USBGENCTRL); in ehci_fsl_mpc512x_drv_suspend()
497 struct usb_hcd *hcd = dev_get_drvdata(dev); in ehci_fsl_mpc512x_drv_resume() local
498 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in ehci_fsl_mpc512x_drv_resume()
526 ehci_writel(ehci, tmp, hcd->regs + FSL_SOC_USB_USBMODE); in ehci_fsl_mpc512x_drv_resume()
529 hcd->regs + FSL_SOC_USB_USBGENCTRL); in ehci_fsl_mpc512x_drv_resume()
531 hcd->regs + FSL_SOC_USB_ISIPHYCTRL); in ehci_fsl_mpc512x_drv_resume()
533 ehci_writel(ehci, SBUSCFG_INCR8, hcd->regs + FSL_SOC_USB_SBUSCFG); in ehci_fsl_mpc512x_drv_resume()
546 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); in ehci_fsl_mpc512x_drv_resume()
554 usb_hcd_resume_root_hub(hcd); in ehci_fsl_mpc512x_drv_resume()
570 static struct ehci_fsl *hcd_to_ehci_fsl(struct usb_hcd *hcd) in hcd_to_ehci_fsl() argument
572 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in hcd_to_ehci_fsl()
579 struct usb_hcd *hcd = dev_get_drvdata(dev); in ehci_fsl_drv_suspend() local
580 struct ehci_fsl *ehci_fsl = hcd_to_ehci_fsl(hcd); in ehci_fsl_drv_suspend()
581 void __iomem *non_ehci = hcd->regs; in ehci_fsl_drv_suspend()
588 ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd), in ehci_fsl_drv_suspend()
599 struct usb_hcd *hcd = dev_get_drvdata(dev); in ehci_fsl_drv_resume() local
600 struct ehci_fsl *ehci_fsl = hcd_to_ehci_fsl(hcd); in ehci_fsl_drv_resume()
601 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in ehci_fsl_drv_resume()
602 void __iomem *non_ehci = hcd->regs; in ehci_fsl_drv_resume()
613 usb_root_hub_lost_power(hcd->self.root_hub); in ehci_fsl_drv_resume()
626 struct usb_hcd *hcd = dev_get_drvdata(dev); in ehci_fsl_drv_restore() local
628 usb_root_hub_lost_power(hcd->self.root_hub); in ehci_fsl_drv_restore()
644 static int ehci_start_port_reset(struct usb_hcd *hcd, unsigned port) in ehci_start_port_reset() argument
646 struct ehci_hcd *ehci = hcd_to_ehci(hcd); in ehci_start_port_reset()
690 struct usb_hcd *hcd = platform_get_drvdata(pdev); in fsl_ehci_drv_remove() local
692 if (!IS_ERR_OR_NULL(hcd->usb_phy)) { in fsl_ehci_drv_remove()
693 otg_set_host(hcd->usb_phy->otg, NULL); in fsl_ehci_drv_remove()
694 usb_put_phy(hcd->usb_phy); in fsl_ehci_drv_remove()
697 usb_remove_hcd(hcd); in fsl_ehci_drv_remove()
705 usb_put_hcd(hcd); in fsl_ehci_drv_remove()