• Home
  • Raw
  • Download

Lines Matching refs:phy

42 static inline u32 mphy_readl(struct ufs_mtk_phy *phy, u32 reg)  in mphy_readl()  argument
44 return readl(phy->mmio + reg); in mphy_readl()
47 static inline void mphy_writel(struct ufs_mtk_phy *phy, u32 val, u32 reg) in mphy_writel() argument
49 writel(val, phy->mmio + reg); in mphy_writel()
52 static void mphy_set_bit(struct ufs_mtk_phy *phy, u32 reg, u32 bit) in mphy_set_bit() argument
56 val = mphy_readl(phy, reg); in mphy_set_bit()
58 mphy_writel(phy, val, reg); in mphy_set_bit()
61 static void mphy_clr_bit(struct ufs_mtk_phy *phy, u32 reg, u32 bit) in mphy_clr_bit() argument
65 val = mphy_readl(phy, reg); in mphy_clr_bit()
67 mphy_writel(phy, val, reg); in mphy_clr_bit()
70 static struct ufs_mtk_phy *get_ufs_mtk_phy(struct phy *generic_phy) in get_ufs_mtk_phy()
75 static int ufs_mtk_phy_clk_init(struct ufs_mtk_phy *phy) in ufs_mtk_phy_clk_init() argument
77 struct device *dev = phy->dev; in ufs_mtk_phy_clk_init()
78 struct clk_bulk_data *clks = phy->clks; in ufs_mtk_phy_clk_init()
85 static void ufs_mtk_phy_set_active(struct ufs_mtk_phy *phy) in ufs_mtk_phy_set_active() argument
88 mphy_set_bit(phy, MP_GLB_DIG_8C, PLL_PWR_ON); in ufs_mtk_phy_set_active()
89 mphy_clr_bit(phy, MP_GLB_DIG_8C, FRC_FRC_PWR_ON); in ufs_mtk_phy_set_active()
92 mphy_clr_bit(phy, MP_GLB_DIG_8C, PLL_ISO_EN); in ufs_mtk_phy_set_active()
93 mphy_clr_bit(phy, MP_GLB_DIG_8C, FRC_PLL_ISO_EN); in ufs_mtk_phy_set_active()
96 mphy_set_bit(phy, MP_LN_RX_44, CDR_PWR_ON); in ufs_mtk_phy_set_active()
97 mphy_clr_bit(phy, MP_LN_RX_44, FRC_CDR_PWR_ON); in ufs_mtk_phy_set_active()
100 mphy_clr_bit(phy, MP_LN_RX_44, CDR_ISO_EN); in ufs_mtk_phy_set_active()
101 mphy_clr_bit(phy, MP_LN_RX_44, FRC_CDR_ISO_EN); in ufs_mtk_phy_set_active()
104 mphy_set_bit(phy, MP_LN_DIG_RX_AC, RX_SQ_EN); in ufs_mtk_phy_set_active()
105 mphy_clr_bit(phy, MP_LN_DIG_RX_AC, FRC_RX_SQ_EN); in ufs_mtk_phy_set_active()
111 mphy_clr_bit(phy, MP_LN_DIG_RX_9C, FSM_DIFZ_FRC); in ufs_mtk_phy_set_active()
114 static void ufs_mtk_phy_set_deep_hibern(struct ufs_mtk_phy *phy) in ufs_mtk_phy_set_deep_hibern() argument
117 mphy_set_bit(phy, MP_LN_DIG_RX_9C, FSM_DIFZ_FRC); in ufs_mtk_phy_set_deep_hibern()
120 mphy_set_bit(phy, MP_LN_DIG_RX_AC, FRC_RX_SQ_EN); in ufs_mtk_phy_set_deep_hibern()
121 mphy_clr_bit(phy, MP_LN_DIG_RX_AC, RX_SQ_EN); in ufs_mtk_phy_set_deep_hibern()
124 mphy_set_bit(phy, MP_LN_RX_44, FRC_CDR_ISO_EN); in ufs_mtk_phy_set_deep_hibern()
125 mphy_set_bit(phy, MP_LN_RX_44, CDR_ISO_EN); in ufs_mtk_phy_set_deep_hibern()
128 mphy_set_bit(phy, MP_LN_RX_44, FRC_CDR_PWR_ON); in ufs_mtk_phy_set_deep_hibern()
129 mphy_clr_bit(phy, MP_LN_RX_44, CDR_PWR_ON); in ufs_mtk_phy_set_deep_hibern()
132 mphy_set_bit(phy, MP_GLB_DIG_8C, FRC_PLL_ISO_EN); in ufs_mtk_phy_set_deep_hibern()
133 mphy_set_bit(phy, MP_GLB_DIG_8C, PLL_ISO_EN); in ufs_mtk_phy_set_deep_hibern()
136 mphy_set_bit(phy, MP_GLB_DIG_8C, FRC_FRC_PWR_ON); in ufs_mtk_phy_set_deep_hibern()
137 mphy_clr_bit(phy, MP_GLB_DIG_8C, PLL_PWR_ON); in ufs_mtk_phy_set_deep_hibern()
140 static int ufs_mtk_phy_power_on(struct phy *generic_phy) in ufs_mtk_phy_power_on()
142 struct ufs_mtk_phy *phy = get_ufs_mtk_phy(generic_phy); in ufs_mtk_phy_power_on() local
145 ret = clk_bulk_prepare_enable(UFSPHY_CLKS_CNT, phy->clks); in ufs_mtk_phy_power_on()
149 ufs_mtk_phy_set_active(phy); in ufs_mtk_phy_power_on()
154 static int ufs_mtk_phy_power_off(struct phy *generic_phy) in ufs_mtk_phy_power_off()
156 struct ufs_mtk_phy *phy = get_ufs_mtk_phy(generic_phy); in ufs_mtk_phy_power_off() local
158 ufs_mtk_phy_set_deep_hibern(phy); in ufs_mtk_phy_power_off()
160 clk_bulk_disable_unprepare(UFSPHY_CLKS_CNT, phy->clks); in ufs_mtk_phy_power_off()
174 struct phy *generic_phy; in ufs_mtk_phy_probe()
176 struct ufs_mtk_phy *phy; in ufs_mtk_phy_probe() local
179 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); in ufs_mtk_phy_probe()
180 if (!phy) in ufs_mtk_phy_probe()
183 phy->mmio = devm_platform_ioremap_resource(pdev, 0); in ufs_mtk_phy_probe()
184 if (IS_ERR(phy->mmio)) in ufs_mtk_phy_probe()
185 return PTR_ERR(phy->mmio); in ufs_mtk_phy_probe()
187 phy->dev = dev; in ufs_mtk_phy_probe()
189 ret = ufs_mtk_phy_clk_init(phy); in ufs_mtk_phy_probe()
197 phy_set_drvdata(generic_phy, phy); in ufs_mtk_phy_probe()