Skip to contentSkip to conversation

usb: dwc2: Combine dwc2/s3c-hsotg into a single DRD

RFC PATCH New [email protected] 7 participants 9 messages Feb 4, 2014 – Feb 12, 2014 2 messages not in the archive

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

RFC PATCH 1/1 usb: dwc2: Combine dwc2/s3c-hsotg into a single DRD

From: Dinh Nguyen <[email protected]>

Hello,

This patch is my first attempt in combining the Synopsys DWC2 host and the s3c-hsotg peripheral into a single dual-role driver.

The patch:

* Moves the s3c-hsotg driver into the dwc2 folder.
* Adds the gadget data structure into the dwc2_hsotg data structure.
* Replace the s3c-hsotg.h defines with the hw.h defines in dwc2
* Uses the "otg" clock for both host/peripheral.
* Uses the dwc2_handle_common_intr() IRQ handler for both modes.

I have only been able to test the driver on the SOCFPGA platform, which has v2.93a of the dual-role core.

Any comments and testing would be greatly appreciated.

Thanks,

Dinh Nguyen (1):
usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD
driver.

 drivers/usb/dwc2/Kconfig                 |   35 +-
 drivers/usb/dwc2/Makefile                |    2 +
 drivers/usb/dwc2/core.c                  |    1 +
 drivers/usb/dwc2/core.h                  |  173 ++-
 drivers/usb/dwc2/core_intr.c             |  134 ++-
 drivers/usb/dwc2/hcd.c                   |    7 +-
 drivers/usb/dwc2/hcd.h                   |    1 +
 drivers/usb/dwc2/hw.h                    |   23 +-
 drivers/usb/dwc2/platform.c              |   49 +-
 drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1835 ++++++++++++------------------
 drivers/usb/gadget/Kconfig               |    7 -
 drivers/usb/gadget/Makefile              |    1 -
 drivers/usb/gadget/s3c-hsotg.h           |  378 ------
 13 files changed, 1088 insertions(+), 1558 deletions(-)
 rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%)
 delete mode 100644 drivers/usb/gadget/s3c-hsotg.h

