aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2018-01-02 05:58:43 -0500
committerDavid S. Miller <davem@davemloft.net>2018-01-03 11:00:23 -0500
commit78ffc4acceff48522b92d8fbf8f4a0ffe78838b2 (patch)
tree239eb8dcdabb14866e308f8bb895f6a5f4a3137a /include
parent788f9933db6172801336d0ae2dec5bdc7525389f (diff)
net: phy: add paged phy register accessors
Add a set of paged phy register accessors which are inherently safe in their design against other accesses interfering with the paged access. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/phy.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 0c5a28520c65..af1a740dafd4 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -634,6 +634,9 @@ struct phy_driver {
634 int (*write_mmd)(struct phy_device *dev, int devnum, u16 regnum, 634 int (*write_mmd)(struct phy_device *dev, int devnum, u16 regnum,
635 u16 val); 635 u16 val);
636 636
637 int (*read_page)(struct phy_device *dev);
638 int (*write_page)(struct phy_device *dev, int page);
639
637 /* Get the size and type of the eeprom contained within a plug-in 640 /* Get the size and type of the eeprom contained within a plug-in
638 * module */ 641 * module */
639 int (*module_info)(struct phy_device *dev, 642 int (*module_info)(struct phy_device *dev,
@@ -838,6 +841,14 @@ static inline bool phy_is_pseudo_fixed_link(struct phy_device *phydev)
838 */ 841 */
839int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val); 842int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val);
840 843
844int phy_save_page(struct phy_device *phydev);
845int phy_select_page(struct phy_device *phydev, int page);
846int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
847int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);
848int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
849int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
850 u16 mask, u16 set);
851
841struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, 852struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
842 bool is_c45, 853 bool is_c45,
843 struct phy_c45_device_ids *c45_ids); 854 struct phy_c45_device_ids *c45_ids);