summaryrefslogtreecommitdiff
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2024-01-23 17:51:09 -0500
committerSasha Levin <sashal@kernel.org>2024-03-26 18:20:04 -0400
commit0255a3b17b1cb68ef9d4b36e101d301383f7a3c6 (patch)
tree05d0cd77723e14af1feafb2945896603f6f65cfb /drivers/usb/phy
parent330e860a08a0e9a1094b8e8b5eca507ada17d462 (diff)
downloadlinux-0255a3b17b1cb68ef9d4b36e101d301383f7a3c6.tar.gz
linux-0255a3b17b1cb68ef9d4b36e101d301383f7a3c6.tar.bz2
linux-0255a3b17b1cb68ef9d4b36e101d301383f7a3c6.zip
usb: phy: generic: Get the vbus supply
[ Upstream commit 75fd6485cccef269ac9eb3b71cf56753341195ef ] While support for working with a vbus was added, the regulator was never actually gotten (despite what was documented). Fix this by actually getting the supply from the device tree. Fixes: 7acc9973e3c4 ("usb: phy: generic: add vbus support") Signed-off-by: Sean Anderson <sean.anderson@seco.com> Link: https://lore.kernel.org/r/20240123225111.1629405-3-sean.anderson@seco.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-generic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index 770081b828a4..b855d291dfe6 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -268,6 +268,13 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
"could not get vbus regulator\n");
+ nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
+ if (PTR_ERR(nop->vbus_draw) == -ENODEV)
+ nop->vbus_draw = NULL;
+ if (IS_ERR(nop->vbus_draw))
+ return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
+ "could not get vbus regulator\n");
+
nop->dev = dev;
nop->phy.dev = nop->dev;
nop->phy.label = "nop-xceiv";