diff options
| -rw-r--r-- | drivers/net/phy/at803x.c | 2 | ||||
| -rw-r--r-- | drivers/net/phy/marvell.c | 19 | ||||
| -rw-r--r-- | drivers/net/phy/phy-core.c | 2 | ||||
| -rw-r--r-- | drivers/net/phy/phy_device.c | 6 |
4 files changed, 14 insertions, 15 deletions
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index c2715908d43e..411cf1072bae 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c | |||
| @@ -230,7 +230,7 @@ static int at803x_suspend(struct phy_device *phydev) | |||
| 230 | 230 | ||
| 231 | static int at803x_resume(struct phy_device *phydev) | 231 | static int at803x_resume(struct phy_device *phydev) |
| 232 | { | 232 | { |
| 233 | return phy_modify(phydev, MII_BMCR, ~(BMCR_PDOWN | BMCR_ISOLATE), 0); | 233 | return phy_modify(phydev, MII_BMCR, BMCR_PDOWN | BMCR_ISOLATE, 0); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | static int at803x_probe(struct phy_device *phydev) | 236 | static int at803x_probe(struct phy_device *phydev) |
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 2bd38962b5d2..fd66304f18b7 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
| @@ -668,7 +668,7 @@ static int m88e3016_config_init(struct phy_device *phydev) | |||
| 668 | 668 | ||
| 669 | /* Enable Scrambler and Auto-Crossover */ | 669 | /* Enable Scrambler and Auto-Crossover */ |
| 670 | ret = phy_modify(phydev, MII_88E3016_PHY_SPEC_CTRL, | 670 | ret = phy_modify(phydev, MII_88E3016_PHY_SPEC_CTRL, |
| 671 | ~MII_88E3016_DISABLE_SCRAMBLER, | 671 | MII_88E3016_DISABLE_SCRAMBLER, |
| 672 | MII_88E3016_AUTO_MDIX_CROSSOVER); | 672 | MII_88E3016_AUTO_MDIX_CROSSOVER); |
| 673 | if (ret < 0) | 673 | if (ret < 0) |
| 674 | return ret; | 674 | return ret; |
| @@ -684,9 +684,9 @@ static int m88e1111_config_init_hwcfg_mode(struct phy_device *phydev, | |||
| 684 | mode |= MII_M1111_HWCFG_FIBER_COPPER_AUTO; | 684 | mode |= MII_M1111_HWCFG_FIBER_COPPER_AUTO; |
| 685 | 685 | ||
| 686 | return phy_modify(phydev, MII_M1111_PHY_EXT_SR, | 686 | return phy_modify(phydev, MII_M1111_PHY_EXT_SR, |
| 687 | (u16)~(MII_M1111_HWCFG_MODE_MASK | | 687 | MII_M1111_HWCFG_MODE_MASK | |
| 688 | MII_M1111_HWCFG_FIBER_COPPER_AUTO | | 688 | MII_M1111_HWCFG_FIBER_COPPER_AUTO | |
| 689 | MII_M1111_HWCFG_FIBER_COPPER_RES), | 689 | MII_M1111_HWCFG_FIBER_COPPER_RES, |
| 690 | mode); | 690 | mode); |
| 691 | } | 691 | } |
| 692 | 692 | ||
| @@ -705,8 +705,7 @@ static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev) | |||
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | return phy_modify(phydev, MII_M1111_PHY_EXT_CR, | 707 | return phy_modify(phydev, MII_M1111_PHY_EXT_CR, |
| 708 | (u16)~(MII_M1111_RGMII_RX_DELAY | | 708 | MII_M1111_RGMII_RX_DELAY | MII_M1111_RGMII_TX_DELAY, |
| 709 | MII_M1111_RGMII_TX_DELAY), | ||
| 710 | delay); | 709 | delay); |
| 711 | } | 710 | } |
| 712 | 711 | ||
| @@ -833,7 +832,7 @@ static int m88e1510_config_init(struct phy_device *phydev) | |||
| 833 | 832 | ||
| 834 | /* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */ | 833 | /* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */ |
| 835 | err = phy_modify(phydev, MII_88E1510_GEN_CTRL_REG_1, | 834 | err = phy_modify(phydev, MII_88E1510_GEN_CTRL_REG_1, |
| 836 | ~MII_88E1510_GEN_CTRL_REG_1_MODE_MASK, | 835 | MII_88E1510_GEN_CTRL_REG_1_MODE_MASK, |
| 837 | MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII); | 836 | MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII); |
| 838 | if (err < 0) | 837 | if (err < 0) |
| 839 | return err; | 838 | return err; |
| @@ -957,7 +956,7 @@ static int m88e1145_config_init_rgmii(struct phy_device *phydev) | |||
| 957 | if (err < 0) | 956 | if (err < 0) |
| 958 | return err; | 957 | return err; |
| 959 | 958 | ||
| 960 | err = phy_modify(phydev, 0x1e, 0xf03f, | 959 | err = phy_modify(phydev, 0x1e, 0x0fc0, |
| 961 | 2 << 9 | /* 36 ohm */ | 960 | 2 << 9 | /* 36 ohm */ |
| 962 | 2 << 6); /* 39 ohm */ | 961 | 2 << 6); /* 39 ohm */ |
| 963 | if (err < 0) | 962 | if (err < 0) |
| @@ -1379,7 +1378,7 @@ static int m88e1318_set_wol(struct phy_device *phydev, | |||
| 1379 | 1378 | ||
| 1380 | /* Setup LED[2] as interrupt pin (active low) */ | 1379 | /* Setup LED[2] as interrupt pin (active low) */ |
| 1381 | err = __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, | 1380 | err = __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, |
| 1382 | (u16)~MII_88E1318S_PHY_LED_TCR_FORCE_INT, | 1381 | MII_88E1318S_PHY_LED_TCR_FORCE_INT, |
| 1383 | MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | | 1382 | MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | |
| 1384 | MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW); | 1383 | MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW); |
| 1385 | if (err < 0) | 1384 | if (err < 0) |
| @@ -1419,7 +1418,7 @@ static int m88e1318_set_wol(struct phy_device *phydev, | |||
| 1419 | 1418 | ||
| 1420 | /* Clear WOL status and disable magic packet matching */ | 1419 | /* Clear WOL status and disable magic packet matching */ |
| 1421 | err = __phy_modify(phydev, MII_88E1318S_PHY_WOL_CTRL, | 1420 | err = __phy_modify(phydev, MII_88E1318S_PHY_WOL_CTRL, |
| 1422 | (u16)~MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE, | 1421 | MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE, |
| 1423 | MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS); | 1422 | MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS); |
| 1424 | if (err < 0) | 1423 | if (err < 0) |
| 1425 | goto error; | 1424 | goto error; |
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 44d09b192014..e75989ce8850 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c | |||
| @@ -332,7 +332,7 @@ EXPORT_SYMBOL(phy_write_mmd); | |||
| 332 | * @set: bit mask of bits to set | 332 | * @set: bit mask of bits to set |
| 333 | * | 333 | * |
| 334 | * Unlocked helper function which allows a PHY register to be modified as | 334 | * Unlocked helper function which allows a PHY register to be modified as |
| 335 | * new register value = (old register value & mask) | set | 335 | * new register value = (old register value & ~mask) | set |
| 336 | */ | 336 | */ |
| 337 | int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set) | 337 | int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set) |
| 338 | { | 338 | { |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 2c5b2e041c0f..6bd11a070ec8 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -1393,7 +1393,7 @@ EXPORT_SYMBOL(genphy_setup_forced); | |||
| 1393 | int genphy_restart_aneg(struct phy_device *phydev) | 1393 | int genphy_restart_aneg(struct phy_device *phydev) |
| 1394 | { | 1394 | { |
| 1395 | /* Don't isolate the PHY if we're negotiating */ | 1395 | /* Don't isolate the PHY if we're negotiating */ |
| 1396 | return phy_modify(phydev, MII_BMCR, ~BMCR_ISOLATE, | 1396 | return phy_modify(phydev, MII_BMCR, BMCR_ISOLATE, |
| 1397 | BMCR_ANENABLE | BMCR_ANRESTART); | 1397 | BMCR_ANENABLE | BMCR_ANRESTART); |
| 1398 | } | 1398 | } |
| 1399 | EXPORT_SYMBOL(genphy_restart_aneg); | 1399 | EXPORT_SYMBOL(genphy_restart_aneg); |
| @@ -1666,13 +1666,13 @@ EXPORT_SYMBOL(genphy_suspend); | |||
| 1666 | 1666 | ||
| 1667 | int genphy_resume(struct phy_device *phydev) | 1667 | int genphy_resume(struct phy_device *phydev) |
| 1668 | { | 1668 | { |
| 1669 | return phy_modify(phydev, MII_BMCR, ~BMCR_PDOWN, 0); | 1669 | return phy_modify(phydev, MII_BMCR, BMCR_PDOWN, 0); |
| 1670 | } | 1670 | } |
| 1671 | EXPORT_SYMBOL(genphy_resume); | 1671 | EXPORT_SYMBOL(genphy_resume); |
| 1672 | 1672 | ||
| 1673 | int genphy_loopback(struct phy_device *phydev, bool enable) | 1673 | int genphy_loopback(struct phy_device *phydev, bool enable) |
| 1674 | { | 1674 | { |
| 1675 | return phy_modify(phydev, MII_BMCR, ~BMCR_LOOPBACK, | 1675 | return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, |
| 1676 | enable ? BMCR_LOOPBACK : 0); | 1676 | enable ? BMCR_LOOPBACK : 0); |
| 1677 | } | 1677 | } |
| 1678 | EXPORT_SYMBOL(genphy_loopback); | 1678 | EXPORT_SYMBOL(genphy_loopback); |
