devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards
@ 2025-10-09 14:36 Prasad Kumpatla
  2025-10-09 14:36 ` [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking Prasad Kumpatla
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-09 14:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	prasad.kumpatla, kernel, aiqun.yu, tingwei.zhang, trilok.soni,
	yijie.yang, jingyi.wang, konrad.dybcio

Add audio support for Kaanapali MTP boards. Introduces supporting
dependencies required to enable audio functionality on MTP platforms. 
These changes have been validated on Kaanapali MTP hardware.

Changes in [v2]:
	- Addressed compilation issue for lpass version check patch.
	- Sorted compatible string in machine driver.
	- Link to v1: https://lore.kernel.org/linux-arm-msm/20250924-knp-audio-v1-0-5afa926b567c@oss.qualcomm.com/

Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

Konrad Dybcio (1):
  ASoC: codecs: va-macro: Rework version checking

Prasad Kumpatla (4):
  ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card
  ASoC: qcom: sc8280xp: Add support for Kaanapali
  dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible
  ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs

 .../bindings/sound/qcom,lpass-rx-macro.yaml   |  1 +
 .../bindings/sound/qcom,lpass-tx-macro.yaml   |  1 +
 .../bindings/sound/qcom,lpass-va-macro.yaml   |  1 +
 .../bindings/sound/qcom,lpass-wsa-macro.yaml  |  1 +
 .../bindings/sound/qcom,sm8250.yaml           |  1 +
 .../bindings/soundwire/qcom,soundwire.yaml    |  1 +
 sound/soc/codecs/lpass-va-macro.c             | 90 +++++++++++++------
 sound/soc/qcom/sc8280xp.c                     |  1 +
 8 files changed, 70 insertions(+), 27 deletions(-)

-- 
2.34.1


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

* [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking
  2025-10-09 14:36 [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards Prasad Kumpatla
@ 2025-10-09 14:36 ` Prasad Kumpatla
  2025-10-09 15:25   ` Alexey Klimov
  2025-10-09 14:36 ` [PATCH v2 2/5] ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card Prasad Kumpatla
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-09 14:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	prasad.kumpatla, kernel, aiqun.yu, tingwei.zhang, trilok.soni,
	yijie.yang, jingyi.wang, konrad.dybcio

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Open-code some of the registers to make the checks anywhere near human-
readable. Error out if the version is unsupported or if the VA macro
isn't supposed to be present within this LPASS instance (since we can
check for that now).

Note that previously v2.0 and v2.1 assignments were swapped, but v2.1
does not even seem to exist (as opposed to v2.0.1) and there is no
difference in SW handling anyway.

[Prasad Kumpatla: fixed a spelling error and resolved a checkpatch
warning related to return value handling]

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
---
 sound/soc/codecs/lpass-va-macro.c | 90 +++++++++++++++++++++----------
 1 file changed, 63 insertions(+), 27 deletions(-)

diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index 2e1b77973a3e..eb4981255f2b 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 
+#include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/init.h>
@@ -64,8 +65,15 @@
 #define CDC_VA_TOP_CSR_I2S_CLK			(0x00A8)
 #define CDC_VA_TOP_CSR_I2S_RESET		(0x00AC)
 #define CDC_VA_TOP_CSR_CORE_ID_0		(0x00C0)
+ #define CORE_ID_0_REV_MAJ			GENMASK(7, 0)
 #define CDC_VA_TOP_CSR_CORE_ID_1		(0x00C4)
+#define CORE_ID_1_HAS_WSAMACRO			BIT(3)
+#define CORE_ID_1_HAS_RXMACRO			BIT(2)
+#define CORE_ID_1_HAS_TXMACRO			BIT(1)
+#define CORE_ID_1_HAS_VAMACRO			BIT(0)
 #define CDC_VA_TOP_CSR_CORE_ID_2		(0x00C8)
