diff mbox

[1/2] USB mxs-phy: Register phy with framework

Message ID 1359631937-26646-2-git-send-email-s.hauer@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Sascha Hauer Jan. 31, 2013, 11:32 a.m. UTC
We now have usb_add_phy_dev(), so use it to register with the framework
to be able to find the phy from the USB driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/otg/mxs-phy.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Kishon Vijay Abraham I Jan. 31, 2013, 2:14 p.m. UTC | #1
On Thursday 31 January 2013 05:02 PM, Sascha Hauer wrote:
> We now have usb_add_phy_dev(), so use it to register with the framework
> to be able to find the phy from the USB driver.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>   drivers/usb/otg/mxs-phy.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
> index 5158332..5b39885 100644
> --- a/drivers/usb/otg/mxs-phy.c
> +++ b/drivers/usb/otg/mxs-phy.c
> @@ -127,6 +127,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
>   	void __iomem *base;
>   	struct clk *clk;
>   	struct mxs_phy *mxs_phy;
> +	int ret;
>
>   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>   	if (!res) {
> @@ -166,11 +167,19 @@ static int mxs_phy_probe(struct platform_device *pdev)
>
>   	platform_set_drvdata(pdev, &mxs_phy->phy);
>
> +	ret = usb_add_phy_dev(&mxs_phy->phy);
> +	if (ret)
> +		return ret;
> +
>   	return 0;
>   }
>
>   static int mxs_phy_remove(struct platform_device *pdev)
>   {
> +	struct mxs_phy *mxs_phy = platform_get_drvdata(pdev);
> +
> +	usb_remove_phy(&mxs_phy->phy);
> +
>   	platform_set_drvdata(pdev, NULL);
>
>   	return 0;
>
Peter Chen Feb. 1, 2013, 1:16 a.m. UTC | #2
On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
> We now have usb_add_phy_dev(), so use it to register with the framework
> to be able to find the phy from the USB driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/usb/otg/mxs-phy.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
> index 5158332..5b39885 100644
> --- a/drivers/usb/otg/mxs-phy.c
> +++ b/drivers/usb/otg/mxs-phy.c
> @@ -127,6 +127,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
>  	void __iomem *base;
>  	struct clk *clk;
>  	struct mxs_phy *mxs_phy;
> +	int ret;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -166,11 +167,19 @@ static int mxs_phy_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, &mxs_phy->phy);
>  
> +	ret = usb_add_phy_dev(&mxs_phy->phy);
> +	if (ret)
> +		return ret;
> +
>  	return 0;
>  }
>  
>  static int mxs_phy_remove(struct platform_device *pdev)
>  {
> +	struct mxs_phy *mxs_phy = platform_get_drvdata(pdev);
> +
> +	usb_remove_phy(&mxs_phy->phy);
> +
>  	platform_set_drvdata(pdev, NULL);
>  
>  	return 0;
Reviewed-by: Peter Chen <peter.chen@freescale.com>
Felipe Balbi Feb. 14, 2013, 10:37 a.m. UTC | #3
Hi,

On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
> We now have usb_add_phy_dev(), so use it to register with the framework
> to be able to find the phy from the USB driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha, are you taking this through your tree or you want me to queue it
up ?

If you want to take it:

Acked-by: Felipe Balbi <balbi@ti.com>
Sascha Hauer Feb. 14, 2013, 4:23 p.m. UTC | #4
On Thu, Feb 14, 2013 at 12:37:29PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
> > We now have usb_add_phy_dev(), so use it to register with the framework
> > to be able to find the phy from the USB driver.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Sascha, are you taking this through your tree or you want me to queue it
> up ?

I would prefer if either you could take it or Alexander Shishkin along
with the other patches in:

[PATCH v4] USB: add devicetree helpers for determining dr_mode and phy_type

Could you have a look at them? Alexander is asking for an ack for 1/9,
2/9, 3/9, 8/9. I just realized you are not on Cc for these. I could
bounce you the patches in case you don't have them in your mailbox.

Thanks
 Sascha
Felipe Balbi Feb. 14, 2013, 6 p.m. UTC | #5
Hi,

On Thu, Feb 14, 2013 at 05:23:37PM +0100, Sascha Hauer wrote:
> On Thu, Feb 14, 2013 at 12:37:29PM +0200, Felipe Balbi wrote:
> > Hi,
> > 
> > On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
> > > We now have usb_add_phy_dev(), so use it to register with the framework
> > > to be able to find the phy from the USB driver.
> > > 
> > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > 
> > Sascha, are you taking this through your tree or you want me to queue it
> > up ?
> 
> I would prefer if either you could take it or Alexander Shishkin along
> with the other patches in:
> 
> [PATCH v4] USB: add devicetree helpers for determining dr_mode and phy_type
> 
> Could you have a look at them? Alexander is asking for an ack for 1/9,
> 2/9, 3/9, 8/9. I just realized you are not on Cc for these. I could
> bounce you the patches in case you don't have them in your mailbox.

Ok, I'll look at them, no need to bounce. You _do_ realize, however,
that Greg has already closed all his trees for v3.9, right ? So anything
from now on will be queued for v3.10.
Sascha Hauer Feb. 14, 2013, 6:43 p.m. UTC | #6
On Thu, Feb 14, 2013 at 08:00:11PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Feb 14, 2013 at 05:23:37PM +0100, Sascha Hauer wrote:
> > On Thu, Feb 14, 2013 at 12:37:29PM +0200, Felipe Balbi wrote:
> > > Hi,
> > > 
> > > On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
> > > > We now have usb_add_phy_dev(), so use it to register with the framework
> > > > to be able to find the phy from the USB driver.
> > > > 
> > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > 
> > > Sascha, are you taking this through your tree or you want me to queue it
> > > up ?
> > 
> > I would prefer if either you could take it or Alexander Shishkin along
> > with the other patches in:
> > 
> > [PATCH v4] USB: add devicetree helpers for determining dr_mode and phy_type
> > 
> > Could you have a look at them? Alexander is asking for an ack for 1/9,
> > 2/9, 3/9, 8/9. I just realized you are not on Cc for these. I could
> > bounce you the patches in case you don't have them in your mailbox.
> 
> Ok, I'll look at them, no need to bounce. You _do_ realize, however,
> that Greg has already closed all his trees for v3.9, right ? So anything
> from now on will be queued for v3.10.

I'm fine with that. I'm just a bit insistent because the chipidea patches are
floating around for half a year now. Once I have the warm feeling that
the patches are handled I have time ;)