---
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Paul Zimmerman <paulz-HKixBCOQz3hWk0Htik3J/[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Matt Porter <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Matthijs Kooijman <[email protected]>
Cc: Fengguang Wu <[email protected]>
Cc: Dan Carpenter <[email protected]>
Cc: Wei Yongjun <[email protected]>
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/[email protected]>
Cc: Yijing Wang <[email protected]>
Cc: Ray Jui <rjui-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc: Julien Delacou <julien.delacou-0IS4wlFg1OjSUeElwK9/[email protected]>
Cc: Dom Cobley <[email protected]>
Cc: Rashika Kheria <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: Sachin Kamat <[email protected]>
Cc: Robert Baldyga <[email protected]>
Cc: Kishon Vijay Abraham I <[email protected]>

Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1391550341-32509-1-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org

#2 lore raw

RFC PATCH 1/1 usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

This commit:
- Replaces in the defines used in s3c_hsotg.h with the defines used in the dwc2 hw.h defines.
- Use the dw2_hsotg as the unified data structure for the host/gadget.
- Uses the dwc2 IRQ handler for host/gadget.
- A single spinlock.

Cc Greg Kroah-Hartman <[email protected]>
Cc Paul Zimmerman <paulz-HKixBCOQz3hWk0Htik3J/[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Matt Porter <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Matthijs Kooijman <[email protected]>
Cc Fengguang Wu <[email protected]>
Cc Dan Carpenter <[email protected]>
Cc Wei Yongjun <[email protected]>
Cc Wolfram Sang <wsa-z923LK4zBo2bacvFa/[email protected]>
Cc Yijing Wang <[email protected]>
Cc Ray Jui <rjui-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Julien Delacou <julien.delacou-0IS4wlFg1OjSUeElwK9/[email protected]>
Cc Dom Cobley <[email protected]>
Cc Rashika Kheria <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Sachin Kamat <[email protected]>
Cc Robert Baldyga <[email protected]>
Cc Kishon Vijay Abraham I <[email protected]>
---
 drivers/usb/dwc2/Kconfig                 |   35 +-
 drivers/usb/dwc2/Makefile                |    2 +
 drivers/usb/dwc2/core.c                  |    1 +
 drivers/usb/dwc2/core.h                  |  173 ++-
 drivers/usb/dwc2/core_intr.c             |  134 ++-
 drivers/usb/dwc2/hcd.c                   |    7 +-
 drivers/usb/dwc2/hcd.h                   |    1 +
 drivers/usb/dwc2/hw.h                    |   23 +-
 drivers/usb/dwc2/platform.c              |   49 +-
 drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1835 ++++++++++++------------------
 drivers/usb/gadget/Kconfig               |    7 -
 drivers/usb/gadget/Makefile              |    1 -
 drivers/usb/gadget/s3c-hsotg.h           |  378 ------
 13 files changed, 1088 insertions(+), 1558 deletions(-)
 rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%)
 delete mode 100644 drivers/usb/gadget/s3c-hsotg.h
drivers/usb/dwc2/Kconfig +29 -6
index be947d6..27a3a69 100644
@@ -12,14 +12,37 @@ config USB_DWC2
 	  (for controllers directly connected to the CPU) will be called
 	  dwc2_platform.ko.
 
-	  NOTE: This driver at present only implements the Host mode
-	  of the controller. The existing s3c-hsotg driver supports
-	  Peripheral mode, but only for the Samsung S3C platforms.
-	  There are plans to merge the s3c-hsotg driver with this
-	  driver in the near future to create a dual-role driver.
-
 if USB_DWC2
 
+choice
+	bool "DWC2 Mode Selection"
+	default USB_DWC2_DUAL_ROLE if (USB && USB_GADGET)
+	default USB_DWC2_HOST if (USB && !USB_GADGET)
+	default USB_DWC2_GADGET if (!USB && USB_GADGET)
+
+config USB_DWC2_HOST
+	bool "Host only mode"
+	depends on USB=y || USB=USB_DWC2
+	help
+	  Select this when you want to use DWC2 in host mode only,
+	  thereby the gadget feature will be regressed.
+
+config USB_DWC2_GADGET
+	bool "Gadget only mode"
+	depends on USB_GADGET=y || USB_GADGET=USB_DWC2
+	help
+	  Select this when you want to use DWC2 in gadget mode only,
+	  thereby the host feature will be regressed.
+
+config USB_DWC2_DUAL_ROLE
+	bool "Dual Role mode"
+	depends on ((USB=y || USB=USB_DWC2) && (USB_GADGET=y || USB_GADGET=USB_DWC2))
+	help
+	  This is the default mode of working of DWC2 controller where
+	  both host and gadget features are enabled.
+
+endchoice
+
 config USB_DWC2_DEBUG
 	bool "Enable Debugging Messages"
 	help
drivers/usb/dwc2/Makefile +2 -0
index 11529d3..4d147ad 100644
@@ -16,6 +16,8 @@ dwc2-y					+= core.o core_intr.o
 dwc2-y					+= hcd.o hcd_intr.o
 dwc2-y					+= hcd_queue.o hcd_ddma.o
 
+dwc2-y					+= s3c-hsotg.o
+
 ifneq ($(CONFIG_PCI),)
 	obj-$(CONFIG_USB_DWC2)		+= dwc2_pci.o
 endif
drivers/usb/dwc2/core.c +1 -0
index 1d12988..12e9465 100644
@@ -467,6 +467,7 @@ int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy, int irq)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(dwc2_core_init);
 
 /**
  * dwc2_enable_host_interrupts() - Enables the Host mode interrupts
drivers/usb/dwc2/core.h +172 -1

210 lines not on this page · raw message

drivers/usb/dwc2/core_intr.c +117 -17

205 lines not on this page · raw message

drivers/usb/dwc2/hcd.c +1 -6
index f59484d..2e949ef 100644
@@ -1355,6 +1355,7 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
 		hsotg->op_state = OTG_STATE_B_PERIPHERAL;
 		dwc2_core_init(hsotg, false, -1);
 		dwc2_enable_global_interrupts(hsotg);
+		s3c_hsotg_core_init(hsotg);
 	} else {
 		/* A-Device connector (Host Mode) */
 		dev_dbg(hsotg->dev, "connId A\n");
