summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-06-16 08:52:55 +0000
committerMark Brown <broonie@kernel.org>2015-07-10 11:38:00 +0100
commite874e6c7edc43436f73cf84157d9221f8b807c36 (patch)
tree876c01fc58578c00968edbe057b1db2edb8c80ad /drivers/base
parentfd4b7286ccc469bf5dde22db6b8fcc455c3c4a66 (diff)
downloadlinux-stable-e874e6c7edc43436f73cf84157d9221f8b807c36.tar.gz
linux-stable-e874e6c7edc43436f73cf84157d9221f8b807c36.tar.bz2
linux-stable-e874e6c7edc43436f73cf84157d9221f8b807c36.zip
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')
-rw-r--r--drivers/base/regmap/regmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index d93bb9a8ab98..dd63bcbbf8a5 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