From abedd757baffbea72addb389ae5dafbf762e10cf Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Tue, 23 Jan 2018 09:40:52 +0800 Subject: [PATCH] regmap: Add soundwire bus support Add soundwire bus support to regmap. This change add init function to initialise soundwire register map. Change-Id: Ib45da17e62468bfc2d4dcfc5acf6534ef1150ba9 Signed-off-by: Meng Wang --- include/linux/regmap.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 379505a53722..1f42332e17ef 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -34,6 +34,7 @@ struct regmap_range_cfg; struct regmap_field; struct snd_ac97; struct sdw_slave; +struct swr_device; /* An enum of all the supported cache types */ enum regcache_type { @@ -610,6 +611,10 @@ struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus, 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 * for each call. No-op if CONFIG_LOCKDEP is not set. @@ -796,6 +801,18 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); __regmap_lockdep_wrapper(__regmap_init_sdw, #config, \ sdw, config) +/** + * 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 @@ -968,6 +985,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg); #define devm_regmap_init_slimbus(slimbus, config) \ __regmap_lockdep_wrapper(__devm_regmap_init_slimbus, #config, \ slimbus, 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) + int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk); void regmap_mmio_detach_clk(struct regmap *map); void regmap_exit(struct regmap *map);