diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-06-16 08:52:55 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-10 11:38:00 +0100 |
commit | e874e6c7edc43436f73cf84157d9221f8b807c36 (patch) | |
tree | 876c01fc58578c00968edbe057b1db2edb8c80ad /drivers/base/regmap | |
parent | fd4b7286ccc469bf5dde22db6b8fcc455c3c4a66 (diff) | |
download | op-kernel-dev-e874e6c7edc43436f73cf84157d9221f8b807c36.zip op-kernel-dev-e874e6c7edc43436f73cf84157d9221f8b807c36.tar.gz |
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r-- | drivers/base/regmap/regmap.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index d93bb9a..dd63bcb 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1624,6 +1624,18 @@ int regmap_fields_write(struct regmap_field *field, unsigned int id, } 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 * on the register field |