diff options
author | Roger Quadros <rogerq@ti.com> | 2014-02-27 09:18:23 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-03-13 18:23:51 -0400 |
commit | 3aca446acf32243029f5c83810b50aad3c32b6bf (patch) | |
tree | f9ad108f999d0466efe17fc3c347565cdb8a3586 | |
parent | 61b7025f6d6cebc9a8ebbe020c4de5a76a536c90 (diff) |
mfd: omap-usb-host: Get clocks based on hardware revision
Not all revisions have all the clocks so get the necessary clocks
based on hardware revision.
This should avoid un-necessary clk_get failure messages that were
observed earlier.
Also remove the dummy USB host clocks from the OMAP3 clock data.
These are no longer expected by the driver.
Acked-by: Mike Turquette <mturquette@linaro.org> [OMAP3 CLK data]
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | arch/arm/mach-omap2/cclock3xxx_data.c | 4 | ||||
-rw-r--r-- | drivers/clk/ti/clk-3xxx.c | 4 | ||||
-rw-r--r-- | drivers/mfd/omap-usb-host.c | 43 |
3 files changed, 32 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index 3b05aea56d1f..4299a559ebca 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c | |||
@@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3495 | CLK(NULL, "dss_tv_fck", &dss_tv_fck), | 3495 | CLK(NULL, "dss_tv_fck", &dss_tv_fck), |
3496 | CLK(NULL, "dss_96m_fck", &dss_96m_fck), | 3496 | CLK(NULL, "dss_96m_fck", &dss_96m_fck), |
3497 | CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck), | 3497 | CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck), |
3498 | CLK(NULL, "utmi_p1_gfclk", &dummy_ck), | ||
3499 | CLK(NULL, "utmi_p2_gfclk", &dummy_ck), | ||
3500 | CLK(NULL, "xclk60mhsp1_ck", &dummy_ck), | ||
3501 | CLK(NULL, "xclk60mhsp2_ck", &dummy_ck), | ||
3502 | CLK(NULL, "init_60m_fclk", &dummy_ck), | 3498 | CLK(NULL, "init_60m_fclk", &dummy_ck), |
3503 | CLK(NULL, "gpt1_fck", &gpt1_fck), | 3499 | CLK(NULL, "gpt1_fck", &gpt1_fck), |
3504 | CLK(NULL, "aes2_ick", &aes2_ick), | 3500 | CLK(NULL, "aes2_ick", &aes2_ick), |
diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c index d3230234f07b..0d1750a8aea4 100644 --- a/drivers/clk/ti/clk-3xxx.c +++ b/drivers/clk/ti/clk-3xxx.c | |||
@@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = { | |||
130 | DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"), | 130 | DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"), |
131 | DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"), | 131 | DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"), |
132 | DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"), | 132 | DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"), |
133 | DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"), | ||
134 | DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"), | ||
135 | DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"), | ||
136 | DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"), | ||
137 | DT_CLK(NULL, "init_60m_fclk", "dummy_ck"), | 133 | DT_CLK(NULL, "init_60m_fclk", "dummy_ck"), |
138 | DT_CLK(NULL, "gpt1_fck", "gpt1_fck"), | 134 | DT_CLK(NULL, "gpt1_fck", "gpt1_fck"), |
139 | DT_CLK(NULL, "aes2_ick", "aes2_ick"), | 135 | DT_CLK(NULL, "aes2_ick", "aes2_ick"), |
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 | ||
799 | initialize: | ||
779 | omap_usbhs_init(dev); | 800 | omap_usbhs_init(dev); |
780 | 801 | ||
781 | if (dev->of_node) { | 802 | if (dev->of_node) { |