diff options
author | Sudheer Papothi <spapothi@codeaurora.org> | 2015-11-24 06:33:40 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:12:01 -0700 |
commit | 4bf1c7f330f0e7e507b942b4a1998c8e8533caae (patch) | |
tree | e454c47132e01c06e846b0663826c5d62824b9f9 /drivers | |
parent | ac94acf4a923ad08a066828f88e159ae8e9ce98d (diff) |
soundwire: Disable ports in both banks after playback usecase
Soundwire hardware has two banks for configuring soundwire
slave ports. After playback is stopped, disable soundwire slave
ports in both banks to avoid any port collisions during the start
of next playback on other slave device.
Change-Id: I5cfd1d985a1ca5fd7b4020d7e14697642f207501
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soundwire/swr-wcd-ctrl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/soundwire/swr-wcd-ctrl.c b/drivers/soundwire/swr-wcd-ctrl.c index 14d28117edc7..e4424359c692 100644 --- a/drivers/soundwire/swr-wcd-ctrl.c +++ b/drivers/soundwire/swr-wcd-ctrl.c @@ -779,11 +779,14 @@ static int swrm_disconnect_port(struct swr_master *master, struct swr_port_info *port; struct swrm_mports *mport; struct list_head *ptr, *next; - u8 bank; + u8 bank, active_bank; int ret = 0; u8 mport_id = 0; int port_type = 0; struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master); + u32 reg[SWRM_MAX_PORT_REG]; + u32 val[SWRM_MAX_PORT_REG]; + int len = 0; if (!swrm) { dev_err(&master->dev, @@ -798,6 +801,7 @@ static int swrm_disconnect_port(struct swr_master *master, } mutex_lock(&swrm->mlock); bank = get_inactive_bank_num(swrm); + active_bank = bank ? 0 : 1; for (i = 0; i < portinfo->num_port; i++) { ret = swrm_get_master_port(&mport_id, portinfo->port_id[i]); @@ -824,6 +828,12 @@ static int swrm_disconnect_port(struct swr_master *master, 0); swrm_cmd_fifo_wr_cmd(swrm, 0x00, port->dev_id, 0x00, SWRS_DP_CHANNEL_ENABLE_BANK(port_type, bank)); + reg[len] = SWRM_DP_PORT_CTRL_BANK((mport_id+1), active_bank); + val[len++] = 0; + reg[len] = SWRM_CMD_FIFO_WR_CMD; + val[len++] = SWR_REG_VAL_PACK(0x00, port->dev_id, 0x00, + SWRS_DP_CHANNEL_ENABLE_BANK(port_type, + active_bank)); list_for_each_safe(ptr, next, &swrm->mport_list) { mport = list_entry(ptr, struct swrm_mports, list); if (mport->id == mport_id) { @@ -833,6 +843,7 @@ static int swrm_disconnect_port(struct swr_master *master, } } enable_bank_switch(swrm, bank, SWR_MAX_ROW, SWR_MAX_COL); + swrm->bulk_write(swrm->handle, reg, val, len); if (master->num_port >= SWR_MSTR_PORT_LEN) master->num_port = SWR_MSTR_PORT_LEN; |