Lines Matching refs:u3phy

129 static void phy_instance_init(struct mt65xx_u3phy *u3phy,  in phy_instance_init()  argument
193 dev_dbg(u3phy->dev, "%s(%d)\n", __func__, index); in phy_instance_init()
196 static void phy_instance_power_on(struct mt65xx_u3phy *u3phy, in phy_instance_power_on() argument
222 tmp = readl(u3phy->sif_base + U3P_XTALCTL3); in phy_instance_power_on()
224 writel(tmp, u3phy->sif_base + U3P_XTALCTL3); in phy_instance_power_on()
252 dev_dbg(u3phy->dev, "%s(%d)\n", __func__, index); in phy_instance_power_on()
255 static void phy_instance_power_off(struct mt65xx_u3phy *u3phy, in phy_instance_power_off() argument
300 dev_dbg(u3phy->dev, "%s(%d)\n", __func__, index); in phy_instance_power_off()
303 static void phy_instance_exit(struct mt65xx_u3phy *u3phy, in phy_instance_exit() argument
324 struct mt65xx_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); in mt65xx_phy_init() local
327 ret = clk_prepare_enable(u3phy->u3phya_ref); in mt65xx_phy_init()
329 dev_err(u3phy->dev, "failed to enable u3phya_ref\n"); in mt65xx_phy_init()
333 phy_instance_init(u3phy, instance); in mt65xx_phy_init()
340 struct mt65xx_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); in mt65xx_phy_power_on() local
342 phy_instance_power_on(u3phy, instance); in mt65xx_phy_power_on()
349 struct mt65xx_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); in mt65xx_phy_power_off() local
351 phy_instance_power_off(u3phy, instance); in mt65xx_phy_power_off()
358 struct mt65xx_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); in mt65xx_phy_exit() local
360 phy_instance_exit(u3phy, instance); in mt65xx_phy_exit()
361 clk_disable_unprepare(u3phy->u3phya_ref); in mt65xx_phy_exit()
368 struct mt65xx_u3phy *u3phy = dev_get_drvdata(dev); in mt65xx_phy_xlate() local
379 for (index = 0; index < u3phy->nphys; index++) in mt65xx_phy_xlate()
380 if (phy_np == u3phy->phys[index]->phy->dev.of_node) { in mt65xx_phy_xlate()
381 instance = u3phy->phys[index]; in mt65xx_phy_xlate()
416 struct mt65xx_u3phy *u3phy; in mt65xx_u3phy_probe() local
420 u3phy = devm_kzalloc(dev, sizeof(*u3phy), GFP_KERNEL); in mt65xx_u3phy_probe()
421 if (!u3phy) in mt65xx_u3phy_probe()
424 u3phy->nphys = of_get_child_count(np); in mt65xx_u3phy_probe()
425 u3phy->phys = devm_kcalloc(dev, u3phy->nphys, in mt65xx_u3phy_probe()
426 sizeof(*u3phy->phys), GFP_KERNEL); in mt65xx_u3phy_probe()
427 if (!u3phy->phys) in mt65xx_u3phy_probe()
430 u3phy->dev = dev; in mt65xx_u3phy_probe()
431 platform_set_drvdata(pdev, u3phy); in mt65xx_u3phy_probe()
434 u3phy->sif_base = devm_ioremap_resource(dev, sif_res); in mt65xx_u3phy_probe()
435 if (IS_ERR(u3phy->sif_base)) { in mt65xx_u3phy_probe()
437 return PTR_ERR(u3phy->sif_base); in mt65xx_u3phy_probe()
440 u3phy->u3phya_ref = devm_clk_get(dev, "u3phya_ref"); in mt65xx_u3phy_probe()
441 if (IS_ERR(u3phy->u3phya_ref)) { in mt65xx_u3phy_probe()
443 return PTR_ERR(u3phy->u3phya_ref); in mt65xx_u3phy_probe()
457 u3phy->phys[port] = instance; in mt65xx_u3phy_probe()