mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamil Debski <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,
	Kamil Debski <k.debski@samsung.com>
Subject: [PATCH 4/5] usb: ehci-s5p: Change to use phy provided by the generic phy framework
Date: Fri, 25 Oct 2013 16:15:28 +0200	[thread overview]
Message-ID: <1382710529-12082-5-git-send-email-k.debski@samsung.com> (raw)
In-Reply-To: <1382710529-12082-1-git-send-email-k.debski@samsung.com>

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 <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/usb/host/ehci-s5p.c |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 7cc26e6..76606ff 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
+#include <linux/phy/phy.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/usb-ehci-s5p.h>
 #include <linux/usb/phy.h>
@@ -45,7 +46,7 @@ static struct hc_driver __read_mostly s5p_ehci_hc_driver;
 
 struct s5p_ehci_hcd {
 	struct clk *clk;
-	struct usb_phy *phy;
+	struct phy *phy;
 	struct usb_otg *otg;
 	struct s5p_ehci_platdata *pdata;
 };
@@ -77,10 +78,11 @@ static int s5p_ehci_probe(struct platform_device *pdev)
 {
 	struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
 	struct s5p_ehci_hcd *s5p_ehci;
+	struct phy *phy;
 	struct usb_hcd *hcd;
 	struct ehci_hcd *ehci;
 	struct resource *res;
-	struct usb_phy *phy;
+	const char *phy_name;
 	int irq;
 	int err;
 
@@ -103,14 +105,14 @@ static int s5p_ehci_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 	s5p_ehci = to_s5p_ehci(hcd);
-
+	phy_name = of_get_property(pdev->dev.of_node, "phy-names", NULL);
+	phy =  devm_phy_get(&pdev->dev, phy_name);
 	if (of_device_is_compatible(pdev->dev.of_node,
 					"samsung,exynos5440-ehci")) {
 		s5p_ehci->pdata = &empty_platdata;
 		goto skip_phy;
 	}
 
-	phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
 	if (IS_ERR(phy)) {
 		/* Fallback to pdata */
 		if (!pdata) {
@@ -122,7 +124,6 @@ static int s5p_ehci_probe(struct platform_device *pdev)
 		}
 	} else {
 		s5p_ehci->phy = phy;
-		s5p_ehci->otg = phy->otg;
 	}
 
 skip_phy:
@@ -166,7 +167,7 @@ skip_phy:
 		s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
 
 	if (s5p_ehci->phy)
-		usb_phy_init(s5p_ehci->phy);
+		phy_power_on(s5p_ehci->phy);
 	else if (s5p_ehci->pdata->phy_init)
 		s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
 
@@ -188,7 +189,7 @@ skip_phy:
 
 fail_add_hcd:
 	if (s5p_ehci->phy)
-		usb_phy_shutdown(s5p_ehci->phy);
+		phy_power_off(s5p_ehci->phy);
 	else if (s5p_ehci->pdata->phy_exit)
 		s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 fail_io:
@@ -209,7 +210,7 @@ static int s5p_ehci_remove(struct platform_device *pdev)
 		s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
 
 	if (s5p_ehci->phy)
-		usb_phy_shutdown(s5p_ehci->phy);
+		phy_power_off(s5p_ehci->phy);
 	else if (s5p_ehci->pdata->phy_exit)
 		s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 
@@ -244,7 +245,7 @@ static int s5p_ehci_suspend(struct device *dev)
 		s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
 
 	if (s5p_ehci->phy)
-		usb_phy_shutdown(s5p_ehci->phy);
+		phy_power_off(s5p_ehci->phy);
 	else if (s5p_ehci->pdata->phy_exit)
 		s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 
@@ -265,7 +266,7 @@ static int s5p_ehci_resume(struct device *dev)
 		s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
 
 	if (s5p_ehci->phy)
-		usb_phy_init(s5p_ehci->phy);
+		phy_power_on(s5p_ehci->phy);
 	else if (s5p_ehci->pdata->phy_init)
 		s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
 
-- 
1.7.9.5


  parent reply	other threads:[~2013-10-25 14:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 14:15 [PATCH 0/5] phy: Add new Exynos USB PHY driver Kamil Debski
2013-10-25 14:15 ` [PATCH v2 1/5] " Kamil Debski
2013-10-25 15:39   ` Kishon Vijay Abraham I
2013-10-28 13:52     ` Kamil Debski
2013-10-28 20:00       ` Tomasz Figa
2013-10-29 10:16         ` Kamil Debski
2013-10-29  9:52       ` Kishon Vijay Abraham I
2013-10-25 21:36   ` Kumar Gala
2013-10-28 13:52     ` Kamil Debski
2013-10-25 14:15 ` [RFC PATCH 2/5] phy: Add WIP Exynos 5250 support to the " Kamil Debski
2013-10-25 15:43   ` Kishon Vijay Abraham I
2013-10-28 13:52     ` Kamil Debski
2013-10-28 14:41     ` Vivek Gautam
2013-10-29  9:55       ` Kishon Vijay Abraham I
2013-10-29 10:14         ` Kamil Debski
2013-10-29 10:51           ` Kishon Vijay Abraham I
2013-10-25 14:15 ` [PATCH 3/5] phy: Add support for S5PV210 " Kamil Debski
2013-10-25 15:50   ` Kishon Vijay Abraham I
2013-10-26  1:40     ` Jingoo Han
2013-10-25 14:15 ` Kamil Debski [this message]
2013-10-25 15:52   ` [PATCH 4/5] usb: ehci-s5p: Change to use phy provided by the generic phy framework Kishon Vijay Abraham I
2013-10-26  1:27   ` Jingoo Han
2013-10-28 13:52     ` Kamil Debski
2013-10-26  9:41   ` Vivek Gautam
2013-10-28 13:53     ` Kamil Debski
2013-10-28 14:36       ` Vivek Gautam
2013-10-25 14:15 ` [PATCH 5/5] usb: s3c-hsotg: Use the new Exynos USB phy driver with " Kamil Debski
2013-10-25 15:53   ` Kishon Vijay Abraham I

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=1382710529-12082-5-git-send-email-k.debski@samsung.com \
    --to=k.debski@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gautam.vivek@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=s.nawrocki@samsung.com \
    --cc=t.figa@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®