usb: phy: generic: Implement otg->set_vbus
authorSean Anderson <sean.anderson@seco.com>
Tue, 23 Jan 2024 22:51:10 +0000 (17:51 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 01:37:22 +0000 (17:37 -0800)
commit562898808cb17fdea92953e6a69c193b783d7b3f
treeb82a9482056c57023cda7e3bd57ffb5bbb4358df
parent75fd6485cccef269ac9eb3b71cf56753341195ef
usb: phy: generic: Implement otg->set_vbus

Some USB controller drivers call otg_set_vbus when entering host or
device mode. Implement this callback so that VBUS can be turned on and
off automatically. This is especially useful when there is no property
for a VBUS supply in the controller's binding.

This results in a change in semantics of the vbus_draw regulator.
Whereas before it represented the VBUS supplied by an A-Device when we
acted as a B-Device, now it represents an internal VBUS source.
Accordingly, we no longer set the current limit or enable/disable the
bus from nop_gpio_vbus_thread. Because this supply was never initialized
before the previous commit, there should be no change in behavior.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20240123225111.1629405-4-sean.anderson@seco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/phy/phy-generic.c