Skip to contentSkip to conversation

USB: OHCI: Splitting ohci-platform into independent driver

PATCH Superseded Manjunath Goudar 3 participants 17 messages May 30, 2013 – Jun 3, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover USB: OHCI: Splitting ohci-platform into independent driver

This series patch begins the process of splitting ohci-platform up into independent driver modules and add a name for the platform-private field.

Patch 1/2 separate ohci-platform into independent driver modules.

Patch 2/2 adds an ohci->priv field for private use by OHCI platform drivers.

Manjunath Goudar (2):
USB: OHCI: make ohci-platform a separate driver
USB: OHCI: add a name for the platform-private field

 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 drivers/usb/host/ohci.h          |    3 ++
 5 files changed, 47 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

RFC PATCH 1/2 USB: OHCI: make ohci-platform a separate driver

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc Alan Stern <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 4 files changed, 44 insertions(+), 53 deletions(-)
drivers/usb/host/Kconfig +1 -1
index a0a2f3a..5391a38 100644
@@ -501,7 +501,7 @@ config USB_CNS3XXX_OHCI
 	  It is needed for low-speed USB 1.0 device support.
 
 config USB_OHCI_HCD_PLATFORM
-	bool "Generic OHCI driver for a platform device"
+	tristate "Generic OHCI driver for a platform device"
 	default n
 	---help---
 	  Adds an OHCI host driver for a generic platform device, which
drivers/usb/host/Makefile +1 -0
index 2214ded..8a89c3d 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_ISP1362_HCD)	+= isp1362-hcd.o
 
 obj-$(CONFIG_USB_OHCI_HCD)	+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI)	+= ohci-pci.o
+obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)	+= ohci-platform.o
 
 obj-$(CONFIG_USB_UHCI_HCD)	+= uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD)	+= fhci.o
drivers/usb/host/ohci-hcd.c +1 -5
index 237be7c..39c7624 100644
@@ -1258,12 +1258,8 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER		ohci_hcd_tilegx_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_PLATFORM
-#include "ohci-platform.c"
-#define PLATFORM_DRIVER		ohci_platform_driver
-#endif
-
 #if	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PCI) &&	\
+	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM) && \
 	!defined(PLATFORM_DRIVER) &&	\
 	!defined(OMAP1_PLATFORM_DRIVER) &&	\
 	!defined(OMAP3_PLATFORM_DRIVER) &&	\
drivers/usb/host/ohci-platform.c +41 -47

118 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

RFC PATCH 1/2 USB: OHCI: make ohci-platform a separate driver

Quoted 3 lines · Manjunath Goudar

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

Okay, except...

drivers/usb/host/ohci-platform.c static int ohci_platform_reset(struct usb_hcd *hcd) · line 56

Quoted 4 lines
drivers/usb/host/ohci-platform.c +3 -0
+static const struct ohci_driver_overrides platform_overrides = {
+	.product_desc =	"Generic Platform EHCI controller",
+	.reset =	ohci_platform_reset,
 };

Don't forget the __initconst annotation. After that is fixed, you can add my Acked-by.

Alan Stern

#3 lore raw

RFC PATCH 1/2 USB: OHCI: make ohci-platform a separate driver

Hello.

Quoted 8 lines · Alan Stern
Quoted 4 lines

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

Okay, except...

drivers/usb/host/ohci-platform.c static int ohci_platform_reset(struct usb_hcd *hcd) · line 54

Quoted 2 lines
drivers/usb/host/ohci-platform.c +2 -0
+static const struct ohci_driver_overrides platform_overrides = {
+	.product_desc =	"Generic Platform EHCI controller",
     Maybe "OHCI"? :-)
Quoted 1 line

Alan Stern

WBR, Sergei

#4 lore raw

v3 cover USB: OHCI: Splitting ohci-platform into independent driver

In reply to Manjunath Goudar

This series patch begins the process of splitting ohci-platform up into independent driver modules and add a name for the platform-private field.

Patch 1/2 separate ohci-platform into independent driver modules.

V2 to V3:
Directly Passed "hcd" argument without calling ohci_to_hcd() function.

Patch 2/2 adds an ohci->priv field for private use by OHCI platform drivers. V2 to V3:
No changes.

