Skip to content

Commit 7eddddf

Browse files
claudiubezneaopsiff
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: 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-6-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit a1546ec7e049888db0cb708345313fee7e6971a8)
1 parent 9c6b5c6 commit 7eddddf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,11 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
452452
val = readl(usb2_base + USB2_INT_ENABLE);
453453
val |= USB2_INT_ENABLE_UCOM_INTEN | rphy->int_enable_bits;
454454
writel(val, usb2_base + USB2_INT_ENABLE);
455-
writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
456-
writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
455+
456+
if (!rcar_gen3_is_any_rphy_initialized(channel)) {
457+
writel(USB2_SPD_RSM_TIMSET_INIT, usb2_base + USB2_SPD_RSM_TIMSET);
458+
writel(USB2_OC_TIMSET_INIT, usb2_base + USB2_OC_TIMSET);
459+
}
457460

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

0 commit comments

Comments
 (0)