mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-04 20:26:13 +02:00
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:
parent
fae701400d
commit
6c11994b7e
@ -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
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user