Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb13c65f authored by Sudheer Papothi's avatar Sudheer Papothi Committed by Gerrit - the friendly Code Review server
Browse files

soc: soundwire: update regmap support for soundwire



Update regmap support for soundwire interface. This change
adds init function to initialize soundwire register map.

Change-Id: I9a6eee5c0ca507cafdf6416a4adea4e60b714eba
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 2e7fc986
Loading
Loading
Loading
Loading
+36 −1
Original line number Diff line number Diff line
@@ -7,10 +7,12 @@
#define _LINUX_SOUNDWIRE_H
#include <linux/device.h>
#include <linux/mutex.h>
#include "audio_mod_devicetable.h"
#include <linux/irqdomain.h>
#include <linux/regmap.h>
#include "audio_mod_devicetable.h"

extern struct bus_type soundwire_type;
struct swr_device;

/* Soundwire supports max. of 8 channels per port */
#define SWR_MAX_CHANNEL_NUM	8
@@ -23,6 +25,39 @@ extern struct bus_type soundwire_type;
 */
#define SWR_MAX_MSTR_PORT_NUM	(SWR_MAX_DEV_NUM * SWR_MAX_DEV_PORT_NUM)

/* Regmap support for soundwire interface */
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);

/**
 * 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_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)

/* Indicates soundwire devices group information */
enum {
	SWR_GROUP_NONE = 0,