summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSudheer Papothi <spapothi@codeaurora.org>2015-12-02 05:21:22 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:13:10 -0700
commit7b9c5205f5c53153a1802c0fb847ebce573eb18f (patch)
tree6b503b6cb9eb7c7aee709de75ae3638540811553 /include/linux
parentf95641a7b7d6c5fe48f9ee18dd1437c777d5543a (diff)
soundwire: Add support to use group id for slave devices
Devices with the same group id or broadcast command can be configured simultaneously. This will help improve the latency during device configuration. Add support to use group id for slave device configuration. Change-Id: I5e86e61a0b5223de6c6471f3f342fe1f387d81ef Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Diffstat (limited to 'include/linux')
-rwxr-xr-xinclude/linux/soundwire/soundwire.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/soundwire/soundwire.h b/include/linux/soundwire/soundwire.h
index ecf2d1baf418..f19e871d6ac2 100755
--- a/include/linux/soundwire/soundwire.h
+++ b/include/linux/soundwire/soundwire.h
@@ -29,6 +29,14 @@ extern struct bus_type soundwire_type;
*/
#define SWR_MAX_MSTR_PORT_NUM (SWR_MAX_DEV_NUM * SWR_MAX_DEV_PORT_NUM)
+/* Indicates soundwire devices group information */
+enum {
+ SWR_GROUP_NONE = 0,
+ SWR_GROUP_12 = 12,
+ SWR_GROUP_13 = 13,
+ SWR_BROADCAST = 15,
+};
+
/*
* struct swr_port_info - represent soundwire frame shape
* @dev_id: logical device number of the soundwire slave device
@@ -112,6 +120,7 @@ struct swr_reg {
* @last_tid: size of table port_txn (can't grow beyond 256 since
* tid is 8 bits)
* @num_port: number of active ports on soundwire master
+ * @gr_sid: slave id used by the group for write operations
* @connect_port: callback for configuration of soundwire port(s)
* @disconnect_port: callback for disable of soundwire port(s)
* @read: callback for soundwire slave register read
@@ -131,6 +140,7 @@ struct swr_master {
u8 last_tid;
u8 num_port;
u8 num_dev;
+ u8 gr_sid;
int (*connect_port)(struct swr_master *mstr, struct swr_params *txn);
int (*disconnect_port)(struct swr_master *mstr, struct swr_params *txn);
int (*read)(struct swr_master *mstr, u8 dev_num, u16 reg_addr,
@@ -159,6 +169,7 @@ static inline struct swr_master *to_swr_master(struct device *dev)
* @dev: driver model representation of the device
* @addr: represents "ea-addr" which is unique-id of soundwire slave
* device
+ * @group_id: group id supported by the slave device
*/
struct swr_device {
char name[SOUNDWIRE_NAME_SIZE];
@@ -168,6 +179,7 @@ struct swr_device {
u8 dev_num;
struct device dev;
unsigned long addr;
+ u8 group_id;
};
static inline struct swr_device *to_swr_device(struct device *dev)
@@ -270,6 +282,8 @@ extern int swr_connect_port(struct swr_device *dev, u8 *port_id, u8 num_port,
extern int swr_disconnect_port(struct swr_device *dev,
u8 *port_id, u8 num_port);
+extern int swr_set_device_group(struct swr_device *swr_dev, u8 id);
+
extern int swr_driver_register(struct swr_driver *drv);
extern void swr_driver_unregister(struct swr_driver *drv);