From 6c11994b7e7b324ea41e6d62e9a73dc430ea0df8 Mon Sep 17 00:00:00 2001 From: Casey Connolly Date: Wed, 1 Apr 2026 16:15:25 +0200 Subject: regmap: add regmap_assign_bits This is a simple wrapper around set/clear bits used by drivers in Linux. Add it here so it can be used by Qualcomm CCF clk drivers. Signed-off-by: Casey Connolly --- include/regmap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/regmap.h b/include/regmap.h index 8c6f7c1c9b1..eeae843bfb7 100644 --- a/include/regmap.h +++ b/include/regmap.h @@ -389,6 +389,15 @@ static inline int regmap_clear_bits(struct regmap *map, uint offset, uint bits) return regmap_update_bits(map, offset, bits, 0); } +static inline int regmap_assign_bits(struct regmap *map, unsigned int reg, + unsigned int bits, bool value) +{ + if (value) + return regmap_set_bits(map, reg, bits); + else + return regmap_clear_bits(map, reg, bits); +} + /** * regmap_init_mem() - Set up a new register map that uses memory access * -- cgit v1.2.3