summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCasey Connolly <[email protected]>2026-04-01 16:15:25 +0200
committerTom Rini <[email protected]>2026-04-21 11:19:49 -0600
commit6c11994b7e7b324ea41e6d62e9a73dc430ea0df8 (patch)
tree5d8923c2850c5f5d1e6b54456e5c80b9955b1842 /include
parentfae701400dd040165d713993b06239f3b4dcd9b9 (diff)
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 <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/regmap.h9
1 files changed, 9 insertions, 0 deletions
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
*