diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-08-22 21:55:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-23 14:39:09 -0400 |
commit | 66ce7fb9807b036058aa380bfd2b3851ae25ce39 (patch) | |
tree | 22af492482c1156cde345f00905baea457db6bc8 /include/linux/phy.h | |
parent | a2dbba7674468ad03aa6cf4378ed0965f453e034 (diff) |
net: phy: export phy_{read,write}_mmd_indirect
Some PHY drivers might need to access Clause 45 registers in Clause 22
compatibility mode to e.g: properly advertise EEE support when disabled
by default.
Export these two helper functions: phy_read_mmd_indirect() and
phy_write_mmd_indirect() for drivers to use them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r-- | include/linux/phy.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index ed39956b5613..d090cfcaa167 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -598,6 +598,19 @@ static inline int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum) | |||
598 | } | 598 | } |
599 | 599 | ||
600 | /** | 600 | /** |
601 | * phy_read_mmd_indirect - reads data from the MMD registers | ||
602 | * @phydev: The PHY device bus | ||
603 | * @prtad: MMD Address | ||
604 | * @devad: MMD DEVAD | ||
605 | * @addr: PHY address on the MII bus | ||
606 | * | ||
607 | * Description: it reads data from the MMD registers (clause 22 to access to | ||
608 | * clause 45) of the specified phy address. | ||
609 | */ | ||
610 | int phy_read_mmd_indirect(struct phy_device *phydev, int prtad, | ||
611 | int devad, int addr); | ||
612 | |||
613 | /** | ||
601 | * phy_read - Convenience function for reading a given PHY register | 614 | * phy_read - Convenience function for reading a given PHY register |
602 | * @phydev: the phy_device struct | 615 | * @phydev: the phy_device struct |
603 | * @regnum: register number to read | 616 | * @regnum: register number to read |
@@ -668,6 +681,20 @@ static inline int phy_write_mmd(struct phy_device *phydev, int devad, | |||
668 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 681 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
669 | } | 682 | } |
670 | 683 | ||
684 | /** | ||
685 | * phy_write_mmd_indirect - writes data to the MMD registers | ||
686 | * @phydev: The PHY device | ||
687 | * @prtad: MMD Address | ||
688 | * @devad: MMD DEVAD | ||
689 | * @addr: PHY address on the MII bus | ||
690 | * @data: data to write in the MMD register | ||
691 | * | ||
692 | * Description: Write data from the MMD registers of the specified | ||
693 | * phy address. | ||
694 | */ | ||
695 | void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, | ||
696 | int devad, int addr, u32 data); | ||
697 | |||
671 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, | 698 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
672 | bool is_c45, | 699 | bool is_c45, |
673 | struct phy_c45_device_ids *c45_ids); | 700 | struct phy_c45_device_ids *c45_ids); |