net: dsa: microchip: add ksz_prmw32() helper
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 20 Jun 2023 11:38:53 +0000 (13:38 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Jun 2023 02:48:37 +0000 (19:48 -0700)
This will be used in a subsequent patch fixing an errata for writes to
certain PHY registers.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Link: https://lore.kernel.org/r/20230620113855.733526-3-linux@rasmusvillemoes.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz_common.h

index 2453c43..28444e5 100644 (file)
@@ -582,6 +582,13 @@ static inline int ksz_prmw8(struct ksz_device *dev, int port, int offset,
                        mask, val);
 }
 
+static inline int ksz_prmw32(struct ksz_device *dev, int port, int offset,
+                            u32 mask, u32 val)
+{
+       return ksz_rmw32(dev, dev->dev_ops->get_port_addr(port, offset),
+                        mask, val);
+}
+
 static inline void ksz_regmap_lock(void *__mtx)
 {
        struct mutex *mtx = __mtx;