diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2023-12-15 14:15:34 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-12-17 20:10:07 +0000 |
commit | d63710fc0f1a501fd75a7025e3070a96ffa1645f (patch) | |
tree | e38475640e5cd1259c4fce85eb290578bc0b7b00 /include/linux/phy.h | |
parent | 028672bd1d73cf65249a420c1de75e8d2acd2f6a (diff) | |
download | lwn-d63710fc0f1a501fd75a7025e3070a96ffa1645f.tar.gz lwn-d63710fc0f1a501fd75a7025e3070a96ffa1645f.zip |
net: phy: add support for PHY package MMD read/write
Some PHY in PHY package may require to read/write MMD regs to correctly
configure the PHY package.
Add support for these additional required function in both lock and no
lock variant.
It's assumed that the entire PHY package is either C22 or C45. We use
C22 or C45 way of writing/reading to mmd regs based on the passed phydev
whether it's C22 or C45.
Signed-off-by: Christian Marangi <ansuelsmth@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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index d653f660c39d..e9e85d347587 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -2064,6 +2064,22 @@ static inline int __phy_package_write(struct phy_device *phydev, return __mdiobus_write(phydev->mdio.bus, addr, regnum, val); } +int __phy_package_read_mmd(struct phy_device *phydev, + unsigned int addr_offset, int devad, + u32 regnum); + +int phy_package_read_mmd(struct phy_device *phydev, + unsigned int addr_offset, int devad, + u32 regnum); + +int __phy_package_write_mmd(struct phy_device *phydev, + unsigned int addr_offset, int devad, + u32 regnum, u16 val); + +int phy_package_write_mmd(struct phy_device *phydev, + unsigned int addr_offset, int devad, + u32 regnum, u16 val); + static inline bool __phy_package_set_once(struct phy_device *phydev, unsigned int b) { |