@@ -2798,11 +2799,6 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
 		goto error1;
 	hsotg->last_frame_num = HFNUM_MAX_FRNUM;
 #endif
-
-	hsotg->core_params = kzalloc(sizeof(*hsotg->core_params), GFP_KERNEL);
-	if (!hsotg->core_params)
-		goto error1;
-
 	dwc2_set_all_params(hsotg->core_params, -1);
 
 	/* Validate parameter values */
@@ -2834,7 +2830,6 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
 
 	hcd->has_tt = 1;
 
-	spin_lock_init(&hsotg->lock);
 	((struct wrapper_priv_data *) &hcd->hcd_priv)->hsotg = hsotg;
 	hsotg->priv = hcd;
 
drivers/usb/dwc2/hcd.h +1 -0
index fdc6d48..c8884f8 100644
@@ -449,6 +449,7 @@ static inline u8 dwc2_hcd_is_pipe_out(struct dwc2_hcd_pipe_info *pipe)
 	return !dwc2_hcd_is_pipe_in(pipe);
 }
 
+int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq);
 extern int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
 			 const struct dwc2_core_params *params);
 extern void dwc2_hcd_remove(struct dwc2_hsotg *hsotg);
drivers/usb/dwc2/hw.h +14 -9
index 9c92a3c..d3ae043 100644
@@ -109,6 +109,7 @@
 #define GUSBCFG_FSINTF			(1 << 5)
 #define GUSBCFG_ULPI_UTMI_SEL		(1 << 4)
 #define GUSBCFG_PHYIF16			(1 << 3)
+#define GUSBCFG_PHYIF8			(0 << 3)
 #define GUSBCFG_TOUTCAL_MASK		(0x7 << 0)
 #define GUSBCFG_TOUTCAL_SHIFT		0
 #define GUSBCFG_TOUTCAL_LIMIT		0x7
@@ -169,14 +170,14 @@
 #define GRXSTS_FN_SHIFT			25
 #define GRXSTS_PKTSTS_MASK		(0xf << 17)
 #define GRXSTS_PKTSTS_SHIFT		17
-#define GRXSTS_PKTSTS_GLOBALOUTNAK	1
-#define GRXSTS_PKTSTS_OUTRX		2
+#define GRXSTS_PKTSTS_GLOBALOUTNAK	(0x1 << 17)
+#define GRXSTS_PKTSTS_OUTRX		(0x2 << 17)
 #define GRXSTS_PKTSTS_HCHIN		2
-#define GRXSTS_PKTSTS_OUTDONE		3
+#define GRXSTS_PKTSTS_OUTDONE		(0x3 << 17)
 #define GRXSTS_PKTSTS_HCHIN_XFER_COMP	3
-#define GRXSTS_PKTSTS_SETUPDONE		4
+#define GRXSTS_PKTSTS_SETUPDONE		(0x4 << 17)
 #define GRXSTS_PKTSTS_DATATOGGLEERR	5
-#define GRXSTS_PKTSTS_SETUPRX		6
+#define GRXSTS_PKTSTS_SETUPRX		(0x6 << 17)
 #define GRXSTS_PKTSTS_HCHHALTED		7
 #define GRXSTS_HCHNUM_MASK		(0xf << 0)
 #define GRXSTS_HCHNUM_SHIFT		0
@@ -403,6 +404,9 @@
 #define FIFOSIZE_DEPTH_SHIFT		16
 #define FIFOSIZE_STARTADDR_MASK		(0xffff << 0)
 #define FIFOSIZE_STARTADDR_SHIFT	0
+#define DPTXFSIZN_DPTXFSIZE_GET(_v)	(((_v) >> 16) & 0xffff)
+#define DPTXFSIZN_DPTXFSIZE(_x)		((_x) << 16)
+#define DPTXFSIZN_DPTXFADDR(_x)		((_x) << 0)
 
 /* Device mode registers */
 
@@ -520,10 +524,11 @@
 #define DXEPCTL_SNP			(1 << 20)
 #define DXEPCTL_EPTYPE_MASK		(0x3 << 18)
 #define DXEPCTL_EPTYPE_SHIFT		18
