Skip to content

Commit 6fe0842

Browse files
claudiubezneagregkh
authored andcommitted
phy: renesas: rcar-gen3-usb2: Set timing registers only once
commit 86e7084 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]>
1 parent 35968b3 commit 6fe0842

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
@@ -453,8 +453,11 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
453453
val = readl(usb2_base + USB2_INT_ENABLE);
454454
val |= USB2_INT_ENABLE_UCOM_INTEN | rphy->int_enable_bits;
455455
writel(val, usb2_base + USB2_INT_ENABLE);
456-
writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
457-
writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
456+
457+
if (!rcar_gen3_is_any_rphy_initialized(channel)) {
458+
writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
459+
writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
460+
}
458461

459462
/* Initialize otg part */
460463
if (channel->is_otg_channel) {

0 commit comments

Comments
 (0)