Commit e874e6c7 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

regmap: add regmap_fields_force_write()

regmap_fields_force_write() is similar to regmap_fields_write(),
but regmap_fields_force_write() write data to register even though
it is same value.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fd4b7286
...@@ -1624,6 +1624,18 @@ int regmap_fields_write(struct regmap_field *field, unsigned int id, ...@@ -1624,6 +1624,18 @@ int regmap_fields_write(struct regmap_field *field, unsigned int id,
} }
EXPORT_SYMBOL_GPL(regmap_fields_write); EXPORT_SYMBOL_GPL(regmap_fields_write);
int regmap_fields_force_write(struct regmap_field *field, unsigned int id,
unsigned int val)
{
if (id >= field->id_size)
return -EINVAL;
return regmap_write_bits(field->regmap,
field->reg + (field->id_offset * id),
field->mask, val << field->shift);
}
EXPORT_SYMBOL_GPL(regmap_fields_force_write);
/** /**
* regmap_fields_update_bits(): Perform a read/modify/write cycle * regmap_fields_update_bits(): Perform a read/modify/write cycle
* on the register field * on the register field
......
...@@ -505,6 +505,8 @@ int regmap_field_update_bits(struct regmap_field *field, ...@@ -505,6 +505,8 @@ int regmap_field_update_bits(struct regmap_field *field,
int regmap_fields_write(struct regmap_field *field, unsigned int id, int regmap_fields_write(struct regmap_field *field, unsigned int id,
unsigned int val); unsigned int val);
int regmap_fields_force_write(struct regmap_field *field, unsigned int id,
unsigned int val);
int regmap_fields_read(struct regmap_field *field, unsigned int id, int regmap_fields_read(struct regmap_field *field, unsigned int id,
unsigned int *val); unsigned int *val);
int regmap_fields_update_bits(struct regmap_field *field, unsigned int id, int regmap_fields_update_bits(struct regmap_field *field, unsigned int id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment