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 <casey.connolly@linaro.org>
This commit is contained in:
Casey Connolly 2026-04-01 16:15:25 +02:00 committed by Tom Rini
parent fae701400d
commit 6c11994b7e

View File

@ -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
*