diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-02-15 05:23:55 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-20 01:15:56 +0900 |
commit | 28972eaa34f384eef5e33f36e00d8fa21ca44375 (patch) | |
tree | 113f7dc3080e7fd4744a89438ae14cd4bec48191 /drivers/base | |
parent | 89d8d4b833b0b29e0e95bd0cd51e80f5ee7a6b0a (diff) |
regmap: add regmap_field_update_bits_base()
This patch adds new regmap_field_update_bits_base() which is using
regmap_update_bits_base().
Current regmap_field_xxx() can be merged into it by macro.
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.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 015135a656b7..e534105f47f6 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1690,6 +1690,33 @@ int regmap_raw_write(struct regmap *map, unsigned int reg, EXPORT_SYMBOL_GPL(regmap_raw_write); /** + * regmap_field_update_bits_base(): + * Perform a read/modify/write cycle on the register field + * with change, async, force option + * + * @field: Register field to write to + * @mask: Bitmask to change + * @val: Value to be written + * @change: Boolean indicating if a write was done + * @async: Boolean indicating asynchronously + * @force: Boolean indicating use force update + * + * A value of zero will be returned on success, a negative errno will + * be returned in error cases. + */ +int regmap_field_update_bits_base(struct regmap_field *field, + unsigned int mask, unsigned int val, + bool *change, bool async, bool force) +{ + mask = (mask << field->shift) & field->mask; + + return regmap_update_bits_base(field->regmap, field->reg, + mask, val << field->shift, + change, async, force); +} +EXPORT_SYMBOL_GPL(regmap_field_update_bits_base); + +/** * regmap_field_write(): Write a value to a single register field * * @field: Register field to write to |