All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/19] dwc3: add USB OTG role switch support
@ 2015-03-18 14:04 Robert Baldyga
  2015-03-18 14:04 ` [RFC 01/19] extcon: add extcon-odroid-usbotg driver Robert Baldyga
                   ` (19 more replies)
  0 siblings, 20 replies; 32+ messages in thread
From: Robert Baldyga @ 2015-03-18 14:04 UTC (permalink / raw)
  To: balbi
  Cc: gregkh, myungjoo.ham, cw00.choi, linux-usb, linux-kernel,
	m.szyprowski, Robert Baldyga

Hello,

This patchset introduces OTG feature in DWC3 DRD driver. This allows
to change dynamically between host and peripheral mode depending on
detected USB cable type.

DWC3 driver behaviour is changed only in situation when selected operation
mode (dr_mode) is "otg", and hardware OTG support is available or extended
OTG operations are supplied for given platform.

It such conditions are fulfilled, none of modes is enabled by default
and dwc3 core Best regards,
Robert Baldygais being uninitialized. After USB cable detection relevant
mode is selected and dwc3 core is initialized. Cable disconnection causes
deinitialization of dwc3 core.

File otg.c is inspired by code of DWC3 driver from Hardkernel linux
sources [1]. I have never tested it on DWC3 version equipped with hardware
OTG support, but I belive that this code have chance to work or at least
it's easy to fix. I have tested this on OdroidXU3 board which has USB
cable detection mechanism based on two gpio pins. I used extcon driver
for those feature, which is also attached to following patchset.

I consider if ext_otg_ops it the right solution. Current solution is
based on Hardkernel sources, but it's very likely that adding extcon
support directly to otg.c would be generic enough, as most of cable
detection mechanisms can be simply represented by extcon devices.

Thanks in advance for your comments.

Best regards,
Robert Baldyga

[1] https://github.com/hardkernel/linux

Robert Baldyga (19):
  extcon: add extcon-odroid-usbotg driver
  dt-bindings: extcon: Add doc for extcon-odroid-usbotg
  ARM: dts: exynos5422-odroidxu3: add odroid-usbotg extcon support
  dwc3: gadget: add VBUS session handling
  dwc3: gadget: enable/disable ep0 in dwc3_gadget_run_stop()
  dwc3: gadget: check returned value in suspend/resume
  dwc3: core: cleanup suspend/resume code
  dwc3: core: handle event buffers in core_init/exit
  dwc3: core: make dwc3_core_init/exit non-static
  dwc3: add missing OTG register definitions
  dwc3: add OTG handling code
  dwc3: otg: add ext_otg_ops support
  dwc3: gadget: register gadget in OTG core
  dwc3: host: don't add XHCI device only if in OTG mode
  dwc3: core: initialize OTG in DWC3 core
  dwc3: exynos: add software role switching code
  ARM: dts: exynos5420: set usb3_lpm_capable in dwc3 controllers
  ARM: dts: exynos5420: add snps,dis_u3_susphy_quirk to dwc3 controllers
  ARM: dts: exynos5422-odroidxu3: make usbdrd3 extcon client

 .../bindings/extcon/extcon-odroid-usbotg.txt       |  16 +
 .../devicetree/bindings/usb/exynos-usb.txt         |   4 +
 arch/arm/boot/dts/exynos5420.dtsi                  |   6 +
 arch/arm/boot/dts/exynos5422-odroidxu3.dts         |  24 +
 drivers/extcon/Kconfig                             |   4 +
 drivers/extcon/Makefile                            |   1 +
 drivers/extcon/extcon-odroid-usbotg.c              | 257 +++++++++
 drivers/usb/dwc3/Kconfig                           |   1 +
 drivers/usb/dwc3/Makefile                          |   4 +
 drivers/usb/dwc3/core.c                            |  66 ++-
 drivers/usb/dwc3/core.h                            |  22 +
 drivers/usb/dwc3/dwc3-exynos.c                     | 162 ++++++
 drivers/usb/dwc3/gadget.c                          | 106 ++--
 drivers/usb/dwc3/host.c                            |  10 +-
 drivers/usb/dwc3/otg.c                             | 577 +++++++++++++++++++++
 drivers/usb/dwc3/otg.h                             | 113 ++++
 16 files changed, 1320 insertions(+), 53 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/extcon/extcon-odroid-usbotg.txt
 create mode 100644 drivers/extcon/extcon-odroid-usbotg.c
 create mode 100644 drivers/usb/dwc3/otg.c
 create mode 100644 drivers/usb/dwc3/otg.h

