aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/omap-usb-host.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/omap-usb-host.c')
-rw-r--r--drivers/mfd/omap-usb-host.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 0c3c9a0c7638..c63bfdf5a419 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -665,22 +665,43 @@ static int usbhs_omap_probe(struct platform_device *pdev)
665 goto err_mem; 665 goto err_mem;
666 } 666 }
667 667
668 need_logic_fck = false; 668 /* Set all clocks as invalid to begin with */
669 omap->ehci_logic_fck = ERR_PTR(-ENODEV);
670 omap->init_60m_fclk = ERR_PTR(-ENODEV);
671 omap->utmi_p1_gfclk = ERR_PTR(-ENODEV);
672 omap->utmi_p2_gfclk = ERR_PTR(-ENODEV);
673 omap->xclk60mhsp1_ck = ERR_PTR(-ENODEV);
674 omap->xclk60mhsp2_ck = ERR_PTR(-ENODEV);
675
669 for (i = 0; i < omap->nports; i++) { 676 for (i = 0; i < omap->nports; i++) {
670 if (is_ehci_phy_mode(i) || is_ehci_tll_mode(i) || 677 omap->utmi_clk[i] = ERR_PTR(-ENODEV);
671 is_ehci_hsic_mode(i)) 678 omap->hsic480m_clk[i] = ERR_PTR(-ENODEV);
672 need_logic_fck |= true; 679 omap->hsic60m_clk[i] = ERR_PTR(-ENODEV);
673 } 680 }
674 681
675 omap->ehci_logic_fck = ERR_PTR(-EINVAL); 682 /* for OMAP3 i.e. USBHS REV1 */
676 if (need_logic_fck) { 683 if (omap->usbhs_rev == OMAP_USBHS_REV1) {
677 omap->ehci_logic_fck = devm_clk_get(dev, "ehci_logic_fck"); 684 need_logic_fck = false;
678 if (IS_ERR(omap->ehci_logic_fck)) { 685 for (i = 0; i < omap->nports; i++) {
679 ret = PTR_ERR(omap->ehci_logic_fck); 686 if (is_ehci_phy_mode(pdata->port_mode[i]) ||
680 dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret); 687 is_ehci_tll_mode(pdata->port_mode[i]) ||
688 is_ehci_hsic_mode(pdata->port_mode[i]))
689
690 need_logic_fck |= true;
691 }
692
693 if (need_logic_fck) {
694 omap->ehci_logic_fck = devm_clk_get(dev,
695 "ehci_logic_fck");
696 if (IS_ERR(omap->ehci_logic_fck)) {
697 ret = PTR_ERR(omap->ehci_logic_fck);
698 dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret);
699 }
681 } 700 }
701 goto initialize;
682 } 702 }
683 703
704 /* for OMAP4+ i.e. USBHS REV2+ */
684 omap->utmi_p1_gfclk = devm_clk_get(dev, "utmi_p1_gfclk"); 705 omap->utmi_p1_gfclk = devm_clk_get(dev, "utmi_p1_gfclk");
685 if (IS_ERR(omap->utmi_p1_gfclk)) { 706 if (IS_ERR(omap->utmi_p1_gfclk)) {
686 ret = PTR_ERR(omap->utmi_p1_gfclk); 707 ret = PTR_ERR(omap->utmi_p1_gfclk);
@@ -748,7 +769,6 @@ static int usbhs_omap_probe(struct platform_device *pdev)
748 } 769 }
749 770
750 if (is_ehci_phy_mode(pdata->port_mode[0])) { 771 if (is_ehci_phy_mode(pdata->port_mode[0])) {
751 /* for OMAP3, clk_set_parent fails */
752 ret = clk_set_parent(omap->utmi_p1_gfclk, 772 ret = clk_set_parent(omap->utmi_p1_gfclk,
753 omap->xclk60mhsp1_ck); 773 omap->xclk60mhsp1_ck);
754 if (ret != 0) 774 if (ret != 0)
@@ -776,6 +796,7 @@ static int usbhs_omap_probe(struct platform_device *pdev)
776 ret); 796 ret);
777 } 797 }
778 798
799initialize:
779 omap_usbhs_init(dev); 800 omap_usbhs_init(dev);
780 801
781 if (dev->of_node) { 802 if (dev->of_node) {