summaryrefslogtreecommitdiff
path: root/include/linux/regmap.h
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2017-12-11 23:43:02 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-19 11:01:03 +0100
commit7d6f7fb053ad543da74119df3c4cd7bb46220471 (patch)
tree61d3a30916655c7b0998a686f83b92d16b3a59e5 /include/linux/regmap.h
parent4b14e62ad3c9e6e6774517f4077e197c0537fb07 (diff)
regmap: add SLIMbus support
This patch adds support to read/write SLIMbus value elements. Currently it only supports byte read/write. Adding this support in regmap would give codec drivers more flexibility when there are more than 2 control interfaces like SLIMbus, i2c. Without this patch each codec driver has to directly call SLIMbus value element apis, and this could would get messy once we want to add i2c interface to it. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviwed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r--include/linux/regmap.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 15eddc1353ba..b2207737a159 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -24,6 +24,7 @@ struct module;
struct device;
struct i2c_client;
struct irq_domain;
+struct slim_device;
struct spi_device;
struct spmi_device;
struct regmap;
@@ -499,6 +500,10 @@ struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name);
+struct regmap *__regmap_init_slimbus(struct slim_device *slimbus,
+ const struct regmap_config *config,
+ struct lock_class_key *lock_key,
+ const char *lock_name);
struct regmap *__regmap_init_spi(struct spi_device *dev,
const struct regmap_config *config,
struct lock_class_key *lock_key,
@@ -616,6 +621,19 @@ int regmap_attach_dev(struct device *dev, struct regmap *map,
i2c, config)
/**
+ * regmap_init_slimbus() - Initialise register map
+ *
+ * @slimbus: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer to
+ * a struct regmap.
+ */
+#define regmap_init_slimbus(slimbus, config) \
+ __regmap_lockdep_wrapper(__regmap_init_slimbus, #config, \
+ slimbus, config)
+
+/**
* regmap_init_spi() - Initialise register map
*
* @dev: Device that will be interacted with