usb: gadget: pch_udc: Detecting VBUS through GPIO with interrupt
authorTomoya MORINAGA <tomoya.rohm@gmail.com>
Fri, 3 Feb 2012 07:14:18 +0000 (16:14 +0900)
committerFelipe Balbi <balbi@ti.com>
Thu, 9 Feb 2012 07:58:48 +0000 (09:58 +0200)
commit637b78eb31e0b167ed913f1750bb645dfeda38f0
tree9496e1f2489bedef09c523bd0f0f0f960e553014
parentdd63180b758d5972fc90621af0741d5bfae1a684
usb: gadget: pch_udc: Detecting VBUS through GPIO with interrupt

Problem:
 pch_udc continues operation even if VBUS becomes Low.
 pch_udc performs D+ pulling up before VBUS becomes High.
 USB device should be controlled according to VBUS state.

Root cause:
 The current pch_udc is not always monitoring VBUS.

Solution:
 The change of VBUS is detected using an interrupt of GPIO.
 If VBUS became Low, pch_udc handles 'disconnect'.
 After VBUS became High, a pull improves D+, and pch_udc
 handles 'connect'.

[ balbi@ti.com : make it actually compile ]

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/pch_udc.c