From: Thomas Abraham <thomas...@samsung.com>

Exynos5440 does not require any explict USB phy configuration. So skip
the USB phy configuration for Exynos5440 based platforms.

Signed-off-by: Thomas Abraham <thomas...@samsung.com>
Signed-off-by: Jingoo Han <jg1....@samsung.com>
---
Changes since v2:
- changed all occurrences of s5p_ehci->pdata->phy*.
- set s5p_ehci->pdata to NULL.

Changes since v1:
- re-based on the latest 'linux-next' tree

 drivers/usb/host/ehci-s5p.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 379037f..32ba4d5 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -101,6 +101,13 @@ static int s5p_ehci_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
        s5p_ehci = to_s5p_ehci(hcd);
+
+       if (of_device_is_compatible(pdev->dev.of_node,
+                                       "samsung,exynos5440-ehci")) {
+               s5p_ehci->pdata = NULL;
+               goto skip_phy;
+       }
+
        phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
        if (IS_ERR(phy)) {
                /* Fallback to pdata */
@@ -116,6 +123,8 @@ static int s5p_ehci_probe(struct platform_device *pdev)
                s5p_ehci->otg = phy->otg;
        }
 
+skip_phy:
+
        s5p_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
 
        if (IS_ERR(s5p_ehci->clk)) {
@@ -156,7 +165,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
 
        if (s5p_ehci->phy)
                usb_phy_init(s5p_ehci->phy);
-       else if (s5p_ehci->pdata->phy_init)
+       else if (s5p_ehci->pdata && s5p_ehci->pdata->phy_init)
                s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
 
        ehci = hcd_to_ehci(hcd);
@@ -178,7 +187,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
 fail_add_hcd:
        if (s5p_ehci->phy)
                usb_phy_shutdown(s5p_ehci->phy);
-       else if (s5p_ehci->pdata->phy_exit)
+       else if (s5p_ehci->pdata && s5p_ehci->pdata->phy_exit)
                s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 fail_io:
        clk_disable_unprepare(s5p_ehci->clk);
@@ -199,7 +208,7 @@ static int s5p_ehci_remove(struct platform_device *pdev)
 
        if (s5p_ehci->phy)
                usb_phy_shutdown(s5p_ehci->phy);
-       else if (s5p_ehci->pdata->phy_exit)
+       else if (s5p_ehci->pdata && s5p_ehci->pdata->phy_exit)
                s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 
        clk_disable_unprepare(s5p_ehci->clk);
@@ -234,7 +243,7 @@ static int s5p_ehci_suspend(struct device *dev)
 
        if (s5p_ehci->phy)
                usb_phy_shutdown(s5p_ehci->phy);
-       else if (s5p_ehci->pdata->phy_exit)
+       else if (s5p_ehci->pdata && s5p_ehci->pdata->phy_exit)
                s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 
        clk_disable_unprepare(s5p_ehci->clk);
@@ -255,7 +264,7 @@ static int s5p_ehci_resume(struct device *dev)
 
        if (s5p_ehci->phy)
                usb_phy_init(s5p_ehci->phy);
-       else if (s5p_ehci->pdata->phy_init)
+       else if (s5p_ehci->pdata && s5p_ehci->pdata->phy_init)
                s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
 
        /* DMA burst Enable */
@@ -277,6 +286,7 @@ static const struct dev_pm_ops s5p_ehci_pm_ops = {
 #ifdef CONFIG_OF
 static const struct of_device_id exynos_ehci_match[] = {
        { .compatible = "samsung,exynos4210-ehci" },
+       { .compatible = "samsung,exynos5440-ehci" },
        {},
 };
 MODULE_DEVICE_TABLE(of, exynos_ehci_match);
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to