extcon: usb-gpio: Add VBUS detection support
authorRoger Quadros <rogerq@ti.com>
Tue, 20 Sep 2016 14:53:55 +0000 (17:53 +0300)
committerChanwoo Choi <cw00.choi@samsung.com>
Sun, 20 Nov 2016 12:22:39 +0000 (21:22 +0900)
commit37086cace8dc0971e05eae6881c05da12cd1010c
tree40ccb2e8f4ff55da6f157211a300599c58c06508
parent20bd97d8040074f137a8e3c94b1b119fc1476d62
extcon: usb-gpio: Add VBUS detection support

Driver can now work with both ID and VBUS pins or either one of
them.

There can be the following 3 cases

1) Both ID and VBUS GPIOs are available:

ID = LOW -> USB_HOST active, USB inactive
ID = HIGH -> USB_HOST inactive, USB state is same as VBUS.

2) Only ID GPIO is available:

ID = LOW -> USB_HOST active, USB inactive
ID = HIGH -> USB_HOST inactive, USB active

3) Only VBUS GPIO is available:

VBUS = LOW -> USB_HOST inactive, USB inactive
VBUS = HIGH -> USB_HOST inactive, USB active

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
drivers/extcon/extcon-usb-gpio.c