-#define DXEPCTL_EPTYPE_CONTROL		0
-#define DXEPCTL_EPTYPE_ISO		1
-#define DXEPCTL_EPTYPE_BULK		2
-#define DXEPCTL_EPTYPE_INTTERUPT	3
+#define DXEPCTL_EPTYPE_CONTROL		(0x0 << 18)
+#define DXEPCTL_EPTYPE_ISO		(0x1 << 18)
+#define DXEPCTL_EPTYPE_BULK		(0x2 << 18)
+#define DXEPCTL_EPTYPE_INTERRUPT	(0x3 << 18)
+
 #define DXEPCTL_NAKSTS			(1 << 17)
 #define DXEPCTL_DPID			(1 << 16)
 #define DXEPCTL_EOFRNUM			(1 << 16)
drivers/usb/dwc2/platform.c +44 -5

88 lines not on this page · raw message

drivers/usb/dwc2/s3c-hsotg.c renamed from drivers/usb/gadget/s3c-hsotg.c +707 -1128

2,357 lines not on this page · raw message

drivers/usb/gadget/Kconfig +0 -7
index 8154165..ca04ae6 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/Makefile +0 -1
index 5f150bc..49514ea 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/s3c-hsotg.h deleted +0 -376

376 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

A message that is not in the archive (sent off-list or not yet received): 1391550341-32509-2-git-send-email-dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org

#4 lore raw

RE: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

Quoted 9 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, February 04, 2014 1:46 PM

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Quoted 6 lines

This commit:
- Replaces in the defines used in s3c_hsotg.h with the defines used in the dwc2 hw.h defines.
- Use the dw2_hsotg as the unified data structure for the host/gadget.
- Uses the dwc2 IRQ handler for host/gadget.
- A single spinlock.

Hi Dinh,

Putting all of these changes into a single patch makes them unreviewable as far I am concerned. You need to break this into a series of smaller patches. I would suggest something like this:

1 of n: Make the minimum changes to the dwc2 header files needed to
support s3c-hsotg as a standalone driver.
2 of n: Make the spelling changes to s3c-hsotg.c needed to use the dwc2
headers, and move it to the dwc2/ directory. Make the Kconfig and Makefile changes needed for the move. Delete s3c-hsotg.h.
3 of n: Move the struct defines etc. from s3c-hsotg.c to the dwc2
header files.
.. of n: Make the changes required to combine the functionality of
both drivers into one. Preferably this would also be a series of patches instead of one big one.

At each step of the series, both drivers should still compile and work.

Also, please follow the patch style used on the linux lists. 'git format-patch --cover-letter' should do most of this for you automatically.

And you should probably trim the Cc list to something more reasonable.

Signature · 6 lines
Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

RE: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

Quoted 33 lines · Paul Zimmerman
Quoted 9 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, February 04, 2014 1:46 PM

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Quoted 6 lines

This commit:
- Replaces in the defines used in s3c_hsotg.h with the defines used in the dwc2 hw.h defines.
- Use the dw2_hsotg as the unified data structure for the host/gadget.
- Uses the dwc2 IRQ handler for host/gadget.
- A single spinlock.

Hi Dinh,

Putting all of these changes into a single patch makes them unreviewable as far I am concerned. You need to break this into a series of smaller patches. I would suggest something like this:

1 of n: Make the minimum changes to the dwc2 header files needed to
support s3c-hsotg as a standalone driver.
2 of n: Make the spelling changes to s3c-hsotg.c needed to use the dwc2
headers, and move it to the dwc2/ directory. Make the Kconfig and Makefile changes needed for the move. Delete s3c-hsotg.h.
3 of n: Move the struct defines etc. from s3c-hsotg.c to the dwc2
header files.
.. of n: Make the changes required to combine the functionality of
both drivers into one. Preferably this would also be a series of patches instead of one big one.

Quoted 1 line

At each step of the series, both drivers should still compile and work.

I agree. My original thought was to also split this patch, but I just didn't know how to split it. This is why I designated as an RFC. I was really looking for feedback as this is the correct way to combine this driver. I was also looking for testing purpose to make sure I did not break anything for the s3c platform.

Quoted 4 lines

Also, please follow the patch style used on the linux lists. 'git format-patch --cover-letter' should do most of this for you automatically.

I did use --cover-letter on this patch series.

Quoted 2 lines

And you should probably trim the Cc list to something more reasonable.

