Lines Matching refs:phy
30 #include <linux/phy/phy.h>
34 #include <linux/usb/phy.h>
106 * struct rockchip_u3phy_apbcfg: usb3-phy apb configuration.
107 * @u2_pre_emp: usb2-phy pre-emphasis tuning.
108 * @u2_pre_emp_sth: usb2-phy pre-emphasis strength tuning.
109 * @u2_odt_tuning: usb2-phy odt 45ohm tuning.
126 struct phy *phy;
349 dev_dbg(u3phy->dev, "deassert u2 and u3 phy power on reset\n");
410 static int rockchip_u3phy_init(struct phy *phy)
415 static int rockchip_u3phy_exit(struct phy *phy)
420 static int rockchip_u3phy_power_on(struct phy *phy)
422 struct rockchip_u3phy_port *u3phy_port = phy_get_drvdata(phy);
423 struct rockchip_u3phy *u3phy = dev_get_drvdata(phy->dev.parent);
426 dev_info(&u3phy_port->phy->dev, "u3phy %s power on\n", (u3phy_port->type == U3PHY_TYPE_UTMI) ? "u2" : "u3");
465 static int rockchip_u3phy_power_off(struct phy *phy)
467 struct rockchip_u3phy_port *u3phy_port = phy_get_drvdata(phy);
468 struct rockchip_u3phy *u3phy = dev_get_drvdata(phy->dev.parent);
470 dev_info(&u3phy_port->phy->dev, "u3phy %s power off\n", (u3phy_port->type == U3PHY_TYPE_UTMI) ? "u2" : "u3");
504 static __maybe_unused struct phy *rockchip_u3phy_xlate(struct device *dev, struct of_phandle_args *args)
512 dev_err(dev, "invalid number of cells in 'phy' property\n");
517 if (phy_np == u3phy->ports[index].phy->dev.of_node) {
524 dev_err(dev, "failed to find appropriate phy\n");
528 return u3phy_port->phy;
540 * The function manage host-phy port state and suspend/resume phy port
547 * to suspend the phy port in _PHY_STATE_DISCONNECT_ case.
552 struct rockchip_u3phy *u3phy = dev_get_drvdata(u3phy_port->phy->dev.parent);
573 /* stitch on um_ls and um_hstdct as phy state */
579 dev_dbg(&u3phy_port->phy->dev, "HS online\n");
593 dev_dbg(&u3phy_port->phy->dev, "FS/LS online\n");
599 dev_dbg(&u3phy_port->phy->dev, "Connected\n");
600 rockchip_u3phy_power_on(u3phy_port->phy);
604 dev_dbg(&u3phy_port->phy->dev, "FS/LS online\n");
609 dev_dbg(&u3phy_port->phy->dev, "Disconnected\n");
610 rockchip_u3phy_power_off(u3phy_port->phy);
622 * we don't need to rearm the delayed work when the phy port
628 dev_dbg(&u3phy_port->phy->dev, "unknown phy state\n");
640 struct rockchip_u3phy *u3phy = dev_get_drvdata(u3phy_port->phy->dev.parent);
656 * In this case for host phy, a new device is plugged in, meanwhile,
657 * if the phy port is suspended, we need rearm the work to resume it
726 struct phy *phy;
734 phy = devm_phy_create(u3phy->dev, child_np, &rockchip_u3phy_ops);
735 if (IS_ERR(phy)) {
736 dev_err(u3phy->dev, "failed to create phy\n");
737 return PTR_ERR(phy);
740 u3phy_port->phy = phy;
748 u3phy_port->base = devm_ioremap_resource(&u3phy_port->phy->dev, &res);
750 dev_err(u3phy->dev, "failed to remap phy regs\n");
777 phy_set_drvdata(u3phy_port->phy, u3phy_port);
829 dev_err(dev, "phy-cfgs are not assigned!\n");
871 dev_err(dev, "no phy-cfgs can be matched with %s node\n", np->name);