regmap: add regmap_fields_force_xxx() macros
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 15 Feb 2016 05:26:14 +0000 (05:26 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 26 Feb 2016 02:44:00 +0000 (11:44 +0900)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c
include/linux/regmap.h

index 79d7f51019d74487337e3b6a53f37a25ab058ad4..c7d4a636778dd4bb03d1a77fcc0c8954f4264bcd 100644 (file)
@@ -1748,18 +1748,6 @@ int regmap_fields_update_bits_base(struct regmap_field *field,  unsigned int id,
 }
 EXPORT_SYMBOL_GPL(regmap_fields_update_bits_base);
 
-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_bulk_write(): Write multiple registers to the device
  *
index d36ea89adc50074003ccc3af29be5f49d098a41c..e0960b3ff29068b9a434e6527c3c71e71fb7ad91 100644 (file)
@@ -85,8 +85,12 @@ struct reg_sequence {
 
 #define        regmap_fields_write(field, id, val) \
        regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, false)
+#define        regmap_fields_force_write(field, id, val) \
+       regmap_fields_update_bits_base(field, id, ~0, val, NULL, false, true)
 #define        regmap_fields_update_bits(field, id, mask, val)\
        regmap_fields_update_bits_base(field, id, mask, val, NULL, false, false)
+#define        regmap_fields_force_update_bits(field, id, mask, val) \
+       regmap_fields_update_bits_base(field, id, mask, val, NULL, false, true)
 
 #ifdef CONFIG_REGMAP
 
@@ -789,8 +793,6 @@ int regmap_field_read(struct regmap_field *field, unsigned int *val);
 int regmap_field_update_bits_base(struct regmap_field *field,
                                  unsigned int mask, unsigned int val,
                                  bool *change, bool async, bool force);
-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,
                       unsigned int *val);
 int regmap_fields_update_bits_base(struct regmap_field *field,  unsigned int id,