diff options
author | Sudheer Papothi <spapothi@codeaurora.org> | 2016-01-30 05:00:55 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:11:01 -0700 |
commit | fef4c4cb854e5a841c88de7621a51fadf5ec0cb3 (patch) | |
tree | 6a838fac48681cae1ef8c64206d8f8768c3ecf7d /include/linux/regmap.h | |
parent | b2f4078131365d25d7decf0b2020ba8c70a4cc27 (diff) |
regmap: Add soundwire bus support
Add soundwire bus support to regmap. This change enables
codec drivers using soundwire hardware interface to use
regmap interface for register read/write functionality.
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Diffstat (limited to 'include/linux/regmap.h')
-rw-r--r-- | include/linux/regmap.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index d68bb402120e..ab1a11cbfd25 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -29,6 +29,7 @@ struct regmap; struct regmap_range_cfg; struct regmap_field; struct snd_ac97; +struct swr_device; /* An enum of all the supported cache types */ enum regcache_type { @@ -387,7 +388,10 @@ struct regmap *__regmap_init_ac97(struct snd_ac97 *ac97, const struct regmap_config *config, struct lock_class_key *lock_key, const char *lock_name); - +struct regmap *__regmap_init_swr(struct swr_device *dev, + const struct regmap_config *config, + struct lock_class_key *lock_key, + const char *lock_name); struct regmap *__devm_regmap_init(struct device *dev, const struct regmap_bus *bus, void *bus_context, @@ -420,6 +424,10 @@ struct regmap *__devm_regmap_init_ac97(struct snd_ac97 *ac97, const struct regmap_config *config, struct lock_class_key *lock_key, const char *lock_name); +struct regmap *__devm_regmap_init_swr(struct swr_device *dev, + const struct regmap_config *config, + struct lock_class_key *lock_key, + const char *lock_name); /* * Wrapper for regmap_init macros to include a unique lockdep key and name @@ -554,6 +562,18 @@ int regmap_attach_dev(struct device *dev, struct regmap *map, bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); /** + * regmap_init_swr(): Initialise register map + * + * @swr: 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_swr(swr, config) \ + __regmap_lockdep_wrapper(__regmap_init_swr, #config, \ + swr, config) +/** * devm_regmap_init(): Initialise managed register map * * @dev: Device that will be interacted with @@ -668,6 +688,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); __regmap_lockdep_wrapper(__devm_regmap_init_ac97, #config, \ ac97, config) +/** + * devm_regmap_init_swr(): Initialise managed register map + * + * @swr: 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. The regmap will be automatically freed by the + * device management code. + */ +#define devm_regmap_init_swr(swr, config) \ + __regmap_lockdep_wrapper(__devm_regmap_init_swr, #config, \ + swr, config) + void regmap_exit(struct regmap *map); int regmap_reinit_cache(struct regmap *map, const struct regmap_config *config); |