phy: phy-mtk-tphy: set utmi 0 register in init() ops
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 14 Sep 2022 06:07:45 +0000 (14:07 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 20 Sep 2022 06:29:05 +0000 (11:59 +0530)
No need repeat to clear utmi 0 register in ->power_on() and
->power_off(), just do it in ->init()

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220914060746.10004-6-chunfeng.yun@mediatek.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/mediatek/phy-mtk-tphy.c

index 79920c0..e0f227a 100644 (file)
@@ -522,8 +522,8 @@ static void u2_phy_instance_init(struct mtk_tphy *tphy,
        /* switch to USB function, and enable usb pll */
        mtk_phy_clear_bits(com + U3P_U2PHYDTM0, P2C_FORCE_UART_EN | P2C_FORCE_SUSPENDM);
 
-       mtk_phy_update_bits(com + U3P_U2PHYDTM0, P2C_RG_XCVRSEL | P2C_RG_DATAIN,
-                           P2C_RG_XCVRSEL_VAL(1) | P2C_RG_DATAIN_VAL(0));
+       mtk_phy_clear_bits(com + U3P_U2PHYDTM0,
+                          P2C_RG_XCVRSEL | P2C_RG_DATAIN | P2C_DTM0_PART_MASK);
 
        mtk_phy_clear_bits(com + U3P_U2PHYDTM1, P2C_RG_UART_EN);
 
@@ -565,9 +565,6 @@ static void u2_phy_instance_power_on(struct mtk_tphy *tphy,
        void __iomem *com = u2_banks->com;
        u32 index = instance->index;
 
-       mtk_phy_clear_bits(com + U3P_U2PHYDTM0,
-                          P2C_RG_XCVRSEL | P2C_RG_DATAIN | P2C_DTM0_PART_MASK);
-
        /* OTG Enable */
        mtk_phy_set_bits(com + U3P_USBPHYACR6, PA6_RG_U2_OTG_VBUSCMP_EN);
 
@@ -590,8 +587,6 @@ static void u2_phy_instance_power_off(struct mtk_tphy *tphy,
        void __iomem *com = u2_banks->com;
        u32 index = instance->index;
 
-       mtk_phy_clear_bits(com + U3P_U2PHYDTM0, P2C_RG_XCVRSEL | P2C_RG_DATAIN);
-
        /* OTG Disable */
        mtk_phy_clear_bits(com + U3P_USBPHYACR6, PA6_RG_U2_OTG_VBUSCMP_EN);