+ #define CORE_ID_2_REV_MIN			GENMASK(7, 4)
+ #define CORE_ID_2_REV_STEP			GENMASK(3, 0)
 #define CDC_VA_TOP_CSR_CORE_ID_3		(0x00CC)
 #define CDC_VA_TOP_CSR_SWR_MIC_CTL0		(0x00D0)
 #define CDC_VA_TOP_CSR_SWR_MIC_CTL1		(0x00D4)
@@ -1462,39 +1470,63 @@ static int va_macro_validate_dmic_sample_rate(u32 dmic_sample_rate,
 	return dmic_sample_rate;
 }
 
-static void va_macro_set_lpass_codec_version(struct va_macro *va)
+static int va_macro_set_lpass_codec_version(struct va_macro *va)
 {
-	int core_id_0 = 0, core_id_1 = 0, core_id_2 = 0;
 	int version = LPASS_CODEC_VERSION_UNKNOWN;
+	u32 maj, min, step;
+	u32 val;
 
-	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_0, &core_id_0);
-	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_1, &core_id_1);
-	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_2, &core_id_2);
+	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_0, &val);
+	maj = FIELD_GET(CORE_ID_0_REV_MAJ, val);
 
-	if ((core_id_0 == 0x01) && (core_id_1 == 0x0F))
-		version = LPASS_CODEC_VERSION_2_0;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && core_id_2 == 0x01)
+	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_1, &val);
+	if (!FIELD_GET(CORE_ID_1_HAS_VAMACRO, val)) {
+		dev_err(va->dev, "This is not a VA macro instance\n");
+		return -ENODEV;
+	}
+
+	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_2, &val);
+	min = FIELD_GET(CORE_ID_2_REV_MIN, val);
+	step = FIELD_GET(CORE_ID_2_REV_STEP, val);
+
+	if (maj == 1) {
 		version = LPASS_CODEC_VERSION_2_0;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0E))
-		version = LPASS_CODEC_VERSION_2_1;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x50 || core_id_2 == 0x51))
-		version = LPASS_CODEC_VERSION_2_5;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x60 || core_id_2 == 0x61))
-		version = LPASS_CODEC_VERSION_2_6;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x70 || core_id_2 == 0x71))
-		version = LPASS_CODEC_VERSION_2_7;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x80 || core_id_2 == 0x81))
-		version = LPASS_CODEC_VERSION_2_8;
-	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x90 || core_id_2 == 0x91))
-		version = LPASS_CODEC_VERSION_2_9;
-
-	if (version == LPASS_CODEC_VERSION_UNKNOWN)
-		dev_warn(va->dev, "Unknown Codec version, ID: %02x / %02x / %02x\n",
-			 core_id_0, core_id_1, core_id_2);
+	} else if (maj == 2) {
+		switch (min) {
+		case 0:
+			version = LPASS_CODEC_VERSION_2_0;
+			break;
+		case 5:
+			version = LPASS_CODEC_VERSION_2_5;
+			break;
+		case 6:
+			version = LPASS_CODEC_VERSION_2_6;
+			break;
+		case 7:
+			version = LPASS_CODEC_VERSION_2_7;
+			break;
+		case 8:
+			version = LPASS_CODEC_VERSION_2_8;
+			break;
+		case 9:
+			version = LPASS_CODEC_VERSION_2_9;
+			break;
+		default:
+			break;
+		}
+	}
+
+	if (version == LPASS_CODEC_VERSION_UNKNOWN) {
+		dev_err(va->dev, "VA Macro v%u.%u.%u is not supported\n",
+			maj, min, step);
+		return -EOPNOTSUPP;
+	}
 
 	lpass_macro_set_codec_version(version);
 
 	dev_dbg(va->dev, "LPASS Codec Version %s\n", lpass_macro_get_codec_version_string(version));
+
+	return 0;
 }
 
 static int va_macro_probe(struct platform_device *pdev)
