mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@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: "'Kamil Debski'" <k.debski@samsung.com>,
	"'Kyungmin Park'" <kyungmin.park@samsung.com>,
	"'Kishon Vijay Abraham I'" <kishon@ti.com>,
	"'Tomasz Figa'" <t.figa@samsung.com>,
	"'Sylwester Nawrocki'" <s.nawrocki@samsung.com>,
	m.szyprowski@samsung.com, gautam.vivek@samsung.com,
	"'Mateusz Krawczuk'" <mat.krawczuk@gmail.com>,
	"'Yulgon Kim'" <yulgon.kim@samsung.com>,
	"'Praveen Paneri'" <p.paneri@samsung.com>,
	"'Anton Tikhomirov'" <av.tikhomirov@samsung.com>,
	"'Kumar Gala'" <galak@codeaurora.org>,
	"'Kamil Debski'" <k.debski@samsung.com>,
	"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH] usb: ohci-exynos: Change to use phy provided by the generic phy framework
Date: Wed, 06 Nov 2013 10:27:49 +0900	[thread overview]
Message-ID: <001401ceda8f$67f1ee50$37d5caf0$%han@samsung.com> (raw)

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 <jg1.han@samsung.com>
Cc: Kamil Debski <k.debski@samsung.com>
---
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 <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/phy/phy.h>
 #include <linux/platform_device.h>
 #include <linux/usb/phy.h>
 #include <linux/usb/samsung_usb_phy.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
-#include <linux/usb/otg.h>
 
 #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);
-- 
1.7.10.4



             reply	other threads:[~2013-11-06  1:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  1:27 Jingoo Han [this message]
2013-12-09  1:55 ` Greg KH
2013-12-09  9:26   ` Jingoo Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001401ceda8f$67f1ee50$37d5caf0$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=av.tikhomirov@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gautam.vivek@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mat.krawczuk@gmail.com \
    --cc=p.paneri@samsung.com \
    --cc=s.nawrocki@samsung.com \
    --cc=t.figa@samsung.com \
    --cc=yulgon.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®