Lines Matching refs:inst
122 struct xsphy_instance *inst) in u2_phy_slew_rate_calibrate() argument
124 void __iomem *pbase = inst->port_base; in u2_phy_slew_rate_calibrate()
130 if (inst->eye_src) in u2_phy_slew_rate_calibrate()
169 inst->index, fm_out, calib_val, in u2_phy_slew_rate_calibrate()
180 struct xsphy_instance *inst) in u2_phy_instance_init() argument
182 void __iomem *pbase = inst->port_base; in u2_phy_instance_init()
191 struct xsphy_instance *inst) in u2_phy_instance_power_on() argument
193 void __iomem *pbase = inst->port_base; in u2_phy_instance_power_on()
194 u32 index = inst->index; in u2_phy_instance_power_on()
206 struct xsphy_instance *inst) in u2_phy_instance_power_off() argument
208 void __iomem *pbase = inst->port_base; in u2_phy_instance_power_off()
209 u32 index = inst->index; in u2_phy_instance_power_off()
221 struct xsphy_instance *inst, in u2_phy_instance_set_mode() argument
226 tmp = readl(inst->port_base + XSP_U2PHYDTM1); in u2_phy_instance_set_mode()
241 writel(tmp, inst->port_base + XSP_U2PHYDTM1); in u2_phy_instance_set_mode()
245 struct xsphy_instance *inst) in phy_parse_property() argument
247 struct device *dev = &inst->phy->dev; in phy_parse_property()
249 switch (inst->type) { in phy_parse_property()
252 &inst->efuse_intr); in phy_parse_property()
254 &inst->eye_src); in phy_parse_property()
256 &inst->eye_vrt); in phy_parse_property()
258 &inst->eye_term); in phy_parse_property()
260 inst->efuse_intr, inst->eye_src, in phy_parse_property()
261 inst->eye_vrt, inst->eye_term); in phy_parse_property()
265 &inst->efuse_intr); in phy_parse_property()
267 &inst->efuse_tx_imp); in phy_parse_property()
269 &inst->efuse_rx_imp); in phy_parse_property()
271 inst->efuse_intr, inst->efuse_tx_imp, in phy_parse_property()
272 inst->efuse_rx_imp); in phy_parse_property()
285 struct xsphy_instance *inst) in u2_phy_props_set() argument
287 void __iomem *pbase = inst->port_base; in u2_phy_props_set()
289 if (inst->efuse_intr) in u2_phy_props_set()
291 inst->efuse_intr); in u2_phy_props_set()
293 if (inst->eye_src) in u2_phy_props_set()
295 inst->eye_src); in u2_phy_props_set()
297 if (inst->eye_vrt) in u2_phy_props_set()
299 inst->eye_vrt); in u2_phy_props_set()
301 if (inst->eye_term) in u2_phy_props_set()
303 inst->eye_term); in u2_phy_props_set()
307 struct xsphy_instance *inst) in u3_phy_props_set() argument
309 void __iomem *pbase = inst->port_base; in u3_phy_props_set()
311 if (inst->efuse_intr) in u3_phy_props_set()
313 RG_XTP_GLB_BIAS_INTR_CTRL, inst->efuse_intr); in u3_phy_props_set()
315 if (inst->efuse_tx_imp) in u3_phy_props_set()
317 RG_XTP_LN0_TX_IMPSEL, inst->efuse_tx_imp); in u3_phy_props_set()
319 if (inst->efuse_rx_imp) in u3_phy_props_set()
321 RG_XTP_LN0_RX_IMPSEL, inst->efuse_rx_imp); in u3_phy_props_set()
382 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_init() local
386 ret = clk_prepare_enable(inst->ref_clk); in mtk_phy_init()
392 switch (inst->type) { in mtk_phy_init()
394 u2_phy_instance_init(xsphy, inst); in mtk_phy_init()
395 u2_phy_props_set(xsphy, inst); in mtk_phy_init()
398 u3_phy_props_set(xsphy, inst); in mtk_phy_init()
406 clk_disable_unprepare(inst->ref_clk); in mtk_phy_init()
415 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_power_on() local
418 if (inst->type == PHY_TYPE_USB2) { in mtk_phy_power_on()
419 u2_phy_instance_power_on(xsphy, inst); in mtk_phy_power_on()
420 u2_phy_slew_rate_calibrate(xsphy, inst); in mtk_phy_power_on()
428 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_power_off() local
431 if (inst->type == PHY_TYPE_USB2) in mtk_phy_power_off()
432 u2_phy_instance_power_off(xsphy, inst); in mtk_phy_power_off()
439 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_exit() local
441 clk_disable_unprepare(inst->ref_clk); in mtk_phy_exit()
447 struct xsphy_instance *inst = phy_get_drvdata(phy); in mtk_phy_set_mode() local
450 if (inst->type == PHY_TYPE_USB2) in mtk_phy_set_mode()
451 u2_phy_instance_set_mode(xsphy, inst, mode); in mtk_phy_set_mode()
460 struct xsphy_instance *inst = NULL; in mtk_phy_xlate() local
471 inst = xsphy->phys[index]; in mtk_phy_xlate()
475 if (!inst) { in mtk_phy_xlate()
480 inst->type = args->args[0]; in mtk_phy_xlate()
481 if (!(inst->type == PHY_TYPE_USB2 || in mtk_phy_xlate()
482 inst->type == PHY_TYPE_USB3 || in mtk_phy_xlate()
483 inst->type == PHY_TYPE_PCIE || in mtk_phy_xlate()
484 inst->type == PHY_TYPE_SGMII)) { in mtk_phy_xlate()
485 dev_err(dev, "unsupported phy type: %d\n", inst->type); in mtk_phy_xlate()
489 phy_parse_property(xsphy, inst); in mtk_phy_xlate()
490 phy_type_set(inst); in mtk_phy_xlate()
492 return inst->phy; in mtk_phy_xlate()
553 struct xsphy_instance *inst; in mtk_xsphy_probe() local
557 inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL); in mtk_xsphy_probe()
558 if (!inst) in mtk_xsphy_probe()
561 xsphy->phys[port] = inst; in mtk_xsphy_probe()
576 inst->port_base = devm_ioremap_resource(&phy->dev, &res); in mtk_xsphy_probe()
577 if (IS_ERR(inst->port_base)) { in mtk_xsphy_probe()
579 return PTR_ERR(inst->port_base); in mtk_xsphy_probe()
582 inst->phy = phy; in mtk_xsphy_probe()
583 inst->index = port; in mtk_xsphy_probe()
584 phy_set_drvdata(phy, inst); in mtk_xsphy_probe()
587 inst->ref_clk = devm_clk_get(&phy->dev, "ref"); in mtk_xsphy_probe()
588 if (IS_ERR(inst->ref_clk)) { in mtk_xsphy_probe()
590 return PTR_ERR(inst->ref_clk); in mtk_xsphy_probe()
593 retval = phy_type_syscon_get(inst, child_np); in mtk_xsphy_probe()