Netdev List
 help / color / mirror / Atom feed
* [PATCH] phy: Add helpers for setting/clearing bits in paged registers
@ 2022-09-04 22:55 Olliver Schinagl
  2022-09-05  0:05 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Olliver Schinagl @ 2022-09-04 22:55 UTC (permalink / raw)
  To: netdev, Andrew Lunn
  Cc: inux-kernel, Heiner Kallweit, Russell King, Olliver Schinagl

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@schinagl.nl>
---
 include/linux/phy.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 87638c55d844..6f13dc9b4fe5 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1262,6 +1262,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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-09  1:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-04 22:55 [PATCH] phy: Add helpers for setting/clearing bits in paged registers Olliver Schinagl
2022-09-05  0:05 ` kernel test robot
2022-09-05  1:18 ` kernel test robot
2022-09-09  1:33 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox