Lines Matching defs:phydev
20 static int bcm_cygnus_afe_config(struct phy_device *phydev)
25 rc = phy_write(phydev, MII_BCM54XX_AUX_CTL, 0x0c30);
30 rc = bcm_phy_write_misc(phydev, 0x39, 0x01, 0xA7C8);
35 rc = bcm_phy_write_misc(phydev, 0x3A, 0x00, 0x0803);
40 rc = bcm_phy_write_misc(phydev, 0x3A, 0x01, 0xA740);
45 rc = bcm_phy_write_misc(phydev, 0x3A, 0x03, 0x8400);
50 rc = bcm_phy_write_misc(phydev, 0x3B, 0x00, 0x0004);
55 rc = phy_write(phydev, MII_BRCM_CORE_BASE1E, 0x02);
60 rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB1, 0x10);
65 rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB0, 0x10);
70 rc = bcm_phy_write_exp_sel(phydev, MII_BRCM_CORE_EXPB0, 0x00);
75 static int bcm_cygnus_config_init(struct phy_device *phydev)
79 reg = phy_read(phydev, MII_BCM54XX_ECR);
85 rc = phy_write(phydev, MII_BCM54XX_ECR, reg);
93 rc = phy_write(phydev, MII_BCM54XX_IMR, reg);
98 rc = bcm_cygnus_afe_config(phydev);
103 rc = bcm_phy_set_eee(phydev, true);
108 return bcm_phy_enable_apd(phydev, false);
111 static int bcm_cygnus_resume(struct phy_device *phydev)
115 genphy_resume(phydev);
120 rc = bcm_cygnus_config_init(phydev);
125 return genphy_config_aneg(phydev);
128 static int bcm_omega_config_init(struct phy_device *phydev)
133 rev = phydev->phy_id & ~phydev->drv->phy_id_mask;
136 phydev_name(phydev), phydev->drv->name, rev);
143 phy_read(phydev, MII_BMSR);
147 ret = bcm_phy_28nm_a0b0_afe_config_init(phydev);
156 ret = bcm_phy_downshift_get(phydev, &count);
161 ret = bcm_phy_set_eee(phydev, count == DOWNSHIFT_DEV_DISABLE);
165 return bcm_phy_enable_apd(phydev, true);
168 static int bcm_omega_resume(struct phy_device *phydev)
173 ret = bcm_omega_config_init(phydev);
182 return genphy_config_aneg(phydev);
185 static int bcm_omega_get_tunable(struct phy_device *phydev,
190 return bcm_phy_downshift_get(phydev, (u8 *)data);
196 static int bcm_omega_set_tunable(struct phy_device *phydev,
205 ret = bcm_phy_downshift_set(phydev, count);
218 ret = bcm_phy_set_eee(phydev, count == DOWNSHIFT_DEV_DISABLE);
222 return genphy_restart_aneg(phydev);
225 static void bcm_omega_get_phy_stats(struct phy_device *phydev,
228 struct bcm_omega_phy_priv *priv = phydev->priv;
230 bcm_phy_get_stats(phydev, priv->stats, stats, data);
233 static int bcm_omega_probe(struct phy_device *phydev)
237 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
241 phydev->priv = priv;
243 priv->stats = devm_kcalloc(&phydev->mdio.dev,
244 bcm_phy_get_sset_count(phydev), sizeof(u64),