[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220905092007.1999943-3-oliver@schinagl.nl>
Date: Mon, 5 Sep 2022 11:20:07 +0200
From: Olliver Schinagl <oliver@...inagl.nl>
To: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>
Cc: inux-kernel@...r.kernel.org,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Olliver Schinagl <oliver@...inagl.nl>
Subject: [PATCH 2/2] phy: Add helpers for setting/clearing bits in paged registers
As we have helpers for setting/clearing bits in PHY registers and MMD
registers, add also helpers to do the same with paged registers.
Signed-off-by: Olliver Schinagl <oliver@...inagl.nl>
---
include/linux/phy.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 7a2332615b8b..c9be4e6c676b 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1272,6 +1272,32 @@ static inline int phy_clear_bits_mmd(struct phy_device *phydev, int devad,
return phy_modify_mmd(phydev, devad, regnum, val, 0);
}
+/**
+ * phy_set_bits_paged - Convenience function for setting bits in a paged register
+ * @phydev: the phy_device struct
+ * @page: the page for the phy
+ * @regnum: register number to write
+ * @val: bits to set
+ */
+static inline int phy_set_bits_paged(struct phy_device *phydev, int page,
+ u32 regnum, u16 val)
+{
+ return phy_modify_paged(phydev, page, regnum, 0, val);
+}
+
+/**
+ * phy_clear_bits_paged - Convenience function for clearing bits in a paged register
+ * @phydev: the phy_device struct
+ * @page: the page for the phy
+ * @regnum: register number to write
+ * @val: bits to clear
+ */
+static inline int phy_clear_bits_paged(struct phy_device *phydev, int page,
+ u32 regnum, u16 val)
+{
+ return phy_modify_paged(phydev, page, regnum, val, 0);
+}
+
/**
* phy_interrupt_is_valid - Convenience function for testing a given PHY irq
* @phydev: the phy_device struct
--
2.37.2
Powered by blists - more mailing lists