Manjunath Goudar (2):
USB: OHCI: make ohci-platform a separate driver
USB: OHCI: add a name for the platform-private field

 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 drivers/usb/host/ohci.h          |    3 ++
 5 files changed, 47 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 1/2 USB: OHCI: make ohci-platform a separate driver

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

In V2:
-Passed "hcd" argument instead of "ohci" in ohci_setup() because it is
using "struct usb_hcd" argument.
In V3:
-Directly passed "hcd" argument not required to call ohci_to_hcd() function.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 4 files changed, 44 insertions(+), 53 deletions(-)
drivers/usb/host/Kconfig +1 -1
index a0a2f3a..5391a38 100644
@@ -501,7 +501,7 @@ config USB_CNS3XXX_OHCI
 	  It is needed for low-speed USB 1.0 device support.
 
 config USB_OHCI_HCD_PLATFORM
-	bool "Generic OHCI driver for a platform device"
+	tristate "Generic OHCI driver for a platform device"
 	default n
 	---help---
 	  Adds an OHCI host driver for a generic platform device, which
drivers/usb/host/Makefile +1 -0
index 2214ded..8a89c3d 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_ISP1362_HCD)	+= isp1362-hcd.o
 
 obj-$(CONFIG_USB_OHCI_HCD)	+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI)	+= ohci-pci.o
+obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)	+= ohci-platform.o
 
 obj-$(CONFIG_USB_UHCI_HCD)	+= uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD)	+= fhci.o
drivers/usb/host/ohci-hcd.c +1 -5
index 237be7c..39c7624 100644
@@ -1258,12 +1258,8 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER		ohci_hcd_tilegx_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_PLATFORM
-#include "ohci-platform.c"
-#define PLATFORM_DRIVER		ohci_platform_driver
-#endif
-
 #if	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PCI) &&	\
+	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM) && \
 	!defined(PLATFORM_DRIVER) &&	\
 	!defined(OMAP1_PLATFORM_DRIVER) &&	\
 	!defined(OMAP3_PLATFORM_DRIVER) &&	\
drivers/usb/host/ohci-platform.c +41 -47

118 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 2/2 USB: OHCI: add a name for the platform-private field

In reply to Manjunath Goudar

This patch adds an ohci->priv field for private use by OHCI platform drivers.

Until now none of the platform drivers has used this private space, but that's about to change in the next patch of this series.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc Alan Stern <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci.h |    3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ohci.h +3 -0
index 3b58482..e2e5faa 100644
@@ -421,6 +421,9 @@ struct ohci_hcd {
 	struct dentry		*debug_periodic;
 	struct dentry		*debug_registers;
 #endif
+	/* platform-specific data -- must come last */
+	unsigned long           priv[0] __aligned(sizeof(s64));
+
 };
 
 #ifdef CONFIG_PCI
Signature · 1 line
1.7.9.5
#7 lore raw

v3 cover USB: OHCI: Splitting ohci-platform into independent driver

In reply to Manjunath Goudar

This series patch begins the process of splitting ohci-platform up into independent driver modules and add a name for the platform-private field.

Patch 1/2 separate ohci-platform into independent driver modules.

V2 to V3:
Directly Passed "hcd" argument without calling ohci_to_hcd() function.

Patch 2/2 adds an ohci->priv field for private use by OHCI platform drivers. V2 to V3:
No changes.

Manjunath Goudar (2):
USB: OHCI: make ohci-platform a separate driver
USB: OHCI: add a name for the platform-private field

 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 drivers/usb/host/ohci.h          |    3 ++
 5 files changed, 47 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH v3 1/2 USB: OHCI: make ohci-platform a separate driver

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

In V2:
-Passed "hcd" argument instead of "ohci" in ohci_setup() because it is
using "struct usb_hcd" argument.
In V3:
-Directly passed "hcd" argument not required to call ohci_to_hcd() function.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 4 files changed, 44 insertions(+), 53 deletions(-)
drivers/usb/host/Kconfig +1 -1
index a0a2f3a..5391a38 100644
@@ -501,7 +501,7 @@ config USB_CNS3XXX_OHCI
 	  It is needed for low-speed USB 1.0 device support.
 
 config USB_OHCI_HCD_PLATFORM
-	bool "Generic OHCI driver for a platform device"
+	tristate "Generic OHCI driver for a platform device"
 	default n
 	---help---
 	  Adds an OHCI host driver for a generic platform device, which
drivers/usb/host/Makefile +1 -0
index 2214ded..8a89c3d 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_ISP1362_HCD)	+= isp1362-hcd.o
 
 obj-$(CONFIG_USB_OHCI_HCD)	+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI)	+= ohci-pci.o
+obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)	+= ohci-platform.o
 
 obj-$(CONFIG_USB_UHCI_HCD)	+= uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD)	+= fhci.o
drivers/usb/host/ohci-hcd.c +1 -5
index 237be7c..39c7624 100644
@@ -1258,12 +1258,8 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER		ohci_hcd_tilegx_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_PLATFORM
-#include "ohci-platform.c"
-#define PLATFORM_DRIVER		ohci_platform_driver
-#endif
-
 #if	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PCI) &&	\
+	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM) && \
 	!defined(PLATFORM_DRIVER) &&	\
 	!defined(OMAP1_PLATFORM_DRIVER) &&	\
 	!defined(OMAP3_PLATFORM_DRIVER) &&	\
drivers/usb/host/ohci-platform.c +41 -47

118 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v3 2/2 USB: OHCI: add a name for the platform-private field

In reply to Manjunath Goudar

This patch adds an ohci->priv field for private use by OHCI platform drivers.

Until now none of the platform drivers has used this private space, but that's about to change in the next patch of this series.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc Alan Stern <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci.h |    3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ohci.h +3 -0
index 3b58482..e2e5faa 100644
@@ -421,6 +421,9 @@ struct ohci_hcd {
 	struct dentry		*debug_periodic;
 	struct dentry		*debug_registers;
 #endif
+	/* platform-specific data -- must come last */
+	unsigned long           priv[0] __aligned(sizeof(s64));
+
 };
 
 #ifdef CONFIG_PCI
Signature · 1 line
1.7.9.5
maintainer
#10 lore raw

PATCH v3 2/2 USB: OHCI: add a name for the platform-private field

Quoted 5 lines · Manjunath Goudar

This patch adds an ohci->priv field for private use by OHCI platform drivers.

Until now none of the platform drivers has used this private space, but that's about to change in the next patch of this series.

#11 lore raw

RFC PATCH 2/2 USB: OHCI: add a name for the platform-private field

In reply to Manjunath Goudar

This patch adds an ohci->priv field for private use by OHCI platform drivers.

Until now none of the platform drivers has used this private space, but that's about to change in the next patch of this series.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc Alan Stern <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci.h |    3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ohci.h +3 -0
index 3b58482..e2e5faa 100644
@@ -421,6 +421,9 @@ struct ohci_hcd {
 	struct dentry		*debug_periodic;
 	struct dentry		*debug_registers;
 #endif
+	/* platform-specific data -- must come last */
+	unsigned long           priv[0] __aligned(sizeof(s64));
+
 };
 
 #ifdef CONFIG_PCI
Signature · 1 line
1.7.9.5
maintainer
#12 lore raw

RFC PATCH 2/2 USB: OHCI: add a name for the platform-private field

Quoted 5 lines · Manjunath Goudar

This patch adds an ohci->priv field for private use by OHCI platform drivers.

Until now none of the platform drivers has used this private space, but that's about to change in the next patch of this series.

As far as I'm concerned, this doesn't need to be in a patch of its own. It can be merged into the 1/3 patch of the previous series. After all, that patch adds the extra_priv_size field in ohci_driver_overrides, which doesn't make much sense unless there's a way to refer to the private part of the ohci_hcd structure.

Alan Stern

#13 lore raw

v2 cover USB: OHCI: Splitting ohci-platform into independent driver

In reply to Manjunath Goudar

From: Manjunath Goudar <[email protected]>

This series patch begins the process of splitting ohci-platform up into independent driver modules and add a name for the platform-private field.

Patch 1/2 separate ohci-platform into independent driver modules.

V1 to V2:
Passed "hcd" argment instead of "ohci" in ohci_setup().

Patch 2/2 adds an ohci->priv field for private use by OHCI platform drivers. V1 to V2:
No changes.

Manjunath Goudar (2):
USB: OHCI: make ohci-platform a separate driver
USB: OHCI: add a name for the platform-private field

 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 drivers/usb/host/ohci.h          |    3 ++
 5 files changed, 47 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.9.5

A message that is not in the archive (sent off-list or not yet received): 1370002120-19495-1-git-send-email-y

