summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNenghua Cao <nhcao@marvell.com>2014-02-19 14:44:13 +0400
committerMark Brown <broonie@linaro.org>2014-03-06 13:40:54 +0400
commit13ff50c85846338bb9820abd3933227b678dc086 (patch)
treee4efb4701572fc0ada5b0e9d8501115e47329d15 /include/linux
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
downloadlinux-13ff50c85846338bb9820abd3933227b678dc086.tar.xz
regmap: add regmap_parse_val api
In some cases, we need regmap's format parse_val function to do be/le translation according to the bus configuration. For example, snd_soc_bytes_put() uses regmap to write/read values, and use cpu_to_be() directly to covert MASK into big endian. This is a defect, and should use regmap's format function to do it according to bus configuration. Signed-off-by: Nenghua Cao <nhcao@marvell.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/regmap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4149f1a9b003..3e1a2e4a92ad 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -423,6 +423,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
int num_regs);
+int regmap_parse_val(struct regmap *map, const void *buf,
+ unsigned int *val);
static inline bool regmap_reg_in_range(unsigned int reg,
const struct regmap_range *range)
@@ -695,6 +697,13 @@ static inline int regmap_register_patch(struct regmap *map,
return -EINVAL;
}
+static inline int regmap_parse_val(struct regmap *map, const void *buf,
+ unsigned int *val)
+{
+ WARN_ONCE(1, "regmap API is disabled");
+ return -EINVAL;
+}
+
static inline struct regmap *dev_get_regmap(struct device *dev,
const char *name)
{