summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2019-08-05 20:55:13 -0400
committerVinod Koul <vkoul@kernel.org>2019-08-21 05:06:01 -0400
commite0279b6b5522f86680a9e16a12dbb2e40b1e2698 (patch)
tree2cde080fab9e72e307eec88c1ee39f506493f410
parentce3304d8da8fa8e20001ed6128c7d04f703be305 (diff)
soundwire: stream: fix disable sequence
When we disable the stream and then call hw_free, two bank switches will be handled and as a result we re-enable the stream on hw_free. Make sure the stream is disabled on both banks. TODO: we need to completely revisit all this and make sure we have a mirroring mechanism between current and alternate banks. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/soundwire/stream.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 53f5e790fcd7..75b9ad1fb1a6 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -1637,7 +1637,24 @@ static int _sdw_disable_stream(struct sdw_stream_runtime *stream)
1637 } 1637 }
1638 } 1638 }
1639 1639
1640 return do_bank_switch(stream); 1640 ret = do_bank_switch(stream);
1641 if (ret < 0) {
1642 dev_err(bus->dev, "Bank switch failed: %d\n", ret);
1643 return ret;
1644 }
1645
1646 /* make sure alternate bank (previous current) is also disabled */
1647 list_for_each_entry(m_rt, &stream->master_list, stream_node) {
1648 bus = m_rt->bus;
1649 /* Disable port(s) */
1650 ret = sdw_enable_disable_ports(m_rt, false);
1651 if (ret < 0) {
1652 dev_err(bus->dev, "Disable port(s) failed: %d\n", ret);
1653 return ret;
1654 }
1655 }
1656
1657 return 0;
1641} 1658}
1642 1659
1643/** 1660/**