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