summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2024-07-02 21:00:17 +0300
committerPhilipp Zabel <p.zabel@pengutronix.de>2024-07-03 11:51:53 +0300
commit24843404efe47eab1ee88d7475a0be0f2f6fd9db (patch)
tree96f2951210141856a1fd6416a7f0a4b0aa02f87a /drivers/phy
parent4068f22e4b47f7352fc369c22800e04d2860416b (diff)
downloadlinux-24843404efe47eab1ee88d7475a0be0f2f6fd9db.tar.xz
phy: renesas: phy-rcar-gen3-usb2: Control VBUS for RZ/G2L SoCs
Use regulator_hardware_enable() for controlling VBUS enable for RZ/G2L alike SoCs in interrupt context. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Acked-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20240702180032.207275-4-biju.das.jz@bp.renesas.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/renesas/phy-rcar-gen3-usb2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index fbab6ac0f0d1..7594f64eb737 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -188,6 +188,9 @@ static void rcar_gen3_enable_vbus_ctrl(struct rcar_gen3_chan *ch, int vbus)
dev_vdbg(ch->dev, "%s: %08x, %d\n", __func__, val, vbus);
if (ch->soc_no_adp_ctrl) {
+ if (ch->vbus)
+ regulator_hardware_enable(ch->vbus, vbus);
+
vbus_ctrl_reg = USB2_VBCTRL;
vbus_ctrl_val = USB2_VBCTRL_VBOUT;
}
@@ -718,7 +721,10 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
phy_set_drvdata(channel->rphys[i].phy, &channel->rphys[i]);
}
- channel->vbus = devm_regulator_get_optional(dev, "vbus");
+ if (channel->soc_no_adp_ctrl && channel->is_otg_channel)
+ channel->vbus = devm_regulator_get_exclusive(dev, "vbus");
+ else
+ channel->vbus = devm_regulator_get_optional(dev, "vbus");
if (IS_ERR(channel->vbus)) {
if (PTR_ERR(channel->vbus) == -EPROBE_DEFER) {
ret = PTR_ERR(channel->vbus);