summaryrefslogtreecommitdiff
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2023-01-16 14:15:09 +0300
committerMark Brown <broonie@kernel.org>2023-01-16 16:16:09 +0300
commit7b3c4c370c09313e22b555e79167e73d233611d1 (patch)
tree15b28c5ece5bc789521bf5d5f768f94c80ecadbd /include/linux/regmap.h
parent1b929c02afd37871d5afb9d498426f83432e71c2 (diff)
downloadlinux-7b3c4c370c09313e22b555e79167e73d233611d1.tar.xz
regmap: Rework regmap_mdio_c45_{read|write} for new C45 API.
The MDIO subsystem is getting rid of MII_ADDR_C45 and thus also encoding associated encoding of the C45 device address and register address into one value. regmap-mdio also uses this encoding for the C45 bus. Move to the new C45 helpers for MDIO access and provide regmap-mdio helper macros. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20230116111509.4086236-1-michael@walle.cc Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index a3bc695bcca0..029b9e09d3ca 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -38,6 +38,14 @@ struct regmap_field;
struct snd_ac97;
struct sdw_slave;
+/*
+ * regmap_mdio address encoding. IEEE 802.3ae clause 45 addresses consist of a
+ * device address and a register address.
+ */
+#define REGMAP_MDIO_C45_DEVAD_SHIFT 16
+#define REGMAP_MDIO_C45_DEVAD_MASK GENMASK(20, 16)
+#define REGMAP_MDIO_C45_REGNUM_MASK GENMASK(15, 0)
+
/* An enum of all the supported cache types */
enum regcache_type {
REGCACHE_NONE,