summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-07-02 14:02:57 +0200
committerMark Brown <broonie@kernel.org>2024-07-02 14:02:57 +0200
commitcc1deba84035abd21d07a468f463fb6eb2186c92 (patch)
tree96a4fd896a6c6ca228ab2b60282ef34480114253 /sound
parentASoC: codecs: lpass-wsa-macro: Fix using NULL pointer in probe() dev_err (diff)
parentASoC: codecs: wsa884x: parse port-mapping information (diff)
downloadlinux-cc1deba84035abd21d07a468f463fb6eb2186c92.tar.xz
linux-cc1deba84035abd21d07a468f463fb6eb2186c92.zip
ASoC: codecs: wsa88xx: add support for static port
Merge series from srinivas.kandagatla@linaro.org: Existing way of allocating soundwire master ports on Qualcommm platforms is dynamic, and in linear order starting from 1 to MAX_PORTS. This will work as long as soundwire device ports are 1:1 mapped linearly. However on most Qcom SoCs like SM8550, SM8650, x1e80100, these are NOT mapped in that order. The result of this is that only one speaker among the pair of speakers is always silent, With recent changes for WSA codec to support codec versions and along with these patches we are able to get all speakers working on these SoCs.
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wsa883x.c8
-rw-r--r--sound/soc/codecs/wsa884x.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
index 8abce2160d65..f5a15f0e891e 100644
--- a/sound/soc/codecs/wsa883x.c
+++ b/sound/soc/codecs/wsa883x.c
@@ -1398,6 +1398,14 @@ static int wsa883x_probe(struct sdw_slave *pdev,
wsa883x->sconfig.direction = SDW_DATA_DIR_RX;
wsa883x->sconfig.type = SDW_STREAM_PDM;
+ /**
+ * Port map index starts with 0, however the data port for this codec
+ * are from index 1
+ */
+ if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping", &pdev->m_port_map[1],
+ WSA883X_MAX_SWR_PORTS))
+ dev_dbg(dev, "Static Port mapping not specified\n");
+
pdev->prop.sink_ports = GENMASK(WSA883X_MAX_SWR_PORTS, 0);
pdev->prop.simple_clk_stop_capable = true;
pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
index a9767ef0e39d..a6034547b4f3 100644
--- a/sound/soc/codecs/wsa884x.c
+++ b/sound/soc/codecs/wsa884x.c
@@ -1887,6 +1887,14 @@ static int wsa884x_probe(struct sdw_slave *pdev,
wsa884x->sconfig.direction = SDW_DATA_DIR_RX;
wsa884x->sconfig.type = SDW_STREAM_PDM;
+ /**
+ * Port map index starts with 0, however the data port for this codec
+ * are from index 1
+ */
+ if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping", &pdev->m_port_map[1],
+ WSA884X_MAX_SWR_PORTS))
+ dev_dbg(dev, "Static Port mapping not specified\n");
+
pdev->prop.sink_ports = GENMASK(WSA884X_MAX_SWR_PORTS, 0);
pdev->prop.simple_clk_stop_capable = true;
pdev->prop.sink_dpn_prop = wsa884x_sink_dpn_prop;