From: Srinivas Kandagatla Date: Thu, 27 Jun 2024 14:44:39 +0000 (+0100) Subject: ASoC: codecs: wsa883x: parse port-mapping information X-Git-Tag: v6.11-rc1~108^2~6^2~43^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cf3295bd108abbd7f128071ae9775fd18394ca9;p=thirdparty%2Fkernel%2Flinux.git ASoC: codecs: wsa883x: parse port-mapping information Add support to parse static master port map information from device tree. Reviewed-by: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski Tested-by: Neil Armstrong # on SM8650-HDK Signed-off-by: Srinivas Kandagatla Reviewed-by: Dmitry Baryshkov Link: https://patch.msgid.link/20240626-port-map-v2-2-6cc1c5608cdd@linaro.org Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index 8abce2160d657..f5a15f0e891e0 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;