-- 
1.9.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-03-20  8:51 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18 14:04 [RFC 00/19] dwc3: add USB OTG role switch support Robert Baldyga
2015-03-18 14:04 ` [RFC 01/19] extcon: add extcon-odroid-usbotg driver Robert Baldyga
2015-03-19  8:50   ` George Cherian
2015-03-19 12:07     ` Robert Baldyga
2015-03-19 12:19       ` George Cherian
2015-03-19 14:45         ` Roger Quadros
2015-03-19 20:50           ` Chanwoo Choi
2015-03-20  7:25             ` Robert Baldyga
2015-03-20  7:45               ` Chanwoo Choi
2015-03-20  8:51                 ` Roger Quadros
2015-03-18 14:04 ` [RFC 02/19] dt-bindings: extcon: Add doc for extcon-odroid-usbotg Robert Baldyga
2015-03-18 14:04 ` [RFC 03/19] ARM: dts: exynos5422-odroidxu3: add odroid-usbotg extcon support Robert Baldyga
2015-03-18 14:04 ` [RFC 04/19] dwc3: gadget: add VBUS session handling Robert Baldyga
2015-03-18 14:04 ` [RFC 05/19] dwc3: gadget: enable/disable ep0 in dwc3_gadget_run_stop() Robert Baldyga
2015-03-18 14:04 ` [RFC 06/19] dwc3: gadget: check returned value in suspend/resume Robert Baldyga
2015-03-18 14:04 ` [RFC 07/19] dwc3: core: cleanup suspend/resume code Robert Baldyga
2015-03-18 15:00   ` Sergei Shtylyov
2015-03-18 14:04 ` [RFC 08/19] dwc3: core: handle event buffers in core_init/exit Robert Baldyga
2015-03-18 14:04 ` [RFC 09/19] dwc3: core: make dwc3_core_init/exit non-static Robert Baldyga
2015-03-18 14:04 ` [RFC 10/19] dwc3: add missing OTG register definitions Robert Baldyga
2015-03-18 14:04 ` [RFC 11/19] dwc3: add OTG handling code Robert Baldyga
2015-03-19  7:38   ` George Cherian
2015-03-18 14:04 ` [RFC 12/19] dwc3: otg: add ext_otg_ops support Robert Baldyga
2015-03-18 14:04 ` [RFC 13/19] dwc3: gadget: register gadget in OTG core Robert Baldyga
2015-03-18 14:04 ` [RFC 14/19] dwc3: host: don't add XHCI device only if in OTG mode Robert Baldyga
2015-03-18 14:04 ` [RFC 15/19] dwc3: core: initialize OTG in DWC3 core Robert Baldyga
2015-03-18 14:04 ` [RFC 16/19] dwc3: exynos: add software role switching code Robert Baldyga
2015-03-18 14:04 ` [RFC 17/19] ARM: dts: exynos5420: set usb3_lpm_capable in dwc3 controllers Robert Baldyga
2015-03-18 14:04 ` [RFC 18/19] ARM: dts: exynos5420: add snps,dis_u3_susphy_quirk to " Robert Baldyga
2015-03-18 14:04 ` [RFC 19/19] ARM: dts: exynos5422-odroidxu3: make usbdrd3 extcon client Robert Baldyga
2015-03-19  2:33 ` [RFC 00/19] dwc3: add USB OTG role switch support Chanwoo Choi
2015-03-19  8:27   ` Robert Baldyga

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.