Commit 9ce71e85 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Vinod Koul
Browse files

phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off



Assert PLL reset on PHY power off. This saves power.

Fixes: f3b5a8d9 ("phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/r/20250507125032.565017-5-claudiu.beznea.uj@bp.renesas.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 55a387eb
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -537,9 +537,17 @@ static int rcar_gen3_phy_usb2_power_off(struct phy *p)
	struct rcar_gen3_chan *channel = rphy->ch;
	int ret = 0;

	scoped_guard(spinlock_irqsave, &channel->lock)
	scoped_guard(spinlock_irqsave, &channel->lock) {
		rphy->powered = false;

		if (rcar_gen3_are_all_rphys_power_off(channel)) {
			u32 val = readl(channel->base + USB2_USBCTR);

			val |= USB2_USBCTR_PLL_RST;
			writel(val, channel->base + USB2_USBCTR);
		}
	}

	if (channel->vbus)
		ret = regulator_disable(channel->vbus);