From patchwork Tue Nov 5 16:13:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Debski X-Patchwork-Id: 3142491 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A74739F432 for ; Tue, 5 Nov 2013 16:15:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F84E20575 for ; Tue, 5 Nov 2013 16:15:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B101A2037F for ; Tue, 5 Nov 2013 16:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753741Ab3KEQPl (ORCPT ); Tue, 5 Nov 2013 11:15:41 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:36794 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838Ab3KEQPk (ORCPT ); Tue, 5 Nov 2013 11:15:40 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MVS0038DT63JNP0@mailout3.samsung.com>; Wed, 06 Nov 2013 01:15:39 +0900 (KST) Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 55.21.09687.AA919725; Wed, 06 Nov 2013 01:15:39 +0900 (KST) Received: from amdc1342.digital.local ([106.116.147.39]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MVS0025VT2DD430@mmp1.samsung.com>; Wed, 06 Nov 2013 01:15:38 +0900 (KST) Date: Tue, 05 Nov 2013 17:13:20 +0100 From: Kamil Debski Subject: [PATCH v3 2/3] usb: ehci-s5p: Change to use phy provided by the generic phy framework In-reply-to: <1383668001-19141-1-git-send-email-k.debski@samsung.com> To: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm@vger.kernel.org Cc: kyungmin.park@samsung.com, kishon@ti.com, t.figa@samsung.com, s.nawrocki@samsung.com, m.szyprowski@samsung.com, gautam.vivek@samsung.com, mat.krawczuk@gmail.com, yulgon.kim@samsung.com, p.paneri@samsung.com, av.tikhomirov@samsung.com, jg1.han@samsung.com, galak@codeaurora.org, Kamil Debski Message-id: <1383668001-19141-3-git-send-email-k.debski@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-AuditID: cbfee61a-b7f836d0000025d7-d5-527919aabe15 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsVy+t9jAd3VkpVBBmcOs1gs2X2D1WL+kXOs Fv1vFrJatF05yG5xeeElVosfry+wWVx42sNmcbbpDbvFtJ3/WS0u75rDZjHj/D4mi0XLWpkt 1h65y25xtv82m8X5LZ1MFofftLNarJ/xmsWi4+xBdgchj8t9vUweO2fdZffo27KK0eP4je1M Hp83yQWwRnHZpKTmZJalFunbJXBlvL+9nq1gsUzFjgd8DYwXxbsYOTkkBEwkrrY/Z4SwxSQu 3FvP1sXIxSEksIhR4tnnL0wQTgeTxNbJT4EcDg42AU2JVfc8QBpEBGYySmxebApSwyxwlEmi 9ekWsEnCAgkSM6YeYgOxWQRUJZo/XQWL8wq4SFzavJgFZI6EgILEnEk2IGFOAVeJ9/PWM4PY QkAlJ5Z8Z57AyLuAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRnAAP5PawbiyweIQowAH oxIP74Oz5UFCrIllxZW5hxglOJiVRHiP/a8IEuJNSaysSi3Kjy8qzUktPsQozcGiJM57oNU6 UEggPbEkNTs1tSC1CCbLxMEp1cDovmmhrn7d/iWWcyS0ZnqXzp6+yP/G9zenZT/c3hjm9iAj fdERxZUGVXd2R1w8ctTxvOrFxmpnMUnWfRwHupyeOU9Ovpwnrt2utNTk1+9cuaP6Nk4n339I DTbOzLQsYMv/kKy1psD5YcVmttOKzy7uWPlKcEn3wVTbtVXbLM8eZFM8vnjT0dP5SizFGYmG WsxFxYkASqhyl1wCAAA= References: <1383668001-19141-1-git-send-email-k.debski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change the phy provider used from the old usb phy specific to a new one using the generic phy framework. Signed-off-by: Kamil Debski Signed-off-by: Kyungmin Park --- drivers/usb/host/ehci-exynos.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 8898c01..974001b 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -19,12 +19,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include "ehci.h" @@ -44,8 +44,7 @@ static struct hc_driver __read_mostly exynos_ehci_hc_driver; struct exynos_ehci_hcd { struct clk *clk; - struct usb_phy *phy; - struct usb_otg *otg; + struct phy *phy; }; #define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)->priv) @@ -75,7 +74,8 @@ static int exynos_ehci_probe(struct platform_device *pdev) struct usb_hcd *hcd; struct ehci_hcd *ehci; struct resource *res; - struct usb_phy *phy; + struct phy *phy; + const char *phy_name; int irq; int err; @@ -98,12 +98,12 @@ static int exynos_ehci_probe(struct platform_device *pdev) return -ENOMEM; } exynos_ehci = to_exynos_ehci(hcd); - if (of_device_is_compatible(pdev->dev.of_node, "samsung,exynos5440-ehci")) goto skip_phy; - phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); + phy_name = of_get_property(pdev->dev.of_node, "phy-names", NULL); + phy = devm_phy_get(&pdev->dev, phy_name); if (IS_ERR(phy)) { usb_put_hcd(hcd); dev_warn(&pdev->dev, "no platform data or transceiver defined\n"); @@ -149,11 +149,8 @@ skip_phy: goto fail_io; } - if (exynos_ehci->otg) - exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self); - if (exynos_ehci->phy) - usb_phy_init(exynos_ehci->phy); + phy_power_on(exynos_ehci->phy); ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; @@ -173,7 +170,7 @@ skip_phy: fail_add_hcd: if (exynos_ehci->phy) - usb_phy_shutdown(exynos_ehci->phy); + phy_power_off(exynos_ehci->phy); fail_io: clk_disable_unprepare(exynos_ehci->clk); fail_clk: @@ -188,11 +185,8 @@ static int exynos_ehci_remove(struct platform_device *pdev) usb_remove_hcd(hcd); - if (exynos_ehci->otg) - exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self); - if (exynos_ehci->phy) - usb_phy_shutdown(exynos_ehci->phy); + phy_power_off(exynos_ehci->phy); clk_disable_unprepare(exynos_ehci->clk); @@ -212,11 +206,8 @@ static int exynos_ehci_suspend(struct device *dev) rc = ehci_suspend(hcd, do_wakeup); - if (exynos_ehci->otg) - exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self); - if (exynos_ehci->phy) - usb_phy_shutdown(exynos_ehci->phy); + phy_power_off(exynos_ehci->phy); clk_disable_unprepare(exynos_ehci->clk); @@ -230,11 +221,8 @@ static int exynos_ehci_resume(struct device *dev) clk_prepare_enable(exynos_ehci->clk); - if (exynos_ehci->otg) - exynos_ehci->otg->set_host(exynos_ehci->otg, &hcd->self); - if (exynos_ehci->phy) - usb_phy_init(exynos_ehci->phy); + phy_power_on(exynos_ehci->phy); /* DMA burst Enable */ writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));