From a3787cd1bb0b290de44c8e947db742057c71011b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 18 Jan 2022 09:28:21 +0100 Subject: regmap: Implement regmap_[set|clear]_bits() regmap_[set|clear]_bits() are useful shortcuts to regmap_update_bits(). Implement them. Signed-off-by: Sascha Hauer --- include/regmap.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') 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 * -- cgit v1.2.3