]> git.ipfire.org Git - people/arne_f/kernel.git/commit
usb: phy: generic: cope with initial state
authorRobert Jarzmik <robert.jarzmik@free.fr>
Fri, 8 Jul 2016 20:09:06 +0000 (22:09 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 25 Aug 2016 09:13:07 +0000 (12:13 +0300)
commit9835a6ef1a96b203278629bbcf5099622070c32b
tree59046d741e8c1649f3df9ada98dc26b9aab7b5ac
parent0c0e287d454a2dbfaea4159ed45f7b146010f88b
usb: phy: generic: cope with initial state

In the gpio based case, the status of the phy is known at start by
reading the VBus gpio.

Actually, this is a fix, as this initial state, when not set up,
prevents a gadget to answer to the enumeration phase, as there is no
notification in this case (the VBus is already high when kernel boots)
so no interrupt is triggered, and the flow is :
 - gadget initializes
 - gadget gets its phy-generic with a xxx_get_phy_xxx() call type
 - gadget does a "set_peripheral()" call type
   => here if the otg->state is correctly filled, the proper vbus
   handling will be called, and the gadget will be aware it should
   answer enumeration and go forth

Without this fix, the USB cable must be removed and replugged for any
gadget relying on phy-generic and its gpio vbus handling to work.

The problem was seen on a pxa27x architecture based board on a
devicetree build.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/phy/phy-generic.c