Skip to contentSkip to conversation

usb: dwc3: use extcon fwrk to receive connect/disconnect

PATCH In review Kishon Vijay Abraham I 3 participants 3 messages Jul 15, 2013

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

PATCH v6 1/1 usb: dwc3: use extcon fwrk to receive connect/disconnect

Modified dwc3-omap to receive connect and disconnect notification using extcon framework. Also did the necessary cleanups required after adapting to extcon framework.

---
This patch should be applied after all of the extcon patchset will be applied because this patch has dependency of extcon patch related to DT.
http://goo.gl/Tu3qW

Changes from v5:
* rebased to 3.11-rc1
Changes from v4:
* checked the return values of extcon_register_interest and print an error message. Note that I dint do return since there might be cases where one of USB (device mode) or USB-HOST (host mode) might succeed.
* Added depends on of EXTCON in usb_dwc3. Only some platforms might be using EXTCON, but inorder to avoid compilation errors, added depends on
Changes from v3:
* did #include of of_extcon.h after Chanwoo resent the patch separating extcon-class.c from of_extcon.c
Changes from v2:
* updated the Documentation with dwc3 dt binding information.
* used of_extcon_get_extcon_dev to get extcon device from device tree data. Changes from v1:
* regulator enable/disable is now done here instead of palmas-usb as some users of palmas-usb wont need regulator.

 Documentation/devicetree/bindings/usb/omap-usb.txt |    5 +
 drivers/usb/dwc3/Kconfig                           |    1 +
 drivers/usb/dwc3/dwc3-omap.c                       |  125 +++++++++++++++++---
 3 files changed, 112 insertions(+), 19 deletions(-)
Documentation/devicetree/bindings/usb/omap-usb.txt +5 -0
index 57e71f6..9088ab0 100644
@@ -53,6 +53,11 @@ OMAP DWC3 GLUE
    It should be set to "1" for HW mode and "2" for SW mode.
  - ranges: the child address space are mapped 1:1 onto the parent address space
 
+Optional Properties:
+ - extcon : phandle for the extcon device omap dwc3 uses to detect
+   connect/disconnect events.
+ - vbus-supply : phandle to the regulator device tree node if needed.
+
 Sub-nodes:
 The dwc3 core should be added as subnode to omap dwc3 glue.
 - dwc3 :
drivers/usb/dwc3/Kconfig +1 -0
index 757aa18..08a9fab 100644
@@ -1,6 +1,7 @@
 config USB_DWC3
 	tristate "DesignWare USB3 DRD Core Support"
 	depends on (USB || USB_GADGET) && GENERIC_HARDIRQS
+	depends on EXTCON
 	select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
 	help
 	  Say Y or M here if your system has a Dual Role SuperSpeed
drivers/usb/dwc3/dwc3-omap.c +106 -19

215 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 56 lines · Kishon Vijay Abraham I

Modified dwc3-omap to receive connect and disconnect notification using extcon framework. Also did the necessary cleanups required after adapting to extcon framework.

---
This patch should be applied after all of the extcon patchset will be applied because this patch has dependency of extcon patch related to DT.
http://goo.gl/Tu3qW

Changes from v5:
* rebased to 3.11-rc1
Changes from v4:
* checked the return values of extcon_register_interest and print an error message. Note that I dint do return since there might be cases where one of USB (device mode) or USB-HOST (host mode) might succeed.
* Added depends on of EXTCON in usb_dwc3. Only some platforms might be using EXTCON, but inorder to avoid compilation errors, added depends on
Changes from v3:
* did #include of of_extcon.h after Chanwoo resent the patch separating extcon-class.c from of_extcon.c
Changes from v2:
* updated the Documentation with dwc3 dt binding information.
* used of_extcon_get_extcon_dev to get extcon device from device tree data. Changes from v1:
* regulator enable/disable is now done here instead of palmas-usb as some users of palmas-usb wont need regulator.

 Documentation/devicetree/bindings/usb/omap-usb.txt |    5 +
 drivers/usb/dwc3/Kconfig                           |    1 +
 drivers/usb/dwc3/dwc3-omap.c                       |  125 +++++++++++++++++---
 3 files changed, 112 insertions(+), 19 deletions(-)
Documentation/devicetree/bindings/usb/omap-usb.txt +5 -0
index 57e71f6..9088ab0 100644
@@ -53,6 +53,11 @@ OMAP DWC3 GLUE
    It should be set to "1" for HW mode and "2" for SW mode.
  - ranges: the child address space are mapped 1:1 onto the parent address space
 
