lkml.org 
[lkml]   [2022]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 7/7] phy: phy-mtk-tphy: fix the phy type setting issue
    Date
    The PHY type is not set if the index is non zero, prepare type
    value according to the index, like as mask value.

    Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
    ---
    drivers/phy/mediatek/phy-mtk-tphy.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)

    diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
    index e0f227a0d3cc..cc10298bc70d 100644
    --- a/drivers/phy/mediatek/phy-mtk-tphy.c
    +++ b/drivers/phy/mediatek/phy-mtk-tphy.c
    @@ -915,7 +915,7 @@ static int phy_type_syscon_get(struct mtk_phy_instance *instance,
    static int phy_type_set(struct mtk_phy_instance *instance)
    {
    int type;
    - u32 mask;
    + u32 offset;

    if (!instance->type_sw)
    return 0;
    @@ -938,8 +938,9 @@ static int phy_type_set(struct mtk_phy_instance *instance)
    return 0;
    }

    - mask = RG_PHY_SW_TYPE << (instance->type_sw_index * BITS_PER_BYTE);
    - regmap_update_bits(instance->type_sw, instance->type_sw_reg, mask, type);
    + offset = instance->type_sw_index * BITS_PER_BYTE;
    + regmap_update_bits(instance->type_sw, instance->type_sw_reg,
    + RG_PHY_SW_TYPE << offset, type << offset);

    return 0;
    }
    --
    2.25.1
    \
     
     \ /
      Last update: 2022-08-19 11:16    [W:4.019 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site