Patchwork [5/7] IBM Akebono: Add support to the EHCI platform driver for Akebono

login
register
mail settings
Submitter Alistair Popple
Date Nov. 5, 2013, 5:31 a.m.
Message ID <1383629471-16979-5-git-send-email-alistair@popple.id.au>
Download mbox | patch
Permalink /patch/288385/
State Superseded
Headers show

Comments

Alistair Popple - Nov. 5, 2013, 5:31 a.m.
The IBM Akebono board has an EHCI compliant USB host interface. This
patch adds support for it to the EHCI platform driver.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ehci-platform.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Alan Stern - Nov. 5, 2013, 3:04 p.m.
On Tue, 5 Nov 2013, Alistair Popple wrote:

> The IBM Akebono board has an EHCI compliant USB host interface. This
> patch adds support for it to the EHCI platform driver.
> 
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: linux-usb@vger.kernel.org
> ---
>  drivers/usb/host/ehci-platform.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index f6b790c..0a67616 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -203,9 +203,10 @@ static int ehci_platform_resume(struct device *dev)
>  #define ehci_platform_resume	NULL
>  #endif /* CONFIG_PM */
>  
> -static const struct of_device_id vt8500_ehci_ids[] = {
> +static const struct of_device_id ehci_platform_ids[] = {
>  	{ .compatible = "via,vt8500-ehci", },
>  	{ .compatible = "wm,prizm-ehci", },
> +	{ .compatible = "ibm,akebono-ehci", },
>  	{}
>  };
>  
> @@ -229,7 +230,7 @@ static struct platform_driver ehci_platform_driver = {
>  		.owner	= THIS_MODULE,
>  		.name	= "ehci-platform",
>  		.pm	= &ehci_platform_pm_ops,
> -		.of_match_table = vt8500_ehci_ids,
> +		.of_match_table = ehci_platform_ids,
>  	}
>  };

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Benjamin Herrenschmidt - Nov. 5, 2013, 7:52 p.m.
On Tue, 2013-11-05 at 10:04 -0500, Alan Stern wrote:
> On Tue, 5 Nov 2013, Alistair Popple wrote:
> 
> > The IBM Akebono board has an EHCI compliant USB host interface. This
> > patch adds support for it to the EHCI platform driver.
> > 
> > Signed-off-by: Alistair Popple <alistair@popple.id.au>
> > Cc: Alan Stern <stern@rowland.harvard.edu>
> > Cc: linux-usb@vger.kernel.org
> > ---
> >  drivers/usb/host/ehci-platform.c |    5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> > index f6b790c..0a67616 100644
> > --- a/drivers/usb/host/ehci-platform.c
> > +++ b/drivers/usb/host/ehci-platform.c
> > @@ -203,9 +203,10 @@ static int ehci_platform_resume(struct device *dev)
> >  #define ehci_platform_resume	NULL
> >  #endif /* CONFIG_PM */
> >  
> > -static const struct of_device_id vt8500_ehci_ids[] = {
> > +static const struct of_device_id ehci_platform_ids[] = {
> >  	{ .compatible = "via,vt8500-ehci", },
> >  	{ .compatible = "wm,prizm-ehci", },
> > +	{ .compatible = "ibm,akebono-ehci", },
> >  	{}
> >  };

Why ? Do we need to add an entry for every platform in there ? Besides,
it probably should be the SoC name not the platform here....

Why not simply a generic compatible "usb-ehci" ? It's a standard
programming interface, there are no specific quirks, we shouldn't
need to have to add new entries to the driver like that for every
new SoC/platform.

> > @@ -229,7 +230,7 @@ static struct platform_driver ehci_platform_driver = {
> >  		.owner	= THIS_MODULE,
> >  		.name	= "ehci-platform",
> >  		.pm	= &ehci_platform_pm_ops,
> > -		.of_match_table = vt8500_ehci_ids,
> > +		.of_match_table = ehci_platform_ids,
> >  	}
> >  };
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
Alistair Popple - Nov. 6, 2013, 3:50 a.m.
On Wed, 6 Nov 2013 06:52:13 Benjamin Herrenschmidt wrote:

[snip]

> 
> Why ? Do we need to add an entry for every platform in there ? Besides,
> it probably should be the SoC name not the platform here....
> 
> Why not simply a generic compatible "usb-ehci" ? It's a standard
> programming interface, there are no specific quirks, we shouldn't
> need to have to add new entries to the driver like that for every
> new SoC/platform.
> 

Actually a grep of "usb-ehci" turns up the ehci-ppc-of driver which I somehow 
missed. This driver works and uses .compatible = "usb-ehci" so I can use that 
instead if that is preferable?

However it is basically the same as the ehci-platform driver so I guess at 
some point the two should be merged...

> > > @@ -229,7 +230,7 @@ static struct platform_driver ehci_platform_driver =
> > > {
> > > 
> > >  		.owner	= THIS_MODULE,
> > >  		.name	= "ehci-platform",
> > >  		.pm	= &ehci_platform_pm_ops,
> > > 
> > > -		.of_match_table = vt8500_ehci_ids,
> > > +		.of_match_table = ehci_platform_ids,
> > > 
> > >  	}
> > >  
> > >  };
> > 
> > Acked-by: Alan Stern <stern@rowland.harvard.edu>
> > 
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
Benjamin Herrenschmidt - Nov. 6, 2013, 3:58 a.m.
On Wed, 2013-11-06 at 14:50 +1100, Alistair Popple wrote:
> Actually a grep of "usb-ehci" turns up the ehci-ppc-of driver which I somehow 
> missed. This driver works and uses .compatible = "usb-ehci" so I can use that 
> instead if that is preferable?
> 
> However it is basically the same as the ehci-platform driver so I guess at 
> some point the two should be merged...

I think the split predates the grand unification of "of" driver and platform,
so yes they should.

Cheers,
Ben.

Patch

diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index f6b790c..0a67616 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -203,9 +203,10 @@  static int ehci_platform_resume(struct device *dev)
 #define ehci_platform_resume	NULL
 #endif /* CONFIG_PM */
 
-static const struct of_device_id vt8500_ehci_ids[] = {
+static const struct of_device_id ehci_platform_ids[] = {
 	{ .compatible = "via,vt8500-ehci", },
 	{ .compatible = "wm,prizm-ehci", },
+	{ .compatible = "ibm,akebono-ehci", },
 	{}
 };
 
@@ -229,7 +230,7 @@  static struct platform_driver ehci_platform_driver = {
 		.owner	= THIS_MODULE,
 		.name	= "ehci-platform",
 		.pm	= &ehci_platform_pm_ops,
-		.of_match_table = vt8500_ehci_ids,
+		.of_match_table = ehci_platform_ids,
 	}
 };