]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
phy: renesas: rcar-gen3-usb2: Assert PLL reset on PHY power off
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Wed, 7 May 2025 12:50:31 +0000 (15:50 +0300)
committerVinod Koul <vkoul@kernel.org>
Wed, 14 May 2025 11:25:09 +0000 (12:25 +0100)
Assert PLL reset on PHY power off. This saves power.

Fixes: f3b5a8d9b50d ("phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver")
Cc: stable@vger.kernel.org
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Claudiu 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: Vinod Koul <vkoul@kernel.org>
drivers/phy/renesas/phy-rcar-gen3-usb2.c

index 00ce564463de8820b30c61583d69673adc1cfdd3..118899efda70b384666d91fc33bad3bf140a459a 100644 (file)
@@ -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);