]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: codecs: wsa883x: parse port-mapping information
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Thu, 27 Jun 2024 14:44:39 +0000 (15:44 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 1 Jul 2024 13:53:23 +0000 (14:53 +0100)
Add support to parse static master port map information from device tree.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240626-port-map-v2-2-6cc1c5608cdd@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wsa883x.c

index 8abce2160d657a1b3b7f4e30a77de18bb2f79cd1..f5a15f0e891e0d0de14bcdf0757a30c56a687f7a 100644 (file)
@@ -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;