From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew@lunn.ch (Andrew Lunn) Date: Tue, 6 May 2014 15:33:41 +0200 Subject: [PATCH v3 02/20] usb: ehci-orion: Add the optional PHY support In-Reply-To: <1399335255-589-3-git-send-email-gregory.clement@free-electrons.com> References: <1399335255-589-1-git-send-email-gregory.clement@free-electrons.com> <1399335255-589-3-git-send-email-gregory.clement@free-electrons.com> Message-ID: <20140506133341.GE6503@lunn.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, May 06, 2014 at 02:13:57AM +0200, Gregory CLEMENT wrote: > This commit allows to use the PHY provided through the device tree. It > will be useful for the Armada 375 SoCs. if no PHY is provided then the > behavior of the driver is unchanged. > > Signed-off-by: Gregory CLEMENT > --- > drivers/usb/host/ehci-orion.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c > index d6c19c37c76b..f6d9eb2e33cd 100644 > --- a/drivers/usb/host/ehci-orion.c > +++ b/drivers/usb/host/ehci-orion.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -46,6 +47,7 @@ > > struct orion_ehci_hcd { > struct clk *clk; > + struct phy *phy; > }; > > static const char hcd_name[] = "ehci-orion"; > @@ -224,6 +226,18 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) > if (!IS_ERR(priv->clk)) > clk_prepare_enable(priv->clk); > > + > + priv->phy = devm_phy_get(&pdev->dev, "usb"); > + if (!IS_ERR(priv->phy)) { > + err = phy_init(priv->phy); > + if (err) > + goto err2; > + > + err = phy_power_on(priv->phy); > + if (err) > + goto err3; > + } Hi Gregory What about EPROBE_DEFERRED? Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH v3 02/20] usb: ehci-orion: Add the optional PHY support Date: Tue, 6 May 2014 15:33:41 +0200 Message-ID: <20140506133341.GE6503@lunn.ch> References: <1399335255-589-1-git-send-email-gregory.clement@free-electrons.com> <1399335255-589-3-git-send-email-gregory.clement@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1399335255-589-3-git-send-email-gregory.clement@free-electrons.com> Sender: linux-kernel-owner@vger.kernel.org To: Gregory CLEMENT Cc: Mathias Nyman , Greg Kroah-Hartman , Felipe Balbi , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Thomas Petazzoni , Ezequiel Garcia , linux-arm-kernel@lists.infradead.org, Lior Amsalem , Tawfik Bayouk , Nadav Haklai , Grant Likely , Rob Herring , devicetree@vger.kernel.org List-Id: devicetree@vger.kernel.org On Tue, May 06, 2014 at 02:13:57AM +0200, Gregory CLEMENT wrote: > This commit allows to use the PHY provided through the device tree. It > will be useful for the Armada 375 SoCs. if no PHY is provided then the > behavior of the driver is unchanged. > > Signed-off-by: Gregory CLEMENT > --- > drivers/usb/host/ehci-orion.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c > index d6c19c37c76b..f6d9eb2e33cd 100644 > --- a/drivers/usb/host/ehci-orion.c > +++ b/drivers/usb/host/ehci-orion.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -46,6 +47,7 @@ > > struct orion_ehci_hcd { > struct clk *clk; > + struct phy *phy; > }; > > static const char hcd_name[] = "ehci-orion"; > @@ -224,6 +226,18 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) > if (!IS_ERR(priv->clk)) > clk_prepare_enable(priv->clk); > > + > + priv->phy = devm_phy_get(&pdev->dev, "usb"); > + if (!IS_ERR(priv->phy)) { > + err = phy_init(priv->phy); > + if (err) > + goto err2; > + > + err = phy_power_on(priv->phy); > + if (err) > + goto err3; > + } Hi Gregory What about EPROBE_DEFERRED? Andrew