From patchwork Wed Nov 6 01:27:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 3144601 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1BC0BEEB2 for ; Wed, 6 Nov 2013 01:27:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9F38205C1 for ; Wed, 6 Nov 2013 01:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1231B205BB for ; Wed, 6 Nov 2013 01:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755962Ab3KFB1y (ORCPT ); Tue, 5 Nov 2013 20:27:54 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:60093 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755763Ab3KFB1w (ORCPT ); Tue, 5 Nov 2013 20:27:52 -0500 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MVT002X9IQ18D90@mailout2.samsung.com>; Wed, 06 Nov 2013 10:27:50 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.49]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id FA.90.07242.61B99725; Wed, 06 Nov 2013 10:27:50 +0900 (KST) Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 19.9C.09687.51B99725; Wed, 06 Nov 2013 10:27:50 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MVT0039EIQD9570@mmp2.samsung.com>; Wed, 06 Nov 2013 10:27:49 +0900 (KST) Date: Wed, 06 Nov 2013 10:27:49 +0900 Sun-Java-System-SMTP-Warning: Lines longer than SMTP allows found and wrapped. From: Jingoo Han Subject: [PATCH] usb: ohci-exynos: Change to use phy provided by the generic phy framework 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: 'Kamil Debski' , 'Kyungmin Park' , 'Kishon Vijay Abraham I' , 'Tomasz Figa' , 'Sylwester Nawrocki' , m.szyprowski@samsung.com, gautam.vivek@samsung.com, 'Mateusz Krawczuk' , 'Yulgon Kim' , 'Praveen Paneri' , 'Anton Tikhomirov' , 'Kumar Gala' , 'Kamil Debski' , 'Jingoo Han' Message-id: <001401ceda8f$67f1ee50$37d5caf0$%han@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: ko Content-transfer-encoding: 7bit Thread-index: Ac7aj1XjuAwmVu70RKaqqxDTG9Gb3A== DLP-Filter: Pass X-AuditID: cbfee690-b7f3d6d000001c4a-2b-52799b16ba7e x-cr-hashedpuzzle: AOYY FEf+ M7u+ XK2A 5PeZ 5tuX 77Gn AEG1og== AGwc7g== AQkEWA== AU3PHA== AYiAGA== Aajlvw== AgGKow== AhMAOA== Aiiw4A==; 18; YQB2AC4AdABpAGsAaABvAG0AaQByAG8AdgBAAHMAYQBtAHMAdQBuAGcALgBjAG8AbQA7AGQAZQB2AGkAYwBlAHQAcgBlAGUAQAB2AGcAZQByAC4AawBlAHIAbgBlAGwALgBvAHIAZwA7AGcAYQBsAGEAawBAAGMAbwBkAGUAYQB1AHIAbwByAGEALgBvAHIAZwA7AGcAYQB1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fPLpP3ny289c0/FBz3K7PJJy9fNYmlax4tZrqCfK/JbZ+3dZj7XjszRLDj4bPDVL3K7EU ZyQaajEXFScCACjEP+eUAwAA X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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: Jingoo Han Cc: Kamil Debski --- Exynos OHCI driver also uses Exynos USB2.0 PHY. Thus, I make this patch based-on Kamil Debski's patchset for adding Exynos USB 2.0 PHY driver. (http://www.spinics.net/lists/linux-samsung-soc/msg24104.html) drivers/usb/host/ohci-exynos.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index a87baed..76eb4d3 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -17,12 +17,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include "ohci.h" @@ -35,8 +35,7 @@ static struct hc_driver __read_mostly exynos_ohci_hc_driver; struct exynos_ohci_hcd { struct clk *clk; - struct usb_phy *phy; - struct usb_otg *otg; + struct phy *phy; }; static void exynos_ohci_phy_enable(struct platform_device *pdev) @@ -45,7 +44,7 @@ static void exynos_ohci_phy_enable(struct platform_device *pdev) struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); if (exynos_ohci->phy) - usb_phy_init(exynos_ohci->phy); + phy_power_on(exynos_ohci->phy); } static void exynos_ohci_phy_disable(struct platform_device *pdev) @@ -54,7 +53,7 @@ static void exynos_ohci_phy_disable(struct platform_device *pdev) struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); if (exynos_ohci->phy) - usb_phy_shutdown(exynos_ohci->phy); + phy_power_off(exynos_ohci->phy); } static int exynos_ohci_probe(struct platform_device *pdev) @@ -62,7 +61,8 @@ static int exynos_ohci_probe(struct platform_device *pdev) struct exynos_ohci_hcd *exynos_ohci; struct usb_hcd *hcd; struct resource *res; - struct usb_phy *phy; + struct phy *phy; + const char *phy_name; int irq; int err; @@ -89,14 +89,14 @@ static int exynos_ohci_probe(struct platform_device *pdev) "samsung,exynos5440-ohci")) 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"); return -EPROBE_DEFER; } else { exynos_ohci->phy = phy; - exynos_ohci->otg = phy->otg; } skip_phy: @@ -135,9 +135,6 @@ skip_phy: goto fail_io; } - if (exynos_ohci->otg) - exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - platform_set_drvdata(pdev, hcd); exynos_ohci_phy_enable(pdev); @@ -165,9 +162,6 @@ static int exynos_ohci_remove(struct platform_device *pdev) usb_remove_hcd(hcd); - if (exynos_ohci->otg) - exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - exynos_ohci_phy_disable(pdev); clk_disable_unprepare(exynos_ohci->clk); @@ -210,9 +204,6 @@ static int exynos_ohci_suspend(struct device *dev) clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - if (exynos_ohci->otg) - exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - exynos_ohci_phy_disable(pdev); clk_disable_unprepare(exynos_ohci->clk); @@ -231,9 +222,6 @@ static int exynos_ohci_resume(struct device *dev) clk_prepare_enable(exynos_ohci->clk); - if (exynos_ohci->otg) - exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); - exynos_ohci_phy_enable(pdev); ohci_resume(hcd, false);