From: Dinh Nguyen <dinguyen@xxxxxxxxxx> Hello, This patch series combines the dwc2 gadget and host driver into a single dual role driver. Here is a breakdown of what each patch does: 1/2 : usb: dwc2: Update Kconfig to support dual-role - Changes the Kconfig and Makefile to build a single dwc2.ko for all modes of operation(peripheral, host and dual-role), and only dwc2.ko is the output for both platforms that have the IP directly connected and PCI platforms. 2/12 : usb: dwc2: Moves s3c_hsotg gadget data structure into dwc2_hsotg - Adds the gadget data structure to dwc2_hsotg. Adds pointers to the dwc2 gadget structure. 3/12 : usb: dwc2: update gadget portion to use common dwc2_hsotg structure - This patch contains the bulk of the changes in this series. This patch edits the dwc2 gadget driver to use the update data pointers in the common dwc2_hsotg structure. The other changes in this patch is to provide the proper function declarations for building the driver with the 3 different modes. The last bit of change is removing the dwc2 probe function from the gadget driver, as there will be a single probe function that will be in platform.c or pci.c. 4/12 : usb: dwc2: Add DTS compatible string to dwc2_of_match_table 5/12 : usb: dwc2: Add the appropriate init calls in platform code - This patch add the appropriate init/remove function calls for the 3 different modes that the driver can operate in. 6/12 : usb: dwc2: Initialize the USB core for peripheral mode - This patch add the gadget init call when a B-Device connector cable is detected. 7/12 : usb: dwc2: Move gadget interrupts to common interrupt handler - This patch moves the dwc2 gadget interrupt handlder into the common dwc2 interrupt handler. 8/12 : usb: dwc2: gadget: Do not fail probe if there isn't a clock node - Since the dwc2 host driver is not dependent on a clock node, and the gadget driver is looking for a clock node, add a check for the clock node in the gadget driver and do not fail even if a clock node is not provided. This enables platforms(i.e.RPi) that weren't providing a clock node to still use the driver in dual-role mode. 9/12 : usb: dwc2: initialize the spin_lock for both host and gadget - Moves the spinlock init call to a common location. 10/12 : usb: dwc2: Add suspend/resume for gadget 11/12 : usb: dwc2: check that the host work queue is valid - Because the workqueue_struct was a host only feature, we should check the struct was initialized, which in peripheral it would not be. 12/12 : usb: dwc2: pci: Update pci portion of the dwc2 driver - Call the spinlock init here as it was removed from the host driver. This patch series has passed the 0-DAY kernel build testing, and every patch has been compiled tested. I tested on 2 platforms, SOCFPGA and Raspberry-Pi B. On the Raspberry-pi, I tested the driver in host and dual-role mode, but since the RPi does not have an OTG connector, only host functionality was tested. This patch series is based on v3.16-rc5. I have pushed this a git repo to make it more convenient for people to test/review. git://git.rocketboards.org/linux-socfpga-next.git dwc2_dual_role_v1 Thanks, Dinh Nguyen (12): usb: dwc2: Update Kconfig to support dual-role usb: dwc2: Moves s3c_hsotg gadget data structure into dwc2_hsotg usb: dwc2: update gadget portion to use common dwc2_hsotg structure usb: dwc2: Add DTS compatible string to dwc2_of_match_table usb: dwc2: Add the appropriate init calls in platform code usb: dwc2: Initialize the USB core for peripheral mode usb: dwc2: Move gadget interrupts to common interrupt handler usb: dwc2: gadget: Do not fail probe if there isn't a clock node usb: dwc2: initialize the spin_lock for both host and gadget usb: dwc2: Add suspend/resume for gadget usb: dwc2: check that the host work queue is valid usb: dwc2: pci: Update pci portion of the dwc2 driver drivers/usb/dwc2/Kconfig | 59 +- drivers/usb/dwc2/Makefile | 21 +- drivers/usb/dwc2/core.h | 70 ++- drivers/usb/dwc2/core_intr.c | 124 +++- drivers/usb/dwc2/gadget.c | 1431 +++++++++++++++++------------------------- drivers/usb/dwc2/hcd.c | 7 +- drivers/usb/dwc2/hcd.h | 10 - drivers/usb/dwc2/pci.c | 1 + drivers/usb/dwc2/platform.c | 58 +- 9 files changed, 877 insertions(+), 904 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html