Thanks
 Sascha
Felipe Balbi Feb. 27, 2013, 8:10 a.m. UTC | #7
On Thu, Feb 14, 2013 at 07:43:54PM +0100, Sascha Hauer wrote:
> On Thu, Feb 14, 2013 at 08:00:11PM +0200, Felipe Balbi wrote:
> > Hi,
> > 
> > On Thu, Feb 14, 2013 at 05:23:37PM +0100, Sascha Hauer wrote:
> > > On Thu, Feb 14, 2013 at 12:37:29PM +0200, Felipe Balbi wrote:
> > > > Hi,
> > > > 
> > > > On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
> > > > > We now have usb_add_phy_dev(), so use it to register with the framework
> > > > > to be able to find the phy from the USB driver.
> > > > > 
> > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > > 
> > > > Sascha, are you taking this through your tree or you want me to queue it
> > > > up ?
> > > 
> > > I would prefer if either you could take it or Alexander Shishkin along
> > > with the other patches in:
> > > 
> > > [PATCH v4] USB: add devicetree helpers for determining dr_mode and phy_type
> > > 
> > > Could you have a look at them? Alexander is asking for an ack for 1/9,
> > > 2/9, 3/9, 8/9. I just realized you are not on Cc for these. I could
> > > bounce you the patches in case you don't have them in your mailbox.
> > 
> > Ok, I'll look at them, no need to bounce. You _do_ realize, however,
> > that Greg has already closed all his trees for v3.9, right ? So anything
> > from now on will be queued for v3.10.
> 
> I'm fine with that. I'm just a bit insistent because the chipidea patches are
> floating around for half a year now. Once I have the warm feeling that
> the patches are handled I have time ;)

I'm getting ready to queue patches but, when looking at this thread, it
seems like another version should've been sent. I'll skip this and look
at the other chipidea threads,

cheers
Marc Kleine-Budde Feb. 27, 2013, 9:22 a.m. UTC | #8
On 02/27/2013 09:10 AM, Felipe Balbi wrote:
> On Thu, Feb 14, 2013 at 07:43:54PM +0100, Sascha Hauer wrote:
>> On Thu, Feb 14, 2013 at 08:00:11PM +0200, Felipe Balbi wrote:
>>> Hi,
>>>
>>> On Thu, Feb 14, 2013 at 05:23:37PM +0100, Sascha Hauer wrote:
>>>> On Thu, Feb 14, 2013 at 12:37:29PM +0200, Felipe Balbi wrote:
>>>>> Hi,
>>>>>
>>>>> On Thu, Jan 31, 2013 at 12:32:16PM +0100, Sascha Hauer wrote:
>>>>>> We now have usb_add_phy_dev(), so use it to register with the framework
>>>>>> to be able to find the phy from the USB driver.
>>>>>>
>>>>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>>>>
>>>>> Sascha, are you taking this through your tree or you want me to queue it
>>>>> up ?
>>>>
>>>> I would prefer if either you could take it or Alexander Shishkin along
>>>> with the other patches in:
>>>>
>>>> [PATCH v4] USB: add devicetree helpers for determining dr_mode and phy_type
>>>>
>>>> Could you have a look at them? Alexander is asking for an ack for 1/9,
>>>> 2/9, 3/9, 8/9. I just realized you are not on Cc for these. I could
>>>> bounce you the patches in case you don't have them in your mailbox.
>>>
>>> Ok, I'll look at them, no need to bounce. You _do_ realize, however,
>>> that Greg has already closed all his trees for v3.9, right ? So anything
>>> from now on will be queued for v3.10.
>>
>> I'm fine with that. I'm just a bit insistent because the chipidea patches are
>> floating around for half a year now. Once I have the warm feeling that
>> the patches are handled I have time ;)
> 
> I'm getting ready to queue patches but, when looking at this thread, it
> seems like another version should've been sent. I'll skip this and look
> at the other chipidea threads,

I'm currently rebasing Saschas patches to Greg's usb-net.

Marc

---
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
diff mbox

Patch

diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
index 5158332..5b39885 100644
--- a/drivers/usb/otg/mxs-phy.c
+++ b/drivers/usb/otg/mxs-phy.c
@@ -127,6 +127,7 @@  static int mxs_phy_probe(struct platform_device *pdev)
 	void __iomem *base;
 	struct clk *clk;
 	struct mxs_phy *mxs_phy;
+	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -166,11 +167,19 @@  static int mxs_phy_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, &mxs_phy->phy);
 
+	ret = usb_add_phy_dev(&mxs_phy->phy);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
 static int mxs_phy_remove(struct platform_device *pdev)
 {
+	struct mxs_phy *mxs_phy = platform_get_drvdata(pdev);
+
+	usb_remove_phy(&mxs_phy->phy);
+
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;