#15 lore raw

PATCH v2 1/2 USB: OHCI: make ohci-platform a separate driver

From: Manjunath Goudar <[email protected]>

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

In V2:
-Passed "hcd" argment instead of "ohci" in ohci_setup() because it is
using "struct usb_hcd" argment.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/Kconfig         |    2 +-
 drivers/usb/host/Makefile        |    1 +
 drivers/usb/host/ohci-hcd.c      |    6 +--
 drivers/usb/host/ohci-platform.c |   88 ++++++++++++++++++--------------------
 4 files changed, 44 insertions(+), 53 deletions(-)
drivers/usb/host/Kconfig +1 -1
index a0a2f3a..5391a38 100644
@@ -501,7 +501,7 @@ config USB_CNS3XXX_OHCI
 	  It is needed for low-speed USB 1.0 device support.
 
 config USB_OHCI_HCD_PLATFORM
-	bool "Generic OHCI driver for a platform device"
+	tristate "Generic OHCI driver for a platform device"
 	default n
 	---help---
 	  Adds an OHCI host driver for a generic platform device, which
drivers/usb/host/Makefile +1 -0
index 2214ded..8a89c3d 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_USB_ISP1362_HCD)	+= isp1362-hcd.o
 
 obj-$(CONFIG_USB_OHCI_HCD)	+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI)	+= ohci-pci.o
+obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)	+= ohci-platform.o
 
 obj-$(CONFIG_USB_UHCI_HCD)	+= uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD)	+= fhci.o
drivers/usb/host/ohci-hcd.c +1 -5
index 237be7c..39c7624 100644
@@ -1258,12 +1258,8 @@ MODULE_LICENSE ("GPL");
 #define PLATFORM_DRIVER		ohci_hcd_tilegx_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_PLATFORM
-#include "ohci-platform.c"
-#define PLATFORM_DRIVER		ohci_platform_driver
-#endif
-
 #if	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PCI) &&	\
+	!IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM) && \
 	!defined(PLATFORM_DRIVER) &&	\
 	!defined(OMAP1_PLATFORM_DRIVER) &&	\
 	!defined(OMAP3_PLATFORM_DRIVER) &&	\
drivers/usb/host/ohci-platform.c +41 -47

118 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#16 lore raw

PATCH v2 1/2 USB: OHCI: make ohci-platform a separate driver

Quoted 11 lines · On Fri, 31 May 2013 manjunath.goudar at linaro.org wrote:

From: Manjunath Goudar <[email protected]>

This patch splits the ohci-platform code from ohci-hcd out into its own separate driver module.This work is part of enabling multi-platform kernels on ARM.

In V2:
-Passed "hcd" argment instead of "ohci" in ohci_setup() because it is
using "struct usb_hcd" argment.

(quoted diff) +0 -0
@@ -30,58 +42,17 @@ static int ohci_platform_reset(struct usb_hcd *hcd)

...

drivers/usb/host/ohci-platform.c static int ohci_platform_reset(struct usb_hcd *hcd) · line 48

Quoted 1 line
drivers/usb/host/ohci-platform.c +1 -0
+	return ohci_setup(ohci_to_hcd(ohci));

You don't need to use ohci_to_hcd(), because the hcd value is already a parameter in this function.

Alan Stern

#17 lore raw

PATCH v2 2/2 USB: OHCI: add a name for the platform-private field

In reply to a message not in the archive

From: Manjunath Goudar <[email protected]>

This patch adds an ohci->priv field for private use by OHCI platform drivers.

Until now none of the platform drivers has used this private space, but that's about to change in the next patch of this series.

In V2:
No changes.

Cc Arnd Bergmann <[email protected]>
Cc Greg KH <[email protected]>
Cc Alan Stern <[email protected]>
Cc linux-usb at vger.kernel.org
---
 drivers/usb/host/ohci.h |    3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/ohci.h +3 -0
index 3b58482..e2e5faa 100644
@@ -421,6 +421,9 @@ struct ohci_hcd {
 	struct dentry		*debug_periodic;
 	struct dentry		*debug_registers;
 #endif
+	/* platform-specific data -- must come last */
+	unsigned long           priv[0] __aligned(sizeof(s64));
+
 };
 
 #ifdef CONFIG_PCI
Signature · 1 line
1.7.9.5