Skip to content

Commit c8145ec

Browse files
claudiubezneajfvogel
authored andcommitted
phy: renesas: rcar-gen3-usb2: Set timing registers only once
commit 86e70849f4b2b4597ac9f7c7931f2a363774be25 upstream. phy-rcar-gen3-usb2 driver exports 4 PHYs. The timing registers are common to all PHYs. There is no need to set them every time a PHY is initialized. Set timing register only when the 1st PHY is initialized. Fixes: f3b5a8d ("phy: rcar-gen3-usb2: Add R-Car Gen3 USB2 PHY driver") Cc: [email protected] Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Lad Prabhakar <[email protected]> Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit c450f648d0fc3fa01ebf16de70757f54b359735d) Signed-off-by: Jack Vogel <[email protected]>
1 parent a0450ec commit c8145ec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/phy/renesas/phy-rcar-gen3-usb2.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,11 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
463463
val = readl(usb2_base + USB2_INT_ENABLE);
464464
val |= USB2_INT_ENABLE_UCOM_INTEN | rphy->int_enable_bits;
465465
writel(val, usb2_base + USB2_INT_ENABLE);
466-
writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
467-
writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
466+
467+
if (!rcar_gen3_is_any_rphy_initialized(channel)) {
468+
writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
469+
writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
470+
}
468471

469472
/* Initialize otg part (only if we initialize a PHY with IRQs). */
470473
if (rphy->int_enable_bits)

0 commit comments

Comments
 (0)