Lines Matching refs:omap
280 struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); in usbhs_runtime_resume() local
281 struct usbhs_omap_platform_data *pdata = omap->pdata; in usbhs_runtime_resume()
288 if (!IS_ERR(omap->ehci_logic_fck)) in usbhs_runtime_resume()
289 clk_prepare_enable(omap->ehci_logic_fck); in usbhs_runtime_resume()
291 for (i = 0; i < omap->nports; i++) { in usbhs_runtime_resume()
294 if (!IS_ERR(omap->hsic60m_clk[i])) { in usbhs_runtime_resume()
295 r = clk_prepare_enable(omap->hsic60m_clk[i]); in usbhs_runtime_resume()
303 if (!IS_ERR(omap->hsic480m_clk[i])) { in usbhs_runtime_resume()
304 r = clk_prepare_enable(omap->hsic480m_clk[i]); in usbhs_runtime_resume()
314 if (!IS_ERR(omap->utmi_clk[i])) { in usbhs_runtime_resume()
315 r = clk_prepare_enable(omap->utmi_clk[i]); in usbhs_runtime_resume()
333 struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); in usbhs_runtime_suspend() local
334 struct usbhs_omap_platform_data *pdata = omap->pdata; in usbhs_runtime_suspend()
339 for (i = 0; i < omap->nports; i++) { in usbhs_runtime_suspend()
342 if (!IS_ERR(omap->hsic60m_clk[i])) in usbhs_runtime_suspend()
343 clk_disable_unprepare(omap->hsic60m_clk[i]); in usbhs_runtime_suspend()
345 if (!IS_ERR(omap->hsic480m_clk[i])) in usbhs_runtime_suspend()
346 clk_disable_unprepare(omap->hsic480m_clk[i]); in usbhs_runtime_suspend()
350 if (!IS_ERR(omap->utmi_clk[i])) in usbhs_runtime_suspend()
351 clk_disable_unprepare(omap->utmi_clk[i]); in usbhs_runtime_suspend()
358 if (!IS_ERR(omap->ehci_logic_fck)) in usbhs_runtime_suspend()
359 clk_disable_unprepare(omap->ehci_logic_fck); in usbhs_runtime_suspend()
366 static unsigned omap_usbhs_rev1_hostconfig(struct usbhs_hcd_omap *omap, in omap_usbhs_rev1_hostconfig() argument
369 struct usbhs_omap_platform_data *pdata = omap->pdata; in omap_usbhs_rev1_hostconfig()
372 for (i = 0; i < omap->nports; i++) { in omap_usbhs_rev1_hostconfig()
404 for (i = 0; i < omap->nports; i++) { in omap_usbhs_rev1_hostconfig()
415 static unsigned omap_usbhs_rev2_hostconfig(struct usbhs_hcd_omap *omap, in omap_usbhs_rev2_hostconfig() argument
418 struct usbhs_omap_platform_data *pdata = omap->pdata; in omap_usbhs_rev2_hostconfig()
421 for (i = 0; i < omap->nports; i++) { in omap_usbhs_rev2_hostconfig()
437 struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); in omap_usbhs_init() local
444 reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG); in omap_usbhs_init()
452 switch (omap->usbhs_rev) { in omap_usbhs_init()
454 reg = omap_usbhs_rev1_hostconfig(omap, reg); in omap_usbhs_init()
458 reg = omap_usbhs_rev2_hostconfig(omap, reg); in omap_usbhs_init()
462 reg = omap_usbhs_rev2_hostconfig(omap, reg); in omap_usbhs_init()
466 usbhs_write(omap->uhh_base, OMAP_UHH_HOSTCONFIG, reg); in omap_usbhs_init()
536 struct usbhs_hcd_omap *omap; in usbhs_omap_probe() local
566 omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL); in usbhs_omap_probe()
567 if (!omap) { in usbhs_omap_probe()
573 omap->uhh_base = devm_ioremap_resource(dev, res); in usbhs_omap_probe()
574 if (IS_ERR(omap->uhh_base)) in usbhs_omap_probe()
575 return PTR_ERR(omap->uhh_base); in usbhs_omap_probe()
577 omap->pdata = pdata; in usbhs_omap_probe()
584 platform_set_drvdata(pdev, omap); in usbhs_omap_probe()
587 omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); in usbhs_omap_probe()
599 omap->nports = pdata->nports; in usbhs_omap_probe()
601 switch (omap->usbhs_rev) { in usbhs_omap_probe()
603 omap->nports = 3; in usbhs_omap_probe()
606 omap->nports = 2; in usbhs_omap_probe()
609 omap->nports = OMAP3_HS_USB_PORTS; in usbhs_omap_probe()
612 omap->usbhs_rev, omap->nports); in usbhs_omap_probe()
615 pdata->nports = omap->nports; in usbhs_omap_probe()
618 i = sizeof(struct clk *) * omap->nports; in usbhs_omap_probe()
619 omap->utmi_clk = devm_kzalloc(dev, i, GFP_KERNEL); in usbhs_omap_probe()
620 omap->hsic480m_clk = devm_kzalloc(dev, i, GFP_KERNEL); in usbhs_omap_probe()
621 omap->hsic60m_clk = devm_kzalloc(dev, i, GFP_KERNEL); in usbhs_omap_probe()
623 if (!omap->utmi_clk || !omap->hsic480m_clk || !omap->hsic60m_clk) { in usbhs_omap_probe()
630 omap->ehci_logic_fck = ERR_PTR(-ENODEV); in usbhs_omap_probe()
631 omap->init_60m_fclk = ERR_PTR(-ENODEV); in usbhs_omap_probe()
632 omap->utmi_p1_gfclk = ERR_PTR(-ENODEV); in usbhs_omap_probe()
633 omap->utmi_p2_gfclk = ERR_PTR(-ENODEV); in usbhs_omap_probe()
634 omap->xclk60mhsp1_ck = ERR_PTR(-ENODEV); in usbhs_omap_probe()
635 omap->xclk60mhsp2_ck = ERR_PTR(-ENODEV); in usbhs_omap_probe()
637 for (i = 0; i < omap->nports; i++) { in usbhs_omap_probe()
638 omap->utmi_clk[i] = ERR_PTR(-ENODEV); in usbhs_omap_probe()
639 omap->hsic480m_clk[i] = ERR_PTR(-ENODEV); in usbhs_omap_probe()
640 omap->hsic60m_clk[i] = ERR_PTR(-ENODEV); in usbhs_omap_probe()
644 if (omap->usbhs_rev == OMAP_USBHS_REV1) { in usbhs_omap_probe()
646 for (i = 0; i < omap->nports; i++) { in usbhs_omap_probe()
655 omap->ehci_logic_fck = devm_clk_get(dev, in usbhs_omap_probe()
657 if (IS_ERR(omap->ehci_logic_fck)) { in usbhs_omap_probe()
658 ret = PTR_ERR(omap->ehci_logic_fck); in usbhs_omap_probe()
668 omap->utmi_p1_gfclk = devm_clk_get(dev, "utmi_p1_gfclk"); in usbhs_omap_probe()
669 if (IS_ERR(omap->utmi_p1_gfclk)) { in usbhs_omap_probe()
670 ret = PTR_ERR(omap->utmi_p1_gfclk); in usbhs_omap_probe()
675 omap->utmi_p2_gfclk = devm_clk_get(dev, "utmi_p2_gfclk"); in usbhs_omap_probe()
676 if (IS_ERR(omap->utmi_p2_gfclk)) { in usbhs_omap_probe()
677 ret = PTR_ERR(omap->utmi_p2_gfclk); in usbhs_omap_probe()
682 omap->xclk60mhsp1_ck = devm_clk_get(dev, "refclk_60m_ext_p1"); in usbhs_omap_probe()
683 if (IS_ERR(omap->xclk60mhsp1_ck)) { in usbhs_omap_probe()
684 ret = PTR_ERR(omap->xclk60mhsp1_ck); in usbhs_omap_probe()
689 omap->xclk60mhsp2_ck = devm_clk_get(dev, "refclk_60m_ext_p2"); in usbhs_omap_probe()
690 if (IS_ERR(omap->xclk60mhsp2_ck)) { in usbhs_omap_probe()
691 ret = PTR_ERR(omap->xclk60mhsp2_ck); in usbhs_omap_probe()
696 omap->init_60m_fclk = devm_clk_get(dev, "refclk_60m_int"); in usbhs_omap_probe()
697 if (IS_ERR(omap->init_60m_fclk)) { in usbhs_omap_probe()
698 ret = PTR_ERR(omap->init_60m_fclk); in usbhs_omap_probe()
703 for (i = 0; i < omap->nports; i++) { in usbhs_omap_probe()
714 omap->utmi_clk[i] = devm_clk_get(dev, clkname); in usbhs_omap_probe()
715 if (IS_ERR(omap->utmi_clk[i])) { in usbhs_omap_probe()
716 ret = PTR_ERR(omap->utmi_clk[i]); in usbhs_omap_probe()
724 omap->hsic480m_clk[i] = devm_clk_get(dev, clkname); in usbhs_omap_probe()
725 if (IS_ERR(omap->hsic480m_clk[i])) { in usbhs_omap_probe()
726 ret = PTR_ERR(omap->hsic480m_clk[i]); in usbhs_omap_probe()
734 omap->hsic60m_clk[i] = devm_clk_get(dev, clkname); in usbhs_omap_probe()
735 if (IS_ERR(omap->hsic60m_clk[i])) { in usbhs_omap_probe()
736 ret = PTR_ERR(omap->hsic60m_clk[i]); in usbhs_omap_probe()
744 ret = clk_set_parent(omap->utmi_p1_gfclk, in usbhs_omap_probe()
745 omap->xclk60mhsp1_ck); in usbhs_omap_probe()
752 ret = clk_set_parent(omap->utmi_p1_gfclk, in usbhs_omap_probe()
753 omap->init_60m_fclk); in usbhs_omap_probe()
762 ret = clk_set_parent(omap->utmi_p2_gfclk, in usbhs_omap_probe()
763 omap->xclk60mhsp2_ck); in usbhs_omap_probe()
770 ret = clk_set_parent(omap->utmi_p2_gfclk, in usbhs_omap_probe()
771 omap->init_60m_fclk); in usbhs_omap_probe()