I looked through all the commits for the dwc2 driver for the cc list. I also CC a bunch of the Samsung people as I figured that the biggest impact of the work would affect the s3c folks.

Dinh

#6 lore raw

RE: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

Quoted 37 lines

From: Dinh Nguyen [mailto:[email protected]]
Sent: Tuesday, February 04, 2014 10:14 PM

Quoted 33 lines · Paul Zimmerman
Quoted 9 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, February 04, 2014 1:46 PM

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Quoted 6 lines

This commit:
- Replaces in the defines used in s3c_hsotg.h with the defines used in the dwc2 hw.h defines.
- Use the dw2_hsotg as the unified data structure for the host/gadget.
- Uses the dwc2 IRQ handler for host/gadget.
- A single spinlock.

Hi Dinh,

Putting all of these changes into a single patch makes them unreviewable as far I am concerned. You need to break this into a series of smaller patches. I would suggest something like this:

1 of n: Make the minimum changes to the dwc2 header files needed to
support s3c-hsotg as a standalone driver.
2 of n: Make the spelling changes to s3c-hsotg.c needed to use the dwc2
headers, and move it to the dwc2/ directory. Make the Kconfig and Makefile changes needed for the move. Delete s3c-hsotg.h.
3 of n: Move the struct defines etc. from s3c-hsotg.c to the dwc2
header files.
.. of n: Make the changes required to combine the functionality of
both drivers into one. Preferably this would also be a series of patches instead of one big one.

Quoted 7 lines
Quoted 1 line

At each step of the series, both drivers should still compile and work.

I agree. My original thought was to also split this patch, but I just didn't know how to split it. This is why I designated as an RFC. I was really looking for feedback as this is the correct way to combine this driver. I was also looking for testing purpose to make sure I did not break anything for the s3c platform.

The problem is, it's almost impossible to see what the functional changes are because of all the noise of the other changes.

Quoted 5 lines
Quoted 4 lines

Also, please follow the patch style used on the linux lists. 'git format-patch --cover-letter' should do most of this for you automatically.

Quoted 8 lines

I did use --cover-letter on this patch series.

Quoted 2 lines

And you should probably trim the Cc list to something more reasonable.

I looked through all the commits for the dwc2 driver for the cc list. I also CC a bunch of the Samsung people as I figured that the biggest impact of the work would affect the s3c folks.

I would suggest just CCing the Samsung folks to start with, since s3c-hsotg is a driver for their hardware. And the linux-usb and linux-samsung-soc lists.

Signature · 1 line
Paul
#7 lore raw

Re: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

Quoted 37 lines · Paul Zimmerman
Quoted 36 lines · Dinh Nguyen
Quoted 34 lines · Paul Zimmerman
Quoted 9 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, February 04, 2014 1:46 PM

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Quoted 6 lines

This commit:
- Replaces in the defines used in s3c_hsotg.h with the defines used in the dwc2 hw.h defines.
- Use the dw2_hsotg as the unified data structure for the host/gadget.
- Uses the dwc2 IRQ handler for host/gadget.
- A single spinlock.

Hi Dinh,

Putting all of these changes into a single patch makes them unreviewable as far I am concerned. You need to break this into a series of smaller patches. I would suggest something like this:

1 of n: Make the minimum changes to the dwc2 header files needed to
support s3c-hsotg as a standalone driver.
2 of n: Make the spelling changes to s3c-hsotg.c needed to use the dwc2
headers, and move it to the dwc2/ directory. Make the Kconfig and Makefile changes needed for the move. Delete s3c-hsotg.h.
3 of n: Move the struct defines etc. from s3c-hsotg.c to the dwc2
header files.
.. of n: Make the changes required to combine the functionality of
both drivers into one. Preferably this would also be a series of patches instead of one big one.

At each step of the series, both drivers should still compile and work.

Quoted 8 lines
Quoted 5 lines

I agree. My original thought was to also split this patch, but I just didn't know how to split it. This is why I designated as an RFC. I was really looking for feedback as this is the correct way to combine this driver. I was also looking for testing purpose to make sure I did not break anything for the s3c platform.

The problem is, it's almost impossible to see what the functional changes are because of all the noise of the other changes.

Yes, right. I think so, too.

Quoted 11 lines
Quoted 11 lines
Quoted 5 lines