@@ -1594,10 +1626,14 @@ static int va_macro_probe(struct platform_device *pdev)
 	 * old version of codecs do not have a reliable way to determine the
 	 * version from registers, get them from soc specific data
 	 */
-	if (data->version)
+	if (data->version) {
 		lpass_macro_set_codec_version(data->version);
-	else /* read version from register */
-		va_macro_set_lpass_codec_version(va);
+	} else {
+		/* read version from register */
+		ret = va_macro_set_lpass_codec_version(va);
+		if (ret)
+			return ret;
+	}
 
 	if (va->has_swr_master) {
 		/* Set default CLK div to 1 */
-- 
2.34.1


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

* [PATCH v2 2/5] ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card
  2025-10-09 14:36 [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards Prasad Kumpatla
  2025-10-09 14:36 ` [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking Prasad Kumpatla
@ 2025-10-09 14:36 ` Prasad Kumpatla
  2025-10-10  0:27   ` Krzysztof Kozlowski
  2025-10-09 14:36 ` [PATCH v2 3/5] ASoC: qcom: sc8280xp: Add support for Kaanapali Prasad Kumpatla
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-09 14:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	prasad.kumpatla, kernel, aiqun.yu, tingwei.zhang, trilok.soni,
	yijie.yang, jingyi.wang, konrad.dybcio, Krzysztof Kozlowski

Add bindings for Kaanapali sound card, which looks fully
compatible with existing SM8450.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
index 8ac91625dce5..708bae805403 100644
--- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
@@ -23,6 +23,7 @@ properties:
           - const: qcom,sdm845-sndcard
       - items:
           - enum:
+              - qcom,kaanapali-sndcard
               - qcom,sm8550-sndcard
               - qcom,sm8650-sndcard
               - qcom,sm8750-sndcard
-- 
2.34.1


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

* [PATCH v2 3/5] ASoC: qcom: sc8280xp: Add support for Kaanapali
  2025-10-09 14:36 [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards Prasad Kumpatla
  2025-10-09 14:36 ` [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking Prasad Kumpatla
  2025-10-09 14:36 ` [PATCH v2 2/5] ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card Prasad Kumpatla
@ 2025-10-09 14:36 ` Prasad Kumpatla
  2025-10-09 14:36 ` [PATCH v2 4/5] dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible Prasad Kumpatla
  2025-10-09 14:36 ` [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs Prasad Kumpatla
  4 siblings, 0 replies; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-09 14:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	prasad.kumpatla, kernel, aiqun.yu, tingwei.zhang, trilok.soni,
	yijie.yang, jingyi.wang, konrad.dybcio

Add compatible for sound card on Qualcomm Kaanapali boards.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
---
 sound/soc/qcom/sc8280xp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index 78e327bc2f07..aea8c1daff32 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -191,6 +191,7 @@ static int sc8280xp_platform_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id snd_sc8280xp_dt_match[] = {
+	{.compatible = "qcom,kaanapali-sndcard", "kaanapali"},
 	{.compatible = "qcom,qcm6490-idp-sndcard", "qcm6490"},
 	{.compatible = "qcom,qcs6490-rb3gen2-sndcard", "qcs6490"},
 	{.compatible = "qcom,qcs8275-sndcard", "qcs8300"},
-- 
2.34.1


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

* [PATCH v2 4/5] dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible
  2025-10-09 14:36 [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards Prasad Kumpatla
                   ` (2 preceding siblings ...)
  2025-10-09 14:36 ` [PATCH v2 3/5] ASoC: qcom: sc8280xp: Add support for Kaanapali Prasad Kumpatla
@ 2025-10-09 14:36 ` Prasad Kumpatla
  2025-10-10  0:28   ` Krzysztof Kozlowski
  2025-10-09 14:36 ` [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs Prasad Kumpatla
  4 siblings, 1 reply; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-09 14:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	prasad.kumpatla, kernel, aiqun.yu, tingwei.zhang, trilok.soni,
	yijie.yang, jingyi.wang, konrad.dybcio, Krzysztof Kozlowski

Add qcom,soundwire-v2.2.0 to the list of supported Qualcomm
SoundWire controller versions. This version falls back to
qcom,soundwire-v2.0.0 if not explicitly handled by the driver.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml b/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml
index 95d947fda6a7..1c4b0bdbb044 100644
--- a/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml
+++ b/Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml
@@ -26,6 +26,7 @@ properties:
       - items:
           - enum:
               - qcom,soundwire-v2.1.0
+              - qcom,soundwire-v2.2.0
           - const: qcom,soundwire-v2.0.0
 
   reg:
-- 
2.34.1


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

* [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs
  2025-10-09 14:36 [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards Prasad Kumpatla
                   ` (3 preceding siblings ...)
  2025-10-09 14:36 ` [PATCH v2 4/5] dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible Prasad Kumpatla
@ 2025-10-09 14:36 ` Prasad Kumpatla
  2025-10-10  0:24   ` Krzysztof Kozlowski
  4 siblings, 1 reply; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-09 14:36 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	prasad.kumpatla, kernel, aiqun.yu, tingwei.zhang, trilok.soni,
	yijie.yang, jingyi.wang, konrad.dybcio, Krzysztof Kozlowski

Add bindings for Qualcomm Kaanapali (LPASS) RX, TX, VA and WSA
macro codecs, which is likely compatible with earlier SM8550.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml | 1 +
 Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml | 1 +
 Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml | 1 +
 .../devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml          | 1 +
 4 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml
index 92f95eb74b19..b869469a5848 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-rx-macro.yaml
@@ -20,6 +20,7 @@ properties:
           - qcom,sc8280xp-lpass-rx-macro
       - items:
           - enum:
+              - qcom,kaanapali-lpass-rx-macro
               - qcom,sm8650-lpass-rx-macro
               - qcom,sm8750-lpass-rx-macro
               - qcom,x1e80100-lpass-rx-macro
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
index 914798a89878..e5e65e226a02 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-tx-macro.yaml
@@ -21,6 +21,7 @@ properties:
           - qcom,sc8280xp-lpass-tx-macro
       - items:
           - enum:
+              - qcom,kaanapali-lpass-tx-macro
               - qcom,sm8650-lpass-tx-macro
               - qcom,sm8750-lpass-tx-macro
               - qcom,x1e80100-lpass-tx-macro
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
index 1c0d78af3c05..5b450f227b70 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-va-macro.yaml
@@ -21,6 +21,7 @@ properties:
       - items:
           - enum:
               - qcom,glymur-lpass-va-macro
+              - qcom,kaanapali-lpass-va-macro
               - qcom,sm8650-lpass-va-macro
               - qcom,sm8750-lpass-va-macro
               - qcom,x1e80100-lpass-va-macro
diff --git a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
index b6f5ba5d1320..d5f22b5cf021 100644
--- a/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,lpass-wsa-macro.yaml
@@ -21,6 +21,7 @@ properties:
       - items:
           - enum:
               - qcom,glymur-lpass-wsa-macro
+              - qcom,kaanapali-lpass-wsa-macro
               - qcom,sm8650-lpass-wsa-macro
               - qcom,sm8750-lpass-wsa-macro
               - qcom,x1e80100-lpass-wsa-macro
-- 
2.34.1


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

* Re: [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking
  2025-10-09 14:36 ` [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking Prasad Kumpatla
@ 2025-10-09 15:25   ` Alexey Klimov
  2025-10-09 15:48     ` Konrad Dybcio
  0 siblings, 1 reply; 12+ messages in thread
From: Alexey Klimov @ 2025-10-09 15:25 UTC (permalink / raw)
  To: Prasad Kumpatla, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel, kernel,
	aiqun.yu, tingwei.zhang, trilok.soni, yijie.yang, jingyi.wang,
	konrad.dybcio

On Thu Oct 9, 2025 at 3:36 PM BST, Prasad Kumpatla wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Open-code some of the registers to make the checks anywhere near human-
> readable. Error out if the version is unsupported or if the VA macro
> isn't supposed to be present within this LPASS instance (since we can
> check for that now).

[...]

> +static int va_macro_set_lpass_codec_version(struct va_macro *va)
>  {
> -	int core_id_0 = 0, core_id_1 = 0, core_id_2 = 0;
>  	int version = LPASS_CODEC_VERSION_UNKNOWN;
> +	u32 maj, min, step;
> +	u32 val;
>  
> -	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_0, &core_id_0);
> -	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_1, &core_id_1);
> -	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_2, &core_id_2);
> +	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_0, &val);
> +	maj = FIELD_GET(CORE_ID_0_REV_MAJ, val);
>  
> -	if ((core_id_0 == 0x01) && (core_id_1 == 0x0F))
> -		version = LPASS_CODEC_VERSION_2_0;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && core_id_2 == 0x01)
> +	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_1, &val);
> +	if (!FIELD_GET(CORE_ID_1_HAS_VAMACRO, val)) {
> +		dev_err(va->dev, "This is not a VA macro instance\n");
> +		return -ENODEV;
> +	}
> +
> +	regmap_read(va->regmap, CDC_VA_TOP_CSR_CORE_ID_2, &val);
> +	min = FIELD_GET(CORE_ID_2_REV_MIN, val);
> +	step = FIELD_GET(CORE_ID_2_REV_STEP, val);
> +
> +	if (maj == 1) {
>  		version = LPASS_CODEC_VERSION_2_0;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0E))
> -		version = LPASS_CODEC_VERSION_2_1;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x50 || core_id_2 == 0x51))
> -		version = LPASS_CODEC_VERSION_2_5;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x60 || core_id_2 == 0x61))
> -		version = LPASS_CODEC_VERSION_2_6;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x70 || core_id_2 == 0x71))
> -		version = LPASS_CODEC_VERSION_2_7;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x80 || core_id_2 == 0x81))
> -		version = LPASS_CODEC_VERSION_2_8;
> -	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x90 || core_id_2 == 0x91))
> -		version = LPASS_CODEC_VERSION_2_9;
> -
> -	if (version == LPASS_CODEC_VERSION_UNKNOWN)
> -		dev_warn(va->dev, "Unknown Codec version, ID: %02x / %02x / %02x\n",
> -			 core_id_0, core_id_1, core_id_2);
> +	} else if (maj == 2) {
> +		switch (min) {
> +		case 0:
> +			version = LPASS_CODEC_VERSION_2_0;
> +			break;
> +		case 5:
> +			version = LPASS_CODEC_VERSION_2_5;
> +			break;
> +		case 6:
> +			version = LPASS_CODEC_VERSION_2_6;
> +			break;
> +		case 7:
> +			version = LPASS_CODEC_VERSION_2_7;
> +			break;
> +		case 8:
> +			version = LPASS_CODEC_VERSION_2_8;
> +			break;
> +		case 9:
> +			version = LPASS_CODEC_VERSION_2_9;
> +			break;
> +		default:
> +			break;
> +		}
> +	}
> +
> +	if (version == LPASS_CODEC_VERSION_UNKNOWN) {
> +		dev_err(va->dev, "VA Macro v%u.%u.%u is not supported\n",
> +			maj, min, step);
> +		return -EOPNOTSUPP;
> +	}

Why?

As far as I understand the behaviour before this change is to continue
even with unsupported LPASS va macro version. IIRC when I enabled sound
on Kaanapali QRD device it worked even with unsupported version, it just
needed a fix to calm down the warning.

Why this needed to be changed to error out as unsupported now? Will there
be a permanent damage to hw/fw if we continue?
Shouldn't this print a warning that execution continues regardless but
with low expectations?

I kinda get why we should give up if va macro instance is not present
but not about change of behaviour here.


>  	lpass_macro_set_codec_version(version);
>  
>  	dev_dbg(va->dev, "LPASS Codec Version %s\n", lpass_macro_get_codec_version_string(version));
> +
> +	return 0;
>  }
>  
>  static int va_macro_probe(struct platform_device *pdev)
> @@ -1594,10 +1626,14 @@ static int va_macro_probe(struct platform_device *pdev)
>  	 * old version of codecs do not have a reliable way to determine the
>  	 * version from registers, get them from soc specific data
>  	 */
> -	if (data->version)
> +	if (data->version) {
>  		lpass_macro_set_codec_version(data->version);
> -	else /* read version from register */
> -		va_macro_set_lpass_codec_version(va);
> +	} else {
> +		/* read version from register */
> +		ret = va_macro_set_lpass_codec_version(va);
> +		if (ret)
> +			return ret;
> +	}

Thanks,
Alexey


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

* Re: [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking
  2025-10-09 15:25   ` Alexey Klimov
@ 2025-10-09 15:48     ` Konrad Dybcio
  0 siblings, 0 replies; 12+ messages in thread
From: Konrad Dybcio @ 2025-10-09 15:48 UTC (permalink / raw)
  To: Alexey Klimov, Prasad Kumpatla, Srinivas Kandagatla,
	Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Jaroslav Kysela, Takashi Iwai, Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel, kernel,
	aiqun.yu, tingwei.zhang, trilok.soni, yijie.yang, jingyi.wang

On 10/9/25 5:25 PM, Alexey Klimov wrote:
> On Thu Oct 9, 2025 at 3:36 PM BST, Prasad Kumpatla wrote:
>> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>>
>> Open-code some of the registers to make the checks anywhere near human-
>> readable. Error out if the version is unsupported or if the VA macro
>> isn't supposed to be present within this LPASS instance (since we can
>> check for that now).
> 

[...]

>> +	if (version == LPASS_CODEC_VERSION_UNKNOWN) {
>> +		dev_err(va->dev, "VA Macro v%u.%u.%u is not supported\n",
>> +			maj, min, step);
>> +		return -EOPNOTSUPP;
>> +	}
> 
> Why?
> 
> As far as I understand the behaviour before this change is to continue
> even with unsupported LPASS va macro version. IIRC when I enabled sound
> on Kaanapali QRD device it worked even with unsupported version, it just
> needed a fix to calm down the warning.
> 
> Why this needed to be changed to error out as unsupported now? Will there
> be a permanent damage to hw/fw if we continue?

Unsupported hw is unsupported, simple as that

We can not predict what a new hw version will bring and it's
better to have the human decide

Konrad

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

* Re: [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs
  2025-10-09 14:36 ` [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs Prasad Kumpatla
@ 2025-10-10  0:24   ` Krzysztof Kozlowski
  2025-10-13 14:46     ` Prasad Kumpatla
  0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10  0:24 UTC (permalink / raw)
  To: Prasad Kumpatla, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel, kernel,
	aiqun.yu, tingwei.zhang, trilok.soni, yijie.yang, jingyi.wang,
	konrad.dybcio, Krzysztof Kozlowski

On 09/10/2025 23:36, Prasad Kumpatla wrote:
> Add bindings for Qualcomm Kaanapali (LPASS) RX, TX, VA and WSA
> macro codecs, which is likely compatible with earlier SM8550.
> 
> Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
> Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>


Now it is incorrect SoB chain.

Please start using b4 - v1 was sent with b4, so I do not understand why
now changing this.

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


Best regards,
Krzysztof

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

* Re: [PATCH v2 2/5] ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card
  2025-10-09 14:36 ` [PATCH v2 2/5] ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card Prasad Kumpatla
@ 2025-10-10  0:27   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10  0:27 UTC (permalink / raw)
  To: Prasad Kumpatla, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel, kernel,
	aiqun.yu, tingwei.zhang, trilok.soni, yijie.yang, jingyi.wang,
	konrad.dybcio, Krzysztof Kozlowski

On 09/10/2025 23:36, Prasad Kumpatla wrote:
> Add bindings for Kaanapali sound card, which looks fully
> compatible with existing SM8450.
> 
> Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
> Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Drop review tag, if you are making significant changes - e.g. DCO chain.
It is not correct now and I did not provide review for reversed path.

Best regards,
Krzysztof

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

* Re: [PATCH v2 4/5] dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible
  2025-10-09 14:36 ` [PATCH v2 4/5] dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible Prasad Kumpatla
@ 2025-10-10  0:28   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-10  0:28 UTC (permalink / raw)
  To: Prasad Kumpatla, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela,
	Takashi Iwai, Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel, kernel,
	aiqun.yu, tingwei.zhang, trilok.soni, yijie.yang, jingyi.wang,
	konrad.dybcio, Krzysztof Kozlowski

On 09/10/2025 23:36, Prasad Kumpatla wrote:
> Add qcom,soundwire-v2.2.0 to the list of supported Qualcomm
> SoundWire controller versions. This version falls back to
> qcom,soundwire-v2.0.0 if not explicitly handled by the driver.
> 
> Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
> Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>

Wrong DCO chain.

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

I reviewed previous patch which was not sent by you.

Best regards,
Krzysztof

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

* Re: [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs
  2025-10-10  0:24   ` Krzysztof Kozlowski
@ 2025-10-13 14:46     ` Prasad Kumpatla
  0 siblings, 0 replies; 12+ messages in thread
From: Prasad Kumpatla @ 2025-10-13 14:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jaroslav Kysela, Takashi Iwai, Rao Mandadapu
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel, kernel,
	aiqun.yu, tingwei.zhang, trilok.soni, yijie.yang, jingyi.wang,
	konrad.dybcio, Krzysztof Kozlowski


On 10/10/2025 5:54 AM, Krzysztof Kozlowski wrote:
> On 09/10/2025 23:36, Prasad Kumpatla wrote:
>> Add bindings for Qualcomm Kaanapali (LPASS) RX, TX, VA and WSA
>> macro codecs, which is likely compatible with earlier SM8550.
>>
>> Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
>> Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
>
> Now it is incorrect SoB chain.
>
> Please start using b4 - v1 was sent with b4, so I do not understand why
> now changing this.
Sure,  let me send new patch with b4.

Thanks,
Prasad
>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Best regards,
> Krzysztof

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

end of thread, other threads:[~2025-10-13 14:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 14:36 [PATCH v2 0/5] Add Audio Support for Kaanapali MTP Boards Prasad Kumpatla
2025-10-09 14:36 ` [PATCH v2 1/5] ASoC: codecs: va-macro: Rework version checking Prasad Kumpatla
2025-10-09 15:25   ` Alexey Klimov
2025-10-09 15:48     ` Konrad Dybcio
2025-10-09 14:36 ` [PATCH v2 2/5] ASoC: dt-bindings: qcom,sm8250: Add kaanapali sound card Prasad Kumpatla
2025-10-10  0:27   ` Krzysztof Kozlowski
2025-10-09 14:36 ` [PATCH v2 3/5] ASoC: qcom: sc8280xp: Add support for Kaanapali Prasad Kumpatla
2025-10-09 14:36 ` [PATCH v2 4/5] dt-bindings: soundwire: qcom: Add SoundWire v2.2.0 compatible Prasad Kumpatla
2025-10-10  0:28   ` Krzysztof Kozlowski
2025-10-09 14:36 ` [PATCH v2 5/5] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs Prasad Kumpatla
2025-10-10  0:24   ` Krzysztof Kozlowski
2025-10-13 14:46     ` Prasad Kumpatla

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).