devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping.
@ 2024-06-27 11:55 srinivas.kandagatla
  2024-06-27 11:55 ` [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property srinivas.kandagatla
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: srinivas.kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla, Manikantan R

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.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Manikantan R (1):
      ASoC: dt-bindings: wsa883x: Document port mapping property

Srinivas Kandagatla (5):
      ASoC: codecs: wsa883x: parse port-mapping information
      ASoC: dt-bindings: wsa8840: Document port mapping property
      ASoC: codecs: wsa884x: parse port-mapping information
      arm64: dts: x1e80100-crd: fix wsa soundwire port mapping
      arm64: dts: x1e80100-qcp: fix wsa soundwire port mapping

 Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml | 8 ++++++++
 Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml | 8 ++++++++
 arch/arm64/boot/dts/qcom/x1e80100-crd.dts                 | 4 ++++
 arch/arm64/boot/dts/qcom/x1e80100-qcp.dts                 | 2 ++
 sound/soc/codecs/wsa883x.c                                | 8 ++++++++
 sound/soc/codecs/wsa884x.c                                | 8 ++++++++
 6 files changed, 38 insertions(+)
---
base-commit: 9935be184a55dd84fc3275094f2df095491f6ea1
change-id: 20240626-port-map-ef50c3304d4a

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
@ 2024-06-27 11:55 ` srinivas.kandagatla
  2024-06-27 12:05   ` Krzysztof Kozlowski
  2024-06-27 11:55 ` [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information Srinivas Kandagatla
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: srinivas.kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla, Manikantan R

From: Manikantan R <quic_manrav@quicinc.com>

Document port mapping property for wsa883x. Port mapping is required
to be able map correct master ports for VI feedback.

All the device ports are not mapped in same order as master ports, so
there is a need for having static port mapping for WSA codecs.

Signed-off-by: Manikantan R <quic_manrav@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml
index 8e462cdf0018..14d312f9c345 100644
--- a/Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml
@@ -32,6 +32,14 @@ properties:
   vdd-supply:
     description: VDD Supply for the Codec
 
+  qcom,port-mapping:
+    description: |
+      Specifies static port mapping between slave and master ports.
+      In the order of slave port index.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 4
+    maxItems: 4
+
   '#thermal-sensor-cells':
     const: 0
 

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
  2024-06-27 11:55 ` [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property srinivas.kandagatla
@ 2024-06-27 11:55 ` Srinivas Kandagatla
  2024-06-27 12:06   ` Krzysztof Kozlowski
  2024-06-27 13:36   ` Dmitry Baryshkov
  2024-06-27 11:55 ` [PATCH 3/6] ASoC: dt-bindings: wsa8840: Document port mapping property Srinivas Kandagatla
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla

Add support to parse static master port map information from device tree.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/wsa883x.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
index a2e86ef7d18f..43156d39480f 100644
--- a/sound/soc/codecs/wsa883x.c
+++ b/sound/soc/codecs/wsa883x.c
@@ -1399,6 +1399,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_info(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;

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/6] ASoC: dt-bindings: wsa8840: Document port mapping property
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
  2024-06-27 11:55 ` [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property srinivas.kandagatla
  2024-06-27 11:55 ` [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information Srinivas Kandagatla
@ 2024-06-27 11:55 ` Srinivas Kandagatla
  2024-06-27 12:06   ` Krzysztof Kozlowski
  2024-06-27 11:55 ` [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information Srinivas Kandagatla
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla

Document port mapping property for wsa884x. Port mapping is required
to be able map correct master ports.

All the device ports are not mapped in same order as master ports, so
there is a need for having static port mapping for WSA codecs.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml
index 22798d22d981..83e0360301e1 100644
--- a/Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml
@@ -32,6 +32,14 @@ properties:
     description: Powerdown/Shutdown line to use (pin SD_N)
     maxItems: 1
 
+  qcom,port-mapping:
+    description: |
+      Specifies static port mapping between slave and master ports.
+      In the order of slave port index.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 6
+    maxItems: 6
+
   '#sound-dai-cells':
     const: 0
 

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
                   ` (2 preceding siblings ...)
  2024-06-27 11:55 ` [PATCH 3/6] ASoC: dt-bindings: wsa8840: Document port mapping property Srinivas Kandagatla
@ 2024-06-27 11:55 ` Srinivas Kandagatla
  2024-06-27 12:07   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2024-06-27 11:55 ` [PATCH 5/6] arm64: dts: x1e80100-crd: fix wsa soundwire port mapping Srinivas Kandagatla
                   ` (2 subsequent siblings)
  6 siblings, 3 replies; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla

Add support to parse static master port map information from device tree.
This is required for correct port mapping between soundwire device and
master ports.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/wsa884x.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
index a9767ef0e39d..72ff71bfb827 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_info(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;

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/6] arm64: dts: x1e80100-crd: fix wsa soundwire port mapping
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
                   ` (3 preceding siblings ...)
  2024-06-27 11:55 ` [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information Srinivas Kandagatla
@ 2024-06-27 11:55 ` Srinivas Kandagatla
  2024-06-27 12:07   ` Krzysztof Kozlowski
  2024-06-27 11:55 ` [PATCH 6/6] arm64: dts: x1e80100-qcp: " Srinivas Kandagatla
  2024-06-27 12:51 ` [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static " Neil Armstrong
  6 siblings, 1 reply; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla

Existing way of allocating ports dynamically is linear starting from 1 to
MAX_PORTS. This will not work for x1e80100 as the master ports are
are not mapped in the same order.

Without this fix only one speaker in a pair of speakers will function.

After this fix along with WSA codec changes both the speakers starts
working.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
index ce80119d798d..67c5cd89b925 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
@@ -841,6 +841,7 @@ left_woofer: speaker@0,0 {
 		sound-name-prefix = "WooferLeft";
 		vdd-1p8-supply = <&vreg_l15b_1p8>;
 		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <1 2 3 7 10 13>;
 	};
 
 	/* WSA8845, Left Tweeter */
@@ -852,6 +853,7 @@ left_tweeter: speaker@0,1 {
 		sound-name-prefix = "TwitterLeft";
 		vdd-1p8-supply = <&vreg_l15b_1p8>;
 		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <4 5 6 7 11 13>;
 	};
 };
 
@@ -892,6 +894,7 @@ right_woofer: speaker@0,0 {
 		sound-name-prefix = "WooferRight";
 		vdd-1p8-supply = <&vreg_l15b_1p8>;
 		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <1 2 3 7 10 13>;
 	};
 
 	/* WSA8845, Right Tweeter */
@@ -903,6 +906,7 @@ right_tweeter: speaker@0,1 {
 		sound-name-prefix = "TwitterRight";
 		vdd-1p8-supply = <&vreg_l15b_1p8>;
 		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <4 5 6 7 11 13>;
 	};
 };
 

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/6] arm64: dts: x1e80100-qcp: fix wsa soundwire port mapping
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
                   ` (4 preceding siblings ...)
  2024-06-27 11:55 ` [PATCH 5/6] arm64: dts: x1e80100-crd: fix wsa soundwire port mapping Srinivas Kandagatla
@ 2024-06-27 11:55 ` Srinivas Kandagatla
  2024-06-27 12:07   ` Krzysztof Kozlowski
  2024-06-27 12:51 ` [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static " Neil Armstrong
  6 siblings, 1 reply; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 11:55 UTC (permalink / raw)
  To: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Krzysztof Kozlowski,
	Srinivas Kandagatla

Existing way of allocating ports dynamically is linear starting from 1 to
MAX_PORTS. This will not work for x1e80100 as the master ports are
are not mapped in the same order.

Without this fix only one speaker in a pair of speakers will function.

After this fix along with WSA codec changes both the speakers starts
working.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
index 4edec3212dde..79563ae34890 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
@@ -749,6 +749,7 @@ left_spkr: speaker@0,0 {
 		sound-name-prefix = "SpkrLeft";
 		vdd-1p8-supply = <&vreg_l15b_1p8>;
 		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <1 2 3 7 10 13>;
 	};
 
 	/* WSA8845, Right Speaker */
@@ -760,6 +761,7 @@ right_spkr: speaker@0,1 {
 		sound-name-prefix = "SpkrRight";
 		vdd-1p8-supply = <&vreg_l15b_1p8>;
 		vdd-io-supply = <&vreg_l12b_1p2>;
+		qcom,port-mapping = <4 5 6 7 11 13>;
 	};
 };
 

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property
  2024-06-27 11:55 ` [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property srinivas.kandagatla
@ 2024-06-27 12:05   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 12:05 UTC (permalink / raw)
  To: srinivas.kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel, Manikantan R

On 27/06/2024 13:55, srinivas.kandagatla@linaro.org wrote:
> From: Manikantan R <quic_manrav@quicinc.com>
> 
> Document port mapping property for wsa883x. Port mapping is required
> to be able map correct master ports for VI feedback.
> 
> All the device ports are not mapped in same order as master ports, so
> there is a need for having static port mapping for WSA codecs.
> 
> Signed-off-by: Manikantan R <quic_manrav@quicinc.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information
  2024-06-27 11:55 ` [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information Srinivas Kandagatla
@ 2024-06-27 12:06   ` Krzysztof Kozlowski
  2024-06-27 13:36   ` Dmitry Baryshkov
  1 sibling, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 12:06 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel

On 27/06/2024 13:55, Srinivas Kandagatla wrote:
> Add support to parse static master port map information from device tree.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/codecs/wsa883x.c | 8 ++++++++
>  1 file changed, 8 insertions(+)


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 3/6] ASoC: dt-bindings: wsa8840: Document port mapping property
  2024-06-27 11:55 ` [PATCH 3/6] ASoC: dt-bindings: wsa8840: Document port mapping property Srinivas Kandagatla
@ 2024-06-27 12:06   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 12:06 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel

On 27/06/2024 13:55, Srinivas Kandagatla wrote:
> Document port mapping property for wsa884x. Port mapping is required
> to be able map correct master ports.
> 
> All the device ports are not mapped in same order as master ports, so
> there is a need for having static port mapping for WSA codecs.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 11:55 ` [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information Srinivas Kandagatla
@ 2024-06-27 12:07   ` Krzysztof Kozlowski
  2024-06-27 12:58   ` Neil Armstrong
  2024-06-27 13:38   ` Dmitry Baryshkov
  2 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 12:07 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel

On 27/06/2024 13:55, Srinivas Kandagatla wrote:
> Add support to parse static master port map information from device tree.
> This is required for correct port mapping between soundwire device and
> master ports.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/6] arm64: dts: x1e80100-crd: fix wsa soundwire port mapping
  2024-06-27 11:55 ` [PATCH 5/6] arm64: dts: x1e80100-crd: fix wsa soundwire port mapping Srinivas Kandagatla
@ 2024-06-27 12:07   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 12:07 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel

On 27/06/2024 13:55, Srinivas Kandagatla wrote:
> Existing way of allocating ports dynamically is linear starting from 1 to
> MAX_PORTS. This will not work for x1e80100 as the master ports are
> are not mapped in the same order.
> 
> Without this fix only one speaker in a pair of speakers will function.
> 
> After this fix along with WSA codec changes both the speakers starts
> working.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/6] arm64: dts: x1e80100-qcp: fix wsa soundwire port mapping
  2024-06-27 11:55 ` [PATCH 6/6] arm64: dts: x1e80100-qcp: " Srinivas Kandagatla
@ 2024-06-27 12:07   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 12:07 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, Neil Armstrong, alsa-devel, linux-sound,
	devicetree, linux-kernel

On 27/06/2024 13:55, Srinivas Kandagatla wrote:
> Existing way of allocating ports dynamically is linear starting from 1 to
> MAX_PORTS. This will not work for x1e80100 as the master ports are
> are not mapped in the same order.
> 
> Without this fix only one speaker in a pair of speakers will function.
> 
> After this fix along with WSA codec changes both the speakers starts
> working.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping.
  2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
                   ` (5 preceding siblings ...)
  2024-06-27 11:55 ` [PATCH 6/6] arm64: dts: x1e80100-qcp: " Srinivas Kandagatla
@ 2024-06-27 12:51 ` Neil Armstrong
  6 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2024-06-27 12:51 UTC (permalink / raw)
  To: srinivas.kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Manikantan R

On 27/06/2024 13:55, srinivas.kandagatla@linaro.org wrote:
> 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.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> Manikantan R (1):
>        ASoC: dt-bindings: wsa883x: Document port mapping property
> 
> Srinivas Kandagatla (5):
>        ASoC: codecs: wsa883x: parse port-mapping information
>        ASoC: dt-bindings: wsa8840: Document port mapping property
>        ASoC: codecs: wsa884x: parse port-mapping information
>        arm64: dts: x1e80100-crd: fix wsa soundwire port mapping
>        arm64: dts: x1e80100-qcp: fix wsa soundwire port mapping
> 
>   Documentation/devicetree/bindings/sound/qcom,wsa883x.yaml | 8 ++++++++
>   Documentation/devicetree/bindings/sound/qcom,wsa8840.yaml | 8 ++++++++
>   arch/arm64/boot/dts/qcom/x1e80100-crd.dts                 | 4 ++++
>   arch/arm64/boot/dts/qcom/x1e80100-qcp.dts                 | 2 ++
>   sound/soc/codecs/wsa883x.c                                | 8 ++++++++
>   sound/soc/codecs/wsa884x.c                                | 8 ++++++++
>   6 files changed, 38 insertions(+)
> ---
> base-commit: 9935be184a55dd84fc3275094f2df095491f6ea1
> change-id: 20240626-port-map-ef50c3304d4a
> 
> Best regards,

I now have both speakers working !

Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK

Thanks!
Neil

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 11:55 ` [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information Srinivas Kandagatla
  2024-06-27 12:07   ` Krzysztof Kozlowski
@ 2024-06-27 12:58   ` Neil Armstrong
  2024-06-27 13:38   ` Dmitry Baryshkov
  2 siblings, 0 replies; 22+ messages in thread
From: Neil Armstrong @ 2024-06-27 12:58 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio
  Cc: linux-arm-msm, alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski

On 27/06/2024 13:55, Srinivas Kandagatla wrote:
> Add support to parse static master port map information from device tree.
> This is required for correct port mapping between soundwire device and
> master ports.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>   sound/soc/codecs/wsa884x.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
> index a9767ef0e39d..72ff71bfb827 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_info(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;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information
  2024-06-27 11:55 ` [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information Srinivas Kandagatla
  2024-06-27 12:06   ` Krzysztof Kozlowski
@ 2024-06-27 13:36   ` Dmitry Baryshkov
  2024-06-27 14:34     ` Srinivas Kandagatla
  1 sibling, 1 reply; 22+ messages in thread
From: Dmitry Baryshkov @ 2024-06-27 13:36 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Neil Armstrong,
	alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski

On Thu, Jun 27, 2024 at 12:55:18PM GMT, Srinivas Kandagatla wrote:
> Add support to parse static master port map information from device tree.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/codecs/wsa883x.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
> index a2e86ef7d18f..43156d39480f 100644
> --- a/sound/soc/codecs/wsa883x.c
> +++ b/sound/soc/codecs/wsa883x.c
> @@ -1399,6 +1399,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_info(dev, "Static Port mapping not specified\n");

dev_info looks strange. It should be either dev_warn or dev_dbg.

> +
>  	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;
> 
> -- 
> 2.25.1
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 11:55 ` [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information Srinivas Kandagatla
  2024-06-27 12:07   ` Krzysztof Kozlowski
  2024-06-27 12:58   ` Neil Armstrong
@ 2024-06-27 13:38   ` Dmitry Baryshkov
  2024-06-27 14:16     ` Krzysztof Kozlowski
  2024-06-27 14:34     ` Srinivas Kandagatla
  2 siblings, 2 replies; 22+ messages in thread
From: Dmitry Baryshkov @ 2024-06-27 13:38 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Neil Armstrong,
	alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski

On Thu, Jun 27, 2024 at 12:55:20PM GMT, Srinivas Kandagatla wrote:
> Add support to parse static master port map information from device tree.
> This is required for correct port mapping between soundwire device and
> master ports.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/codecs/wsa884x.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
> index a9767ef0e39d..72ff71bfb827 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_info(dev, "Static Port mapping not specified\n");

Same comment. Either dev_warn (if it's something to warn about) or
dev_info.

Or, as your commit message mentions that it is required, it should be an
error if the port mapping is not specified.

> +
>  	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;
> 
> -- 
> 2.25.1
> 

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 13:38   ` Dmitry Baryshkov
@ 2024-06-27 14:16     ` Krzysztof Kozlowski
  2024-06-27 15:12       ` Dmitry Baryshkov
  2024-06-27 14:34     ` Srinivas Kandagatla
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-27 14:16 UTC (permalink / raw)
  To: Dmitry Baryshkov, Srinivas Kandagatla
  Cc: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Neil Armstrong,
	alsa-devel, linux-sound, devicetree, linux-kernel

On 27/06/2024 15:38, Dmitry Baryshkov wrote:
> On Thu, Jun 27, 2024 at 12:55:20PM GMT, Srinivas Kandagatla wrote:
>> Add support to parse static master port map information from device tree.
>> This is required for correct port mapping between soundwire device and
>> master ports.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>  sound/soc/codecs/wsa884x.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
>> index a9767ef0e39d..72ff71bfb827 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_info(dev, "Static Port mapping not specified\n");
> 
> Same comment. Either dev_warn (if it's something to warn about) or
> dev_info.
> 
> Or, as your commit message mentions that it is required, it should be an
> error if the port mapping is not specified.

That would be an ABI break.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 13:38   ` Dmitry Baryshkov
  2024-06-27 14:16     ` Krzysztof Kozlowski
@ 2024-06-27 14:34     ` Srinivas Kandagatla
  2024-06-27 15:11       ` Dmitry Baryshkov
  1 sibling, 1 reply; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 14:34 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Neil Armstrong,
	alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski



On 27/06/2024 14:38, Dmitry Baryshkov wrote:
> On Thu, Jun 27, 2024 at 12:55:20PM GMT, Srinivas Kandagatla wrote:
>> Add support to parse static master port map information from device tree.
>> This is required for correct port mapping between soundwire device and
>> master ports.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   sound/soc/codecs/wsa884x.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
>> index a9767ef0e39d..72ff71bfb827 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_info(dev, "Static Port mapping not specified\n");
> 
> Same comment. Either dev_warn (if it's something to warn about) or
> dev_info.
> 
> Or, as your commit message mentions that it is required, it should be an
> error if the port mapping is not specified.

This is an optional property for older SoCs which have 1:1 port map 
between device and master.


--srini
> 
>> +
>>   	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;
>>
>> -- 
>> 2.25.1
>>
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information
  2024-06-27 13:36   ` Dmitry Baryshkov
@ 2024-06-27 14:34     ` Srinivas Kandagatla
  0 siblings, 0 replies; 22+ messages in thread
From: Srinivas Kandagatla @ 2024-06-27 14:34 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Neil Armstrong,
	alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski



On 27/06/2024 14:36, Dmitry Baryshkov wrote:
> On Thu, Jun 27, 2024 at 12:55:18PM GMT, Srinivas Kandagatla wrote:
>> Add support to parse static master port map information from device tree.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   sound/soc/codecs/wsa883x.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c
>> index a2e86ef7d18f..43156d39480f 100644
>> --- a/sound/soc/codecs/wsa883x.c
>> +++ b/sound/soc/codecs/wsa883x.c
>> @@ -1399,6 +1399,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_info(dev, "Static Port mapping not specified\n");
> 
> dev_info looks strange. It should be either dev_warn or dev_dbg.

dev_dbg should be good in this case!

--srini
> 
>> +
>>   	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;
>>
>> -- 
>> 2.25.1
>>
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 14:34     ` Srinivas Kandagatla
@ 2024-06-27 15:11       ` Dmitry Baryshkov
  0 siblings, 0 replies; 22+ messages in thread
From: Dmitry Baryshkov @ 2024-06-27 15:11 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Banajit Goswami, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Neil Armstrong,
	alsa-devel, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski

On Thu, 27 Jun 2024 at 17:34, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
>
>
> On 27/06/2024 14:38, Dmitry Baryshkov wrote:
> > On Thu, Jun 27, 2024 at 12:55:20PM GMT, Srinivas Kandagatla wrote:
> >> Add support to parse static master port map information from device tree.
> >> This is required for correct port mapping between soundwire device and
> >> master ports.
> >>
> >> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> >> ---
> >>   sound/soc/codecs/wsa884x.c | 8 ++++++++
> >>   1 file changed, 8 insertions(+)
> >>
> >> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
> >> index a9767ef0e39d..72ff71bfb827 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_info(dev, "Static Port mapping not specified\n");
> >
> > Same comment. Either dev_warn (if it's something to warn about) or
> > dev_info.
> >
> > Or, as your commit message mentions that it is required, it should be an
> > error if the port mapping is not specified.
>
> This is an optional property for older SoCs which have 1:1 port map
> between device and master.

Then the commit message is inaccurate. Could you please fix it?

>
>
> --srini
> >
> >> +
> >>      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;
> >>
> >> --
> >> 2.25.1
> >>
> >



-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information
  2024-06-27 14:16     ` Krzysztof Kozlowski
@ 2024-06-27 15:12       ` Dmitry Baryshkov
  0 siblings, 0 replies; 22+ messages in thread
From: Dmitry Baryshkov @ 2024-06-27 15:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Neil Armstrong, alsa-devel, linux-sound, devicetree, linux-kernel

On Thu, 27 Jun 2024 at 17:16, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 27/06/2024 15:38, Dmitry Baryshkov wrote:
> > On Thu, Jun 27, 2024 at 12:55:20PM GMT, Srinivas Kandagatla wrote:
> >> Add support to parse static master port map information from device tree.
> >> This is required for correct port mapping between soundwire device and
> >> master ports.
> >>
> >> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> >> ---
> >>  sound/soc/codecs/wsa884x.c | 8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >>
> >> diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c
> >> index a9767ef0e39d..72ff71bfb827 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_info(dev, "Static Port mapping not specified\n");
> >
> > Same comment. Either dev_warn (if it's something to warn about) or
> > dev_info.
> >
> > Or, as your commit message mentions that it is required, it should be an
> > error if the port mapping is not specified.
>
> That would be an ABI break.

Ok. So make it required just for new platforms. My point is that
dev_info here is pretty pointless.


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-06-27 15:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 11:55 [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static port mapping srinivas.kandagatla
2024-06-27 11:55 ` [PATCH 1/6] ASoC: dt-bindings: wsa883x: Document port mapping property srinivas.kandagatla
2024-06-27 12:05   ` Krzysztof Kozlowski
2024-06-27 11:55 ` [PATCH 2/6] ASoC: codecs: wsa883x: parse port-mapping information Srinivas Kandagatla
2024-06-27 12:06   ` Krzysztof Kozlowski
2024-06-27 13:36   ` Dmitry Baryshkov
2024-06-27 14:34     ` Srinivas Kandagatla
2024-06-27 11:55 ` [PATCH 3/6] ASoC: dt-bindings: wsa8840: Document port mapping property Srinivas Kandagatla
2024-06-27 12:06   ` Krzysztof Kozlowski
2024-06-27 11:55 ` [PATCH 4/6] ASoC: codecs: wsa884x: parse port-mapping information Srinivas Kandagatla
2024-06-27 12:07   ` Krzysztof Kozlowski
2024-06-27 12:58   ` Neil Armstrong
2024-06-27 13:38   ` Dmitry Baryshkov
2024-06-27 14:16     ` Krzysztof Kozlowski
2024-06-27 15:12       ` Dmitry Baryshkov
2024-06-27 14:34     ` Srinivas Kandagatla
2024-06-27 15:11       ` Dmitry Baryshkov
2024-06-27 11:55 ` [PATCH 5/6] arm64: dts: x1e80100-crd: fix wsa soundwire port mapping Srinivas Kandagatla
2024-06-27 12:07   ` Krzysztof Kozlowski
2024-06-27 11:55 ` [PATCH 6/6] arm64: dts: x1e80100-qcp: " Srinivas Kandagatla
2024-06-27 12:07   ` Krzysztof Kozlowski
2024-06-27 12:51 ` [PATCH 0/6] ASoC: codecs: wsa88xx: add support for static " Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).