All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] extcon: usb: Introduce USB GPIO extcon driver. Fix DRA7 & AM57xx USB.
@ 2015-01-26 12:15 ` Roger Quadros
  0 siblings, 0 replies; 75+ messages in thread
From: Roger Quadros @ 2015-01-26 12:15 UTC (permalink / raw)
  To: balbi, tony, myungjoo.ham, cw00.choi
  Cc: george.cherian, nsekhar, devicetree, linux-usb, linux-omap,
	linux-kernel, Roger Quadros

Hi,

Still hoping this can make into 3.20 else we have USB peripheral mode broken on
DRA7-evm, DRA72-evm and AM57xx-beagle-x15.

On DRA7 and AM57xx EVMs the USB ID pin is connected to a GPIO line.
The USB drivers (dwc3 + dwc3-omap) depend on extcon framework to get the
USB cable state (USB or USB-Host) to put the controller in the right mode.

There were earlier attempts [1] to get this working by trying to patch up
the existing GPIO extcon driver.

This series attemts to take a different approach by introducing a new
USB specific extcon driver to handle the USB ID GPIO pin and
interpret a right USB cable state.

The reasoning to introduce this new driver is:
1) The existing GPIO extcon driver doesn't understand USB cable states
and it can't handle more than one cable per instance.
   
For the USB case we need to handle at least 2 cable states.
    a) USB (attach/detach)
    b) USB-Host (attach/detach)
and could possible include more states like
    c) Fast-charger (attach/detach)
    d) Slow-charger (attach/detach)
    
2) This USB specific driver can be easily updated in the future to
handle VBUS events, or charger detect events, in case it happens
to be available on GPIO for any platform.

3) The DT implementation is very easy. You just need one extcon node per USB
instead of one extcon node per cable state as in case of [1].

4) The cable state string doesn't need to be encoded in the device tree
as in case of [1].

5) With only ID event available, you can simulate a USB-peripheral attach
when USB-Host is detacted instead of hacking the USB driver to do the same.

Tested on DRA7-evm, DRA72-evm and AM57xx-beagle-x15

Changelog:
v2
- Addressed review comments.
- Fixed auto load of extcon-usb-gpio driver when used as module.
- Fixed up AM57xx USB.

--
cheers,
-roger
[1] - https://lkml.org/lkml/2014/11/3/513

Roger Quadros (7):
  extcon: usb-gpio: Introduce gpio usb extcon driver
  usb: extcon: Fix USB-Host cable name
  ARM: dts: dra7-evm: Add extcon nodes for USB
  ARM: dts: dra72-evm: Add extcon nodes for USB
  ARM: dts: am57xx-beagle-x15: Add extcon nodes for USB
  ARM: dts: am57xx-beagle-x15: Fix USB2 mode
  ARM: omap2plus_defconfig: Enable EXTCON_GPIO_USB

 .../devicetree/bindings/extcon/extcon-usb-gpio.txt |  20 ++
 arch/arm/boot/dts/am57xx-beagle-x15.dts            |  37 ++++
 arch/arm/boot/dts/dra7-evm.dts                     |  31 +++
 arch/arm/boot/dts/dra72-evm.dts                    |  31 +++
 arch/arm/configs/omap2plus_defconfig               |   1 +
 drivers/extcon/Kconfig                             |   7 +
 drivers/extcon/Makefile                            |   1 +
 drivers/extcon/extcon-palmas.c                     |  18 +-
 drivers/extcon/extcon-usb-gpio.c                   | 214 +++++++++++++++++++++
 drivers/usb/dwc3/dwc3-omap.c                       |   6 +-
 drivers/usb/phy/phy-omap-otg.c                     |   4 +-
 drivers/usb/phy/phy-tahvo.c                        |   8 +-
 12 files changed, 360 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
 create mode 100644 drivers/extcon/extcon-usb-gpio.c

-- 
2.1.0


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

end of thread, other threads:[~2015-03-17  9:30 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 12:15 [PATCH v2 0/7] extcon: usb: Introduce USB GPIO extcon driver. Fix DRA7 & AM57xx USB Roger Quadros
2015-01-26 12:15 ` Roger Quadros
2015-01-26 12:15 ` [PATCH v2 1/7] extcon: usb-gpio: Introduce gpio usb extcon driver Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-01-26 13:56   ` Chanwoo Choi
2015-01-26 13:56     ` Chanwoo Choi
2015-01-26 16:27     ` Roger Quadros
2015-01-26 16:27       ` Roger Quadros
2015-01-27  1:54       ` Chanwoo Choi
2015-01-27  1:54         ` Chanwoo Choi
2015-01-27 15:38         ` Roger Quadros
2015-01-27 15:38           ` Roger Quadros
2015-01-28  2:19           ` Chanwoo Choi
2015-01-28 12:12             ` Roger Quadros
2015-01-28 12:12               ` Roger Quadros
2015-01-28 17:09               ` Tony Lindgren
2015-01-29 11:31                 ` Roger Quadros
2015-01-29 11:31                   ` Roger Quadros
2015-01-29 16:56                   ` Tony Lindgren
2015-01-30 10:58                     ` Roger Quadros
2015-01-30 10:58                       ` Roger Quadros
2015-01-28 12:15   ` [PATCH v3 " Roger Quadros
2015-01-28 12:15     ` Roger Quadros
2015-01-29  1:49     ` Chanwoo Choi
2015-01-29 11:26       ` Roger Quadros
2015-01-29 11:26         ` Roger Quadros
2015-01-30  0:06         ` Chanwoo Choi
2015-01-30 11:09           ` Roger Quadros
2015-01-30 11:09             ` Roger Quadros
2015-01-30 13:57             ` Roger Quadros
2015-01-30 13:57               ` Roger Quadros
2015-01-30  0:11     ` Chanwoo Choi
2015-01-30 14:03       ` Roger Quadros
2015-01-30 14:03         ` Roger Quadros
2015-02-02  5:06         ` Chanwoo Choi
2015-02-02  5:06           ` Chanwoo Choi
2015-02-02 10:21     ` [PATCH v4 1/1] " Roger Quadros
2015-02-02 10:21       ` Roger Quadros
2015-02-03  1:13       ` Chanwoo Choi
2015-03-16 12:32       ` Ivan T. Ivanov
2015-03-16 13:11         ` Roger Quadros
2015-03-16 13:11           ` Roger Quadros
2015-03-16 14:23           ` Ivan T. Ivanov
2015-03-17  2:01             ` Chanwoo Choi
2015-03-17  7:52               ` Ivan T. Ivanov
2015-03-17  8:00                 ` Ivan T. Ivanov
2015-03-17  8:00                   ` Ivan T. Ivanov
2015-01-26 12:15 ` [PATCH v2 2/7] usb: extcon: Fix USB-Host cable name Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-01-30 11:04   ` Roger Quadros
2015-01-30 11:04     ` Roger Quadros
2015-01-30 14:05     ` Roger Quadros
2015-01-30 14:05       ` Roger Quadros
2015-02-02  5:04       ` Chanwoo Choi
2015-02-02  9:09         ` Roger Quadros
2015-02-02  9:09           ` Roger Quadros
2015-02-02  9:55           ` Chanwoo Choi
2015-02-02 10:01             ` Roger Quadros
2015-02-02 10:01               ` Roger Quadros
2015-02-02 10:06               ` Chanwoo Choi
2015-02-02 10:06                 ` Chanwoo Choi
2015-01-26 12:15 ` [PATCH v2 3/7] ARM: dts: dra7-evm: Add extcon nodes for USB Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-01-26 12:15 ` [PATCH v2 4/7] ARM: dts: dra72-evm: " Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-01-26 12:15 ` [PATCH v2 5/7] ARM: dts: am57xx-beagle-x15: " Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-01-26 12:15 ` [PATCH v2 6/7] ARM: dts: am57xx-beagle-x15: Fix USB2 mode Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-01-26 12:15 ` [PATCH v2 7/7] ARM: omap2plus_defconfig: Enable EXTCON_GPIO_USB Roger Quadros
2015-01-26 12:15   ` Roger Quadros
2015-03-16 17:53   ` Tony Lindgren
2015-03-16 17:53     ` Tony Lindgren
2015-03-17  9:29     ` Roger Quadros
2015-03-17  9:29       ` Roger Quadros

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.