[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200530115142.707415-2-olteanv@gmail.com>
Date: Sat, 30 May 2020 14:51:30 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, andrew@...n.ch, vivien.didelot@...il.com,
f.fainelli@...il.com, antoine.tenart@...tlin.com,
alexandre.belloni@...tlin.com, UNGLinuxDriver@...rochip.com,
alexandru.marginean@....com, claudiu.manoil@....com,
madalin.bucur@....nxp.com, radu-andrei.bulie@....com,
fido_max@...ox.ru, broonie@...nel.org
Subject: [PATCH v2 net-next 01/13] regmap: add helper for per-port regfield initialization
From: Vladimir Oltean <vladimir.oltean@....com>
Similar to the standalone regfields, add an initializer for the users
who need to set .id_size and .id_offset in order to use the
regmap_fields_update_bits_base API.
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Link: https://lore.kernel.org/r/20200527234113.2491988-2-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@...nel.org>
---
include/linux/regmap.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 40b07168fd8e..87703d105191 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1134,6 +1134,14 @@ struct reg_field {
.msb = _msb, \
}
+#define REG_FIELD_ID(_reg, _lsb, _msb, _size, _offset) { \
+ .reg = _reg, \
+ .lsb = _lsb, \
+ .msb = _msb, \
+ .id_size = _size, \
+ .id_offset = _offset, \
+ }
+
struct regmap_field *regmap_field_alloc(struct regmap *regmap,
struct reg_field reg_field);
void regmap_field_free(struct regmap_field *field);
--
2.25.1
Powered by blists - more mailing lists