diff options
author | Vinod Koul <vinod.koul@intel.com> | 2018-04-26 18:41:24 +0530 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-04-26 18:41:24 +0530 |
commit | eeb55a15841d6ba99332ec5522617261d799a773 (patch) | |
tree | 99eaf2b4146dae2760ceab723b51648d6e2df1fd | |
parent | d4c8c16412807c1d1a6d576df902124e7729afae (diff) | |
download | sdw_old-topic/sdw_s2_v6_full.tar.gz |
Revert "Fix to soundwire: Add bank switch routine ML RMV"topic/sdw_s2_v6_full
This reverts commit 760be9a0a048c6943b3ed40f2368b1d0d8b79bae.
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/soundwire/stream.c | 19 | ||||
-rw-r--r-- | include/linux/soundwire/sdw.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index e8fc01c6664be..ef572f7fdbf1b 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -641,6 +641,7 @@ static int sdw_bank_switch(struct sdw_bus *bus) if (!wr_msg) return -ENOMEM; + bus->defer_msg.msg = wr_msg; wbuf = kzalloc(sizeof(*wbuf), GFP_KERNEL); if (!wbuf) { ret = -ENOMEM; @@ -661,17 +662,23 @@ static int sdw_bank_switch(struct sdw_bus *bus) SDW_MSG_FLAG_WRITE, wbuf); wr_msg->ssp_sync = true; - ret = sdw_transfer(bus, wr_msg); + if (bus->multi_link) + ret = sdw_transfer_defer(bus, wr_msg, &bus->defer_msg); + else + ret = sdw_transfer(bus, wr_msg); + if (ret < 0) { dev_err(bus->dev, "Slave frame_ctrl reg write failed"); goto error; } - kfree(wr_msg); - kfree(wbuf); - bus->defer_msg.msg = NULL; - bus->params.curr_bank = !bus->params.curr_bank; - bus->params.next_bank = !bus->params.next_bank; + if (!bus->multi_link) { + kfree(wr_msg); + kfree(wbuf); + bus->defer_msg.msg = NULL; + bus->params.curr_bank = !bus->params.curr_bank; + bus->params.next_bank = !bus->params.next_bank; + } return 0; diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index fd4e6e2b2694b..dd4554ca92785 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -768,6 +768,7 @@ struct sdw_master_ops { * @sysfs: Bus sysfs * is used to compute and program bus bandwidth, clock, frame shape, * transport and port parameters + * @multi_link: if multi links are supported * @defer_msg: Defer message * @clk_stop_timeout: Clock stop timeout computed * @bank_switch_timeout: Bank switch timeout computed @@ -786,6 +787,7 @@ struct sdw_bus { struct sdw_master_prop prop; struct list_head m_rt_list; struct sdw_master_sysfs *sysfs; + bool multi_link; struct sdw_defer defer_msg; unsigned int clk_stop_timeout; u32 bank_switch_timeout; |