[PATCH] regmap: Implement regmap_[set|clear]_bits()
Sascha Hauer
s.hauer at pengutronix.de
Tue Jan 18 00:29:11 PST 2022
regmap_[set|clear]_bits() are useful shortcuts to regmap_update_bits().
Implement them.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
include/regmap.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/regmap.h b/include/regmap.h
index db84c7a534..4b30c21776 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -130,6 +130,18 @@ int regmap_write_bits(struct regmap *map, unsigned int reg,
int regmap_update_bits(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val);
+static inline int regmap_set_bits(struct regmap *map,
+ unsigned int reg, unsigned int bits)
+{
+ return regmap_update_bits(map, reg, bits, bits);
+}
+
+static inline int regmap_clear_bits(struct regmap *map,
+ unsigned int reg, unsigned int bits)
+{
+ return regmap_update_bits(map, reg, bits, 0);
+}
+
/**
* regmap_read_poll_timeout - Poll until a condition is met or a timeout occurs
*
--
2.30.2
More information about the barebox
mailing list