Lines Matching defs:phy
14 #include <linux/phy/phy.h>
44 static inline void p2u_writel(struct tegra_p2u *phy, const u32 value,
47 writel_relaxed(value, phy->base + reg);
50 static inline u32 p2u_readl(struct tegra_p2u *phy, const u32 reg)
52 return readl_relaxed(phy->base + reg);
55 static int tegra_p2u_power_on(struct phy *x)
57 struct tegra_p2u *phy = phy_get_drvdata(x);
60 if (phy->skip_sz_protection_en) {
61 val = p2u_readl(phy, P2U_CONTROL_CMN);
63 p2u_writel(phy, val, P2U_CONTROL_CMN);
66 val = p2u_readl(phy, P2U_PERIODIC_EQ_CTRL_GEN3);
69 p2u_writel(phy, val, P2U_PERIODIC_EQ_CTRL_GEN3);
71 val = p2u_readl(phy, P2U_PERIODIC_EQ_CTRL_GEN4);
73 p2u_writel(phy, val, P2U_PERIODIC_EQ_CTRL_GEN4);
75 val = p2u_readl(phy, P2U_RX_DEBOUNCE_TIME);
78 p2u_writel(phy, val, P2U_RX_DEBOUNCE_TIME);
80 if (phy->of_data->one_dir_search) {
81 val = p2u_readl(phy, P2U_DIR_SEARCH_CTRL);
83 p2u_writel(phy, val, P2U_DIR_SEARCH_CTRL);
89 static int tegra_p2u_calibrate(struct phy *x)
91 struct tegra_p2u *phy = phy_get_drvdata(x);
94 val = p2u_readl(phy, P2U_CONTROL_CMN);
96 p2u_writel(phy, val, P2U_CONTROL_CMN);
111 struct phy *generic_phy;
112 struct tegra_p2u *phy;
114 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
115 if (!phy)
118 phy->of_data =
120 if (!phy->of_data)
123 phy->base = devm_platform_ioremap_resource_byname(pdev, "ctl");
124 if (IS_ERR(phy->base))
125 return PTR_ERR(phy->base);
127 phy->skip_sz_protection_en =
131 platform_set_drvdata(pdev, phy);
137 phy_set_drvdata(generic_phy, phy);