Lines Matching refs:inst
110 struct xsphy_instance *inst) in u2_phy_slew_rate_calibrate() argument
112 void __iomem *pbase = inst->port_base; in u2_phy_slew_rate_calibrate()
118 if (inst->eye_src) in u2_phy_slew_rate_calibrate()
157 inst->index, fm_out, calib_val, in u2_phy_slew_rate_calibrate()
168 struct xsphy_instance *inst) in u2_phy_instance_init() argument
170 void __iomem *pbase = inst->port_base; in u2_phy_instance_init()
179 struct xsphy_instance *inst) in u2_phy_instance_power_on() argument
181 void __iomem *pbase = inst->port_base; in u2_phy_instance_power_on()
182 u32 index = inst->index; in u2_phy_instance_power_on()
194 struct xsphy_instance *inst) in u2_phy_instance_power_off() argument
196 void __iomem *pbase = inst->port_base; in u2_phy_instance_power_off()
197 u32 index = inst->index; in u2_phy_instance_power_off()
209 struct xsphy_instance *inst, in u2_phy_instance_set_mode() argument
214 tmp = readl(inst->port_base + XSP_U2PHYDTM1); in u2_phy_instance_set_mode()
229 writel(tmp, inst->port_base + XSP_U2PHYDTM1); in u2_phy_instance_set_mode()
233 struct xsphy_instance *inst) in phy_parse_property() argument
235 struct device *dev = &inst->phy->dev; in phy_parse_property()
237 switch (inst->type) { in phy_parse_property()
240 &inst->efuse_intr); in phy_parse_property()
242 &inst->eye_src); in phy_parse_property()
244 &inst->eye_vrt); in phy_parse_property()
246 &inst->eye_term); in phy_parse_property()
248 inst->efuse_intr, inst->eye_src, in phy_parse_property()
249 inst->eye_vrt, inst->eye_term); in phy_parse_property()
253 &inst->efuse_intr); in phy_parse_property()
255 &inst->efuse_tx_imp); in phy_parse_property()
257 &inst->efuse_rx_imp); in phy_parse_property()
259 inst->efuse_intr, inst->efuse_tx_imp, in phy_parse_property()
260 inst->efuse_rx_imp); in phy_parse_property()
269 struct xsphy_instance *inst) in u2_phy_props_set() argument
271 void __iomem *pbase = inst->port_base; in u2_phy_props_set()
273 if (inst->efuse_intr) in u2_phy_props_set()
275 inst->efuse_intr); in u2_phy_props_set()
277 if (inst->eye_src) in u2_phy_props_set()
279 inst->eye_src); in u2_phy_props_set()
281 if (inst->eye_vrt) in u2_phy_props_set()
283 inst->eye_vrt); in u2_phy_props_set()
285 if (inst->eye_term) in u2_phy_props_set()
287 inst->eye_term); in u2_phy_props_set()
291 struct xsphy_instance *inst) in u3_phy_props_set() argument
293 void __iomem *pbase = inst->port_base; in u3_phy_props_set()
295 if (inst->efuse_intr) in u3_phy_props_set()
297 RG_XTP_GLB_BIAS_INTR_CTRL, inst->efuse_intr); in u3_phy_props_set()
299 if (inst->efuse_tx_imp) in u3_phy_props_set()
301 RG_XTP_LN0_TX_IMPSEL, inst->efuse_tx_imp); in u3_phy_props_set()
303 if (inst->efuse_rx_imp) in u3_phy_props_set()
305 RG_XTP_LN0_RX_IMPSEL, inst->efuse_rx_imp); in u3_phy_props_set()
310 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_init() local
314 ret = clk_prepare_enable(inst->ref_clk); in mtk_phy_init()
320 switch (inst->type) { in mtk_phy_init()
322 u2_phy_instance_init(xsphy, inst); in mtk_phy_init()
323 u2_phy_props_set(xsphy, inst); in mtk_phy_init()
326 u3_phy_props_set(xsphy, inst); in mtk_phy_init()
330 clk_disable_unprepare(inst->ref_clk); in mtk_phy_init()
339 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_power_on() local
342 if (inst->type == PHY_TYPE_USB2) { in mtk_phy_power_on()
343 u2_phy_instance_power_on(xsphy, inst); in mtk_phy_power_on()
344 u2_phy_slew_rate_calibrate(xsphy, inst); in mtk_phy_power_on()
352 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_power_off() local
355 if (inst->type == PHY_TYPE_USB2) in mtk_phy_power_off()
356 u2_phy_instance_power_off(xsphy, inst); in mtk_phy_power_off()
363 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_exit() local
365 clk_disable_unprepare(inst->ref_clk); in mtk_phy_exit()
371 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_set_mode() local
374 if (inst->type == PHY_TYPE_USB2) in mtk_phy_set_mode()
375 u2_phy_instance_set_mode(xsphy, inst, mode); in mtk_phy_set_mode()
384 struct xsphy_instance *inst = NULL; in mtk_phy_xlate() local
395 inst = xsphy->phys[index]; in mtk_phy_xlate()
399 if (!inst) { in mtk_phy_xlate()
404 inst->type = args->args[0]; in mtk_phy_xlate()
405 if (!(inst->type == PHY_TYPE_USB2 || in mtk_phy_xlate()
406 inst->type == PHY_TYPE_USB3)) { in mtk_phy_xlate()
407 dev_err(dev, "unsupported phy type: %d\n", inst->type); in mtk_phy_xlate()
411 phy_parse_property(xsphy, inst); in mtk_phy_xlate()
413 return inst->phy; in mtk_phy_xlate()
475 struct xsphy_instance *inst; in mtk_xsphy_probe() local
478 inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL); in mtk_xsphy_probe()
479 if (!inst) { in mtk_xsphy_probe()
484 xsphy->phys[port] = inst; in mtk_xsphy_probe()
500 inst->port_base = devm_ioremap_resource(&phy->dev, &res); in mtk_xsphy_probe()
501 if (IS_ERR(inst->port_base)) { in mtk_xsphy_probe()
503 retval = PTR_ERR(inst->port_base); in mtk_xsphy_probe()
507 inst->phy = phy; in mtk_xsphy_probe()
508 inst->index = port; in mtk_xsphy_probe()
509 phy_set_drvdata(phy, inst); in mtk_xsphy_probe()
512 inst->ref_clk = devm_clk_get(&phy->dev, "ref"); in mtk_xsphy_probe()
513 if (IS_ERR(inst->ref_clk)) { in mtk_xsphy_probe()
515 retval = PTR_ERR(inst->ref_clk); in mtk_xsphy_probe()