* [PATCH 0/2] isp1760: Allow device-tree-based probing on non-powerpc architectures @ 2011-09-14 13:57 Dave Martin [not found] ` <1316008633-31009-1-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Dave Martin @ 2011-09-14 13:57 UTC (permalink / raw) To: linux-usb-u79uwXL29TY76Z2rM5mHXA Cc: patches-QSEj5FYQhm4dnm+yROfE0A, Grant Likely, Arvid Brodin, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Dave Martin There are a couple of minor issues which currently prevent the isp1760 driver probing via the device tree on architectures other than powerpc. This series should allow device-tree probing for this driver to work more widely. Dave Martin (2): isp1760: Make probing via device tree non-powerpc-specific isp1760: Fix endianness-sensitivity in of_isp1760_probe() drivers/usb/host/isp1760-if.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <1316008633-31009-1-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* [PATCH 1/2] isp1760: Make probing via device tree non-powerpc-specific [not found] ` <1316008633-31009-1-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2011-09-14 13:57 ` Dave Martin [not found] ` <1316008633-31009-2-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 13:57 ` [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() Dave Martin 1 sibling, 1 reply; 8+ messages in thread From: Dave Martin @ 2011-09-14 13:57 UTC (permalink / raw) To: linux-usb-u79uwXL29TY76Z2rM5mHXA Cc: patches-QSEj5FYQhm4dnm+yROfE0A, Grant Likely, Arvid Brodin, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Dave Martin This patch just replaces the (presumably historical) CONFIG_OF_PPC Signed-off-by: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Acked-by: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> --- drivers/usb/host/isp1760-if.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index 7ee3005..69ee32c 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -17,16 +17,18 @@ #include "isp1760-hcd.h" -#ifdef CONFIG_PPC_OF +#ifdef CONFIG_OF #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/of_address.h> +#include <linux/of_irq.h> #endif #ifdef CONFIG_PCI #include <linux/pci.h> #endif -#ifdef CONFIG_PPC_OF +#ifdef CONFIG_OF static int of_isp1760_probe(struct platform_device *dev) { struct usb_hcd *hcd; @@ -396,7 +398,7 @@ static int __init isp1760_init(void) ret = platform_driver_register(&isp1760_plat_driver); if (!ret) any_ret = 0; -#ifdef CONFIG_PPC_OF +#ifdef CONFIG_OF ret = platform_driver_register(&isp1760_of_driver); if (!ret) any_ret = 0; @@ -416,7 +418,7 @@ module_init(isp1760_init); static void __exit isp1760_exit(void) { platform_driver_unregister(&isp1760_plat_driver); -#ifdef CONFIG_PPC_OF +#ifdef CONFIG_OF platform_driver_unregister(&isp1760_of_driver); #endif #ifdef CONFIG_PCI -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <1316008633-31009-2-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* Re: [PATCH 1/2] isp1760: Make probing via device tree non-powerpc-specific [not found] ` <1316008633-31009-2-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2011-09-14 14:10 ` Dave Martin 2011-09-14 15:43 ` Grant Likely 1 sibling, 0 replies; 8+ messages in thread From: Dave Martin @ 2011-09-14 14:10 UTC (permalink / raw) To: linux-usb-u79uwXL29TY76Z2rM5mHXA Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Arvid Brodin, Dave Martin, patches-QSEj5FYQhm4dnm+yROfE0A On Wed, Sep 14, 2011 at 2:57 PM, Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: > This patch just replaces the (presumably historical) CONFIG_OF_PPC Apologies, it looks like a script ate part of the commit message for this commit. It should read: isp1760: Make probing via device tree non-powerpc-specific This patch just replaces the (presumably historical) CONFIG_OF_PPC ifdefs with CONFIG_OF, and supplies some missing includes. I can fix that when reposting, but feedback on the patch is still appreciated in the meantime. Thanks ---Dave > > Signed-off-by: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Acked-by: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> > --- > drivers/usb/host/isp1760-if.c | 10 ++++++---- > 1 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c > index 7ee3005..69ee32c 100644 > --- a/drivers/usb/host/isp1760-if.c > +++ b/drivers/usb/host/isp1760-if.c > @@ -17,16 +17,18 @@ > > #include "isp1760-hcd.h" > > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF > #include <linux/of.h> > #include <linux/of_platform.h> > +#include <linux/of_address.h> > +#include <linux/of_irq.h> > #endif > > #ifdef CONFIG_PCI > #include <linux/pci.h> > #endif > > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF > static int of_isp1760_probe(struct platform_device *dev) > { > struct usb_hcd *hcd; > @@ -396,7 +398,7 @@ static int __init isp1760_init(void) > ret = platform_driver_register(&isp1760_plat_driver); > if (!ret) > any_ret = 0; > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF > ret = platform_driver_register(&isp1760_of_driver); > if (!ret) > any_ret = 0; > @@ -416,7 +418,7 @@ module_init(isp1760_init); > static void __exit isp1760_exit(void) > { > platform_driver_unregister(&isp1760_plat_driver); > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF > platform_driver_unregister(&isp1760_of_driver); > #endif > #ifdef CONFIG_PCI > -- > 1.7.4.1 > > -- Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Linaro Kernel Working Group -- http://www.linaro.org/ -- Open source software for ARM SoCs http://www.facebook.com/pages/Linaro http://twitter.com/#!/linaroorg http://www.linaro.org/linaro-blog/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] isp1760: Make probing via device tree non-powerpc-specific [not found] ` <1316008633-31009-2-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 14:10 ` Dave Martin @ 2011-09-14 15:43 ` Grant Likely 1 sibling, 0 replies; 8+ messages in thread From: Grant Likely @ 2011-09-14 15:43 UTC (permalink / raw) To: Dave Martin Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-usb-u79uwXL29TY76Z2rM5mHXA, Arvid Brodin, patches-QSEj5FYQhm4dnm+yROfE0A On Wed, Sep 14, 2011 at 02:57:12PM +0100, Dave Martin wrote: > This patch just replaces the (presumably historical) CONFIG_OF_PPC > > Signed-off-by: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Acked-by: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> > --- > drivers/usb/host/isp1760-if.c | 10 ++++++---- > 1 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c > index 7ee3005..69ee32c 100644 > --- a/drivers/usb/host/isp1760-if.c > +++ b/drivers/usb/host/isp1760-if.c > @@ -17,16 +17,18 @@ > > #include "isp1760-hcd.h" > > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF This #ifdef can just be dropped entirely. linux/of*.h is always safe to include now. > #include <linux/of.h> > #include <linux/of_platform.h> > +#include <linux/of_address.h> > +#include <linux/of_irq.h> > #endif > > #ifdef CONFIG_PCI > #include <linux/pci.h> > #endif > > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF > static int of_isp1760_probe(struct platform_device *dev) > { > struct usb_hcd *hcd; > @@ -396,7 +398,7 @@ static int __init isp1760_init(void) > ret = platform_driver_register(&isp1760_plat_driver); > if (!ret) > any_ret = 0; > -#ifdef CONFIG_PPC_OF > +#ifdef CONFIG_OF > ret = platform_driver_register(&isp1760_of_driver); > if (!ret) > any_ret = 0; This should really be changed. It used to be that of_platform_driver and platform_driver were different things, but that is no longer the case. A single platform_driver should handle both the DT and non-DT use cases. That said, I don't have any objection to this patch being merged. I'd just be happier if it was cleaned up properly. g. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() [not found] ` <1316008633-31009-1-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 13:57 ` [PATCH 1/2] isp1760: Make probing via device tree non-powerpc-specific Dave Martin @ 2011-09-14 13:57 ` Dave Martin [not found] ` <1316008633-31009-3-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 1 sibling, 1 reply; 8+ messages in thread From: Dave Martin @ 2011-09-14 13:57 UTC (permalink / raw) To: linux-usb-u79uwXL29TY76Z2rM5mHXA Cc: patches-QSEj5FYQhm4dnm+yROfE0A, Grant Likely, Arvid Brodin, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Dave Martin Data read direct from device tree properties will be in the device tree's native endianness (i.e., big-endian). This patch uses of_property_read_u32() to read the bus-width property in host byte order instead. Signed-off-by: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Acked-by: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> --- drivers/usb/host/isp1760-if.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index 69ee32c..fa99c27 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -39,8 +39,8 @@ static int of_isp1760_probe(struct platform_device *dev) int virq; resource_size_t res_len; int ret; - const unsigned int *prop; unsigned int devflags = 0; + u32 bus_width = 0; ret = of_address_to_resource(dp, 0, &memory); if (ret) @@ -64,8 +64,8 @@ static int of_isp1760_probe(struct platform_device *dev) devflags |= ISP1760_FLAG_ISP1761; /* Some systems wire up only 16 of the 32 data lines */ - prop = of_get_property(dp, "bus-width", NULL); - if (prop && *prop == 16) + of_property_read_u32(dp, "bus-width", bus_width); + if (bus_width == 16) devflags |= ISP1760_FLAG_BUS_WIDTH_16; if (of_get_property(dp, "port1-otg", NULL) != NULL) -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 8+ messages in thread
[parent not found: <1316008633-31009-3-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* Re: [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() [not found] ` <1316008633-31009-3-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2011-09-14 15:46 ` Grant Likely 2011-09-14 19:12 ` Sergei Shtylyov 1 sibling, 0 replies; 8+ messages in thread From: Grant Likely @ 2011-09-14 15:46 UTC (permalink / raw) To: Dave Martin Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, patches-QSEj5FYQhm4dnm+yROfE0A, Arvid Brodin, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On Wed, Sep 14, 2011 at 02:57:13PM +0100, Dave Martin wrote: > Data read direct from device tree properties will be in the device > tree's native endianness (i.e., big-endian). > > This patch uses of_property_read_u32() to read the bus-width > property in host byte order instead. > > Signed-off-by: Dave Martin <dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Acked-by: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org> > --- > drivers/usb/host/isp1760-if.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c > index 69ee32c..fa99c27 100644 > --- a/drivers/usb/host/isp1760-if.c > +++ b/drivers/usb/host/isp1760-if.c > @@ -39,8 +39,8 @@ static int of_isp1760_probe(struct platform_device *dev) > int virq; > resource_size_t res_len; > int ret; > - const unsigned int *prop; > unsigned int devflags = 0; > + u32 bus_width = 0; > > ret = of_address_to_resource(dp, 0, &memory); > if (ret) > @@ -64,8 +64,8 @@ static int of_isp1760_probe(struct platform_device *dev) > devflags |= ISP1760_FLAG_ISP1761; > > /* Some systems wire up only 16 of the 32 data lines */ > - prop = of_get_property(dp, "bus-width", NULL); > - if (prop && *prop == 16) > + of_property_read_u32(dp, "bus-width", bus_width); Shouldn't this be '&bus_width'? g. > + if (bus_width == 16) > devflags |= ISP1760_FLAG_BUS_WIDTH_16; > > if (of_get_property(dp, "port1-otg", NULL) != NULL) > -- > 1.7.4.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() [not found] ` <1316008633-31009-3-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 15:46 ` Grant Likely @ 2011-09-14 19:12 ` Sergei Shtylyov [not found] ` <4E70FCB9.4050907-hkdhdckH98+B+jHODAdFcQ@public.gmane.org> 1 sibling, 1 reply; 8+ messages in thread From: Sergei Shtylyov @ 2011-09-14 19:12 UTC (permalink / raw) To: Dave Martin Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, patches-QSEj5FYQhm4dnm+yROfE0A, Grant Likely, Arvid Brodin, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ Hello. On 09/14/2011 05:57 PM, Dave Martin wrote: > Data read direct from device tree properties will be in the device > tree's native endianness (i.e., big-endian). > This patch uses of_property_read_u32() to read the bus-width > property in host byte order instead. > Signed-off-by: Dave Martin<dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Acked-by: Pawel Moll<pawel.moll-5wv7dgnIgG8@public.gmane.org> > --- > drivers/usb/host/isp1760-if.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c > index 69ee32c..fa99c27 100644 > --- a/drivers/usb/host/isp1760-if.c > +++ b/drivers/usb/host/isp1760-if.c [...] > @@ -64,8 +64,8 @@ static int of_isp1760_probe(struct platform_device *dev) > devflags |= ISP1760_FLAG_ISP1761; > > /* Some systems wire up only 16 of the 32 data lines */ > - prop = of_get_property(dp, "bus-width", NULL); > - if (prop&& *prop == 16) > + of_property_read_u32(dp, "bus-width", bus_width); You probably mean '&bus_width'? > + if (bus_width == 16) > devflags |= ISP1760_FLAG_BUS_WIDTH_16; > > if (of_get_property(dp, "port1-otg", NULL) != NULL) WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <4E70FCB9.4050907-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>]
* Re: [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() [not found] ` <4E70FCB9.4050907-hkdhdckH98+B+jHODAdFcQ@public.gmane.org> @ 2011-09-15 8:53 ` Dave Martin 0 siblings, 0 replies; 8+ messages in thread From: Dave Martin @ 2011-09-15 8:53 UTC (permalink / raw) To: Sergei Shtylyov, Grant Likely Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, patches-QSEj5FYQhm4dnm+yROfE0A, Arvid Brodin, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ Hi, On Wed, Sep 14, 2011 at 09:46:29AM -0600, Grant Likely wrote: > On Wed, Sep 14, 2011 at 02:57:13PM +0100, Dave Martin wrote: [...] > > + of_property_read_u32(dp, "bus-width", bus_width); > > Shouldn't this be '&bus_width'? On Wed, Sep 14, 2011 at 11:12:57PM +0400, Sergei Shtylyov wrote: [...] > On 09/14/2011 05:57 PM, Dave Martin wrote: [...] > >+ of_property_read_u32(dp, "bus-width", bus_width); > > You probably mean '&bus_width'? Yes, it should -- quite right. Cheers ---Dave -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-09-15 8:53 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-09-14 13:57 [PATCH 0/2] isp1760: Allow device-tree-based probing on non-powerpc architectures Dave Martin [not found] ` <1316008633-31009-1-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 13:57 ` [PATCH 1/2] isp1760: Make probing via device tree non-powerpc-specific Dave Martin [not found] ` <1316008633-31009-2-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 14:10 ` Dave Martin 2011-09-14 15:43 ` Grant Likely 2011-09-14 13:57 ` [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() Dave Martin [not found] ` <1316008633-31009-3-git-send-email-dave.martin-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2011-09-14 15:46 ` Grant Likely 2011-09-14 19:12 ` Sergei Shtylyov [not found] ` <4E70FCB9.4050907-hkdhdckH98+B+jHODAdFcQ@public.gmane.org> 2011-09-15 8:53 ` Dave Martin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).