Also, please follow the patch style used on the linux lists. 'git format-patch --cover-letter' should do most of this for you automatically.

I did use --cover-letter on this patch series.

Quoted 2 lines

And you should probably trim the Cc list to something more reasonable.

Quoted 7 lines
Quoted 3 lines

I looked through all the commits for the dwc2 driver for the cc list. I also CC a bunch of the Samsung people as I figured that the biggest impact of the work would affect the s3c folks.

I would suggest just CCing the Samsung folks to start with, since s3c-hsotg is a driver for their hardware. And the linux-usb and linux-samsung-soc lists.

Please keep CCing linux-samsung-soc. Some Samsung folks will test the patches with Samsung hardware. Thank you.

Best regards,
Jingoo Han

#8 lore raw

Re: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

In reply to a message not in the archive
Quoted 5 lines · On 02/04/2014 02:45 PM, [email protected] wrote:

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Sorry for the slow response. When building ARCH=arm bcm2835_defconfig, I get build errors:

Quoted 5 lines

drivers/built-in.o: In function `dwc2_gadget_init':
drivers/usb/dwc2/s3c-hsotg.c:3335: undefined reference to usb_add_gadget_udc' drivers/built-in.o: In function s3c_hsotg_remove':
drivers/usb/dwc2/s3c-hsotg.c:3358: undefined reference to usb_del_gadget_udc' drivers/usb/dwc2/s3c-hsotg.c:3364: undefined reference to usb_gadget_unregister_driver'

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw

Re: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

Quoted 15 lines · Stephen Warren
Quoted 5 lines · On 02/04/2014 02:45 PM, [email protected] wrote:

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Sorry for the slow response. When building ARCH=arm bcm2835_defconfig, I get build errors:

Quoted 5 lines

drivers/built-in.o: In function `dwc2_gadget_init':
drivers/usb/dwc2/s3c-hsotg.c:3335: undefined reference to usb_add_gadget_udc' drivers/built-in.o: In function s3c_hsotg_remove':
drivers/usb/dwc2/s3c-hsotg.c:3358: undefined reference to usb_del_gadget_udc' drivers/usb/dwc2/s3c-hsotg.c:3364: undefined reference to usb_gadget_unregister_driver'

These errors happen when CONFIG_USB_GADGET=n. 's3c-hsotg.c' supports only gadget mode. In the case of USB_DWC2_HOST mode, CONFIG_USB_GADGET is NOT enabled. I don't know how to solve it.

Best regards,
Jingoo Han

#10 lore raw

Re: [RFC PATCHv1] usb: dwc2: Combine the dwc2 and s3c_hsotg into a single USB DRD driver.

Quoted 9 lines · Jingoo Han
Quoted 8 lines · Stephen Warren
Quoted 5 lines · On 02/04/2014 02:45 PM, [email protected] wrote:

From: Dinh Nguyen <[email protected]>

This means that the driver can be in host or peripheral mode when the appropriate connector is used. When an A-cable is plugged in, the driver behaves in host mode, and when a B-cable is used, the driver will be in peripheral mode.

Sorry for the slow response. When building ARCH=arm bcm2835_defconfig, I get build errors:

Thanks for testing.

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines

drivers/built-in.o: In function `dwc2_gadget_init':
drivers/usb/dwc2/s3c-hsotg.c:3335: undefined reference to usb_add_gadget_udc' drivers/built-in.o: In function s3c_hsotg_remove':
drivers/usb/dwc2/s3c-hsotg.c:3358: undefined reference to usb_del_gadget_udc' drivers/usb/dwc2/s3c-hsotg.c:3364: undefined reference to usb_gadget_unregister_driver'

These errors happen when CONFIG_USB_GADGET=n. 's3c-hsotg.c' supports only gadget mode. In the case of USB_DWC2_HOST mode, CONFIG_USB_GADGET is NOT enabled. I don't know how to solve it.

I'm working on v2 of this patch. I think I can make the Kconfig more flexible by selecting
USB_GADGET for dual-role or gadget. Or I can make the new driver more independent
for the various modes, meaning if the driver is built for HOST mode, it shouldn't be dependent
on gadget functions.

Dinh

Quoted 4 lines

Best regards,
Jingoo Han