+Optional Properties:
+ - extcon : phandle for the extcon device omap dwc3 uses to detect
+   connect/disconnect events.
+ - vbus-supply : phandle to the regulator device tree node if needed.
+
 Sub-nodes:
 The dwc3 core should be added as subnode to omap dwc3 glue.
 - dwc3 :
drivers/usb/dwc3/Kconfig +0 -0
index 757aa18..08a9fab 100644

drivers/usb/dwc3/Kconfig line 4

Quoted 4 lines
drivers/usb/dwc3/Kconfig +1 -0
@@ -1,6 +1,7 @@
 config USB_DWC3
 	tristate "DesignWare USB3 DRD Core Support"
 	depends on (USB || USB_GADGET) && GENERIC_HARDIRQS
+	depends on EXTCON

can you rebase this on top of 'testing' branch. I have a patch there which give glue layers their own Kconfig symbols. If you do that, I can queue this patch myself for v3.12, unless we have dependencies on other patches which aren't in mainline, in which case, I'd ask to simply remove this Kconfig change for now.

Signature · 1 line
balbi
#2 lore raw
Quoted 59 lines · Felipe Balbi
Quoted 58 lines · Kishon Vijay Abraham I

Modified dwc3-omap to receive connect and disconnect notification using extcon framework. Also did the necessary cleanups required after adapting to extcon framework.

---
This patch should be applied after all of the extcon patchset will be applied because this patch has dependency of extcon patch related to DT.
http://goo.gl/Tu3qW

Changes from v5:
* rebased to 3.11-rc1
Changes from v4:
* checked the return values of extcon_register_interest and print an error message. Note that I dint do return since there might be cases where one of USB (device mode) or USB-HOST (host mode) might succeed.
* Added depends on of EXTCON in usb_dwc3. Only some platforms might be using EXTCON, but inorder to avoid compilation errors, added depends on
Changes from v3:
* did #include of of_extcon.h after Chanwoo resent the patch separating extcon-class.c from of_extcon.c
Changes from v2:
* updated the Documentation with dwc3 dt binding information.
* used of_extcon_get_extcon_dev to get extcon device from device tree data. Changes from v1:
* regulator enable/disable is now done here instead of palmas-usb as some users of palmas-usb wont need regulator.

 Documentation/devicetree/bindings/usb/omap-usb.txt |    5 +
 drivers/usb/dwc3/Kconfig                           |    1 +
 drivers/usb/dwc3/dwc3-omap.c                       |  125 +++++++++++++++++---
 3 files changed, 112 insertions(+), 19 deletions(-)
Documentation/devicetree/bindings/usb/omap-usb.txt +5 -0
index 57e71f6..9088ab0 100644
@@ -53,6 +53,11 @@ OMAP DWC3 GLUE
    It should be set to "1" for HW mode and "2" for SW mode.
  - ranges: the child address space are mapped 1:1 onto the parent address space
 
+Optional Properties:
+ - extcon : phandle for the extcon device omap dwc3 uses to detect
+   connect/disconnect events.
+ - vbus-supply : phandle to the regulator device tree node if needed.
+
 Sub-nodes:
 The dwc3 core should be added as subnode to omap dwc3 glue.
 - dwc3 :
drivers/usb/dwc3/Kconfig +0 -0
index 757aa18..08a9fab 100644
@@ -1,6 +1,7 @@
 config USB_DWC3
 	tristate "DesignWare USB3 DRD Core Support"
Quoted 9 lines

drivers/usb/dwc3/Kconfig line 4

Quoted 2 lines
drivers/usb/dwc3/Kconfig +1 -0
 	depends on (USB || USB_GADGET) && GENERIC_HARDIRQS
+	depends on EXTCON

can you rebase this on top of 'testing' branch. I have a patch there which give glue layers their own Kconfig symbols. If you do that, I can queue this patch myself for v3.12, unless we have dependencies on other patches which aren't in mainline, in which case, I'd ask to simply remove this Kconfig change for now.

Dear Felipe and Kishon,

We have some confusion about applying this patch.

I already applied this patch on extcon-next branch for v3.12. This patch has the dependency on below extcon patch. [PATCH] usb: dwc3: use extcon fwrk to receive connect/disconnect
- http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-next&id=68517aac722c8c3e0c153b3ede40aace25cb66fa
[PATCH] extcon: Add an API to get extcon device from dt node
- http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-next&id=cb28faede03de7abe82336c3648771a01f5fe225

If Felipe would apply this patch usb.git for v3.12, I think you should include extcon patch together.
[PATCH] extcon: Add an API to get extcon device from dt node
- http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-next&id=cb28faede03de7abe82336c3648771a01f5fe225

The dependency related to patch cause this confusion. What is your opinion?

Thanks,
Chanwoo Choi