lkml.org 
[lkml]   [2023]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] ASoC: codecs: wsa884x: check if set_stream is called for proper bus
Date
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

If multiple WSA8840 speakers, from two separate Soundwire buses, are
used in one codec DAI link, the set_stream() should ignore calls for
setting stream from other Soundwire controller.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Co-developed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
sound/soc/codecs/wsa884x.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
index bee6e763c700..91205e8c96f1 100644
--- a/sound/soc/codecs/wsa884x.c
+++ b/sound/soc/codecs/wsa884x.c
@@ -1775,6 +1775,12 @@ static int wsa884x_set_stream(struct snd_soc_dai *dai,
void *stream, int direction)
{
struct wsa884x_priv *wsa884x = dev_get_drvdata(dai->dev);
+ struct sdw_stream_runtime *sruntime = stream;
+ struct sdw_slave *sdw = dev_to_sdw_dev(dai->dev);
+
+ /* Check if this belongs to same bus */
+ if (sdw->bus->dev != sruntime->dev)
+ return 0;

wsa884x->sruntime = stream;

--
2.34.1
\
 
 \ /
  Last update: 2023-10-25 16:48    [W:0.166 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site