Skip to contentSkip to conversation

ASoC: qcom: sc8280xp: decouple Arduino Monza config from qcom,qcs8275-sndcard

PATCH In review Gianfranco Mariotti 2 participants 5 messages Nov 30 – Dec 1

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover ASoC: qcom: sc8280xp: decouple Arduino Monza config from qcom,qcs8275-sndcard

Commit 4ba2678ad03e ("ASoC: qcom: sc8280xp: add monaco/monza controls for qcs8275") attached Arduino VENTUNO Q (Monza) MAX98090 widgets, pin switches, DAI format, and 256*fs codec sysclk setup directly to qcs8275_priv_data, which backs the generic "qcom,qcs8275-sndcard" compatible already shared by Monaco EVK, Monaco AC EVK, and other QCS8275 carrier boards.

On non-Monza QCS8275 boards this causes multiple regressions:
- Replaces sc8280xp_dapm_widgets with max98090_dapm_widgets and adds max98090_controls, exposing six nonexistent MAX98090 pin switches on Monaco EVK / Monaco AC EVK, colliding with max98357a's "Speaker" DAPM widget, and dropping the "DP0 Jack".."DP7 Jack" widgets.
- Forces codec_sysclk_set (256 * rate on MI2S, bitclock rate on TDM) and codec_dai_fmt (I2S | NB_NF | BC_FC) onto every QCS8275 board's codecs, breaking codecs clocked from a different MCLK rate or DAI format.

Fix this by introducing a dedicated "arduino,monza-sndcard" compatible:
- Patch 1 documents "arduino,monza-sndcard" with "qcom,qcs8275-sndcard" as fallback in qcom,sm8250.yaml.
- Patch 2 moves the MAX98090 configuration to monza_priv_data, restores qcs8275_priv_data to clean generic QCS8275 defaults, and falls back to monza_priv_data when matching "qcom,qcs8275-sndcard" on an "arduino,monza" machine so existing DTBs continue working.
- Patch 3 updates monaco-arduino-monza.dts to use "arduino,monza-sndcard" with "qcom,qcs8275-sndcard" as fallback (merge-order-independent across the ASoC and Qualcomm DT trees).

Gianfranco Mariotti (3):
ASoC: dt-bindings: qcom,sm8250: add arduino,monza-sndcard compatible
ASoC: qcom: sc8280xp: move Arduino Monza config out of

    qcs8275_priv_data

arm64: dts: qcom: monaco-arduino-monza: use arduino,monza-sndcard
compatible

 .../bindings/sound/qcom,sm8250.yaml           |  3 ++
 .../boot/dts/qcom/monaco-arduino-monza.dts    |  2 +-
 sound/soc/qcom/sc8280xp.c                     | 34 +++++++++++++++----
 3 files changed, 32 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 ASoC: dt-bindings: qcom,sm8250: add arduino,monza-sndcard compatible

Arduino VENTUNO Q (Monza) uses a board-specific MAX98091 analog audio topology that should not be tied to the generic "qcom,qcs8275-sndcard" compatible shared by other QCS8275 boards such as Monaco EVK.

Add "arduino,monza-sndcard" with "qcom,qcs8275-sndcard" as fallback so the Monza sound card can match its own board configuration while keeping forward and backward Device Tree compatibility.

Fixes 4ba2678ad03e ("ASoC: qcom: sc8280xp: add monaco/monza controls for qcs8275")
---
 Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/sound/qcom,sm8250.yaml +3 -0
index e2e3fc99e6d9..dadefd41ae8b 100644
@@ -16,6 +16,9 @@ description:
 properties:
   compatible:
     oneOf:
+      - items:
+          - const: arduino,monza-sndcard
+          - const: qcom,qcs8275-sndcard
       - items:
           - enum:
               - lenovo,yoga-c630-sndcard
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 ASoC: qcom: sc8280xp: move Arduino Monza config out of qcs8275_priv_data

In reply to Gianfranco Mariotti

Commit 4ba2678ad03e ("ASoC: qcom: sc8280xp: add monaco/monza controls for qcs8275") attached Arduino VENTUNO Q (Monza) MAX98090 widgets, pin switches, DAI format, and 256*fs codec sysclk setup directly to qcs8275_priv_data, which backs the generic "qcom,qcs8275-sndcard" compatible already used by Monaco EVK, Monaco AC EVK, and other QCS8275 carrier boards.

On non-Monza QCS8275 boards this causes multiple regressions:
- Replaces sc8280xp_dapm_widgets with max98090_dapm_widgets and adds max98090_controls, exposing six nonexistent MAX98090 pin switches on Monaco EVK / Monaco AC EVK, colliding with max98357a's "Speaker" DAPM widget, and dropping the "DP0 Jack".."DP7 Jack" widgets.
- Forces codec_sysclk_set (256 * rate on MI2S, bitclock rate on TDM) and codec_dai_fmt (I2S | NB_NF | BC_FC) onto every QCS8275 board's codecs, breaking codecs clocked from a different MCLK rate or DAI format.

Move the MAX98090 configuration to a dedicated monza_priv_data entry bound to "arduino,monza-sndcard" and restore qcs8275_priv_data to the generic QCS8275 defaults while keeping LPI_MI2S DAI ID handling in sc8280xp_snd_hw_params(). Fall back to monza_priv_data when matching "qcom,qcs8275-sndcard" on an "arduino,monza" machine so existing DTBs continue to work.

Fixes 4ba2678ad03e ("ASoC: qcom: sc8280xp: add monaco/monza controls for qcs8275")
---
 sound/soc/qcom/sc8280xp.c | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
sound/soc/qcom/sc8280xp.c +28 -6
index e136407c56bf..874b4a19c78a 100644
@@ -3,6 +3,7 @@
 
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
@@ -522,6 +523,9 @@ static void sc8280xp_add_be_ops(struct snd_soc_card *card)
 	}
 }
 
+static const struct qcom_snd_soc_common monza_priv_data;
+static const struct qcom_snd_soc_common qcs8275_priv_data;
+
 static int sc8280xp_platform_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card;
@@ -542,6 +546,15 @@ static int sc8280xp_platform_probe(struct platform_device *pdev)
 	if (!data->priv)
 		return -ENODEV;
 
+	/*
+	 * Legacy monaco-arduino-monza DTBs used the generic
+	 * "qcom,qcs8275-sndcard" compatible before "arduino,monza-sndcard"
+	 * was introduced.
+	 */
+	if (data->priv == &qcs8275_priv_data &&
+	    of_machine_is_compatible("arduino,monza"))
+		data->priv = &monza_priv_data;
+
 	card->owner = THIS_MODULE;
 	card->dev = dev;
 	dev_set_drvdata(dev, card);
@@ -602,6 +615,18 @@ static const struct qcom_snd_soc_common maili_priv_data = {
 	.wcd_jack = true,
 };
 
+static const struct qcom_snd_soc_common monza_priv_data = {
+	.driver_name = "qcs8300",
+	.dapm_widgets = max98090_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(max98090_dapm_widgets),
+	.controls = max98090_controls,
+	.num_controls = ARRAY_SIZE(max98090_controls),
+	.codec_sysclk_set = true,
+	.codec_dai_fmt = SND_SOC_DAIFMT_NB_NF |
+			 SND_SOC_DAIFMT_I2S |
+			 SND_SOC_DAIFMT_BC_FC,
+};
+
 static const struct qcom_snd_soc_common nord_priv_data = {
 	.driver_name = "nord",
 	.mi2s_bclk_enable = true,
@@ -662,12 +687,8 @@ static const struct qcom_snd_soc_common rubikpi3_priv_data = {
 
 static const struct qcom_snd_soc_common qcs8275_priv_data = {
 	.driver_name = "qcs8300",
-	.dapm_widgets = max98090_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(max98090_dapm_widgets),
-	.controls = max98090_controls,
-	.num_controls = ARRAY_SIZE(max98090_controls),
-	.codec_sysclk_set = true,
-	.codec_dai_fmt = SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_BC_FC,
+	.dapm_widgets = sc8280xp_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(sc8280xp_dapm_widgets),
 };
 
 static const struct qcom_snd_soc_common sc8280xp_priv_data = {
@@ -731,6 +752,7 @@ static const struct qcom_snd_soc_common sm8750_priv_data = {
 };
 
 static const struct of_device_id snd_sc8280xp_dt_match[] = {
+	{ .compatible = "arduino,monza-sndcard", .data = &monza_priv_data },
 	{ .compatible = "ayaneo,pocket-s2-sndcard", .data = &ayaneo_ps2_priv_data },
 	{ .compatible = "qcom,eliza-sndcard", .data = &eliza_priv_data },
 	{ .compatible = "qcom,hawi-sndcard", .data = &hawi_priv_data },
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 arm64: dts: qcom: monaco-arduino-monza: use arduino,monza-sndcard compatible

In reply to Gianfranco Mariotti

Use the dedicated "arduino,monza-sndcard" compatible with "qcom,qcs8275-sndcard" as fallback so Arduino VENTUNO Q (Monza) matches its board-specific sound card configuration without relying on the generic QCS8275 sound card data.

Fixes 70e3a6120ef7 ("arm64: dts: qcom: Add Arduino Monza (VENTUNO Q) board support")
---
 arch/arm64/boot/dts/qcom/monaco-arduino-monza.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/monaco-arduino-monza.dts +1 -1
index 940a03732eef..004b847e8571 100644
@@ -62,7 +62,7 @@ hdmi_connector_in: endpoint {
 	};
 
 	sound {
-		compatible = "qcom,qcs8275-sndcard";
+		compatible = "arduino,monza-sndcard", "qcom,qcs8275-sndcard";
 		model = "arduino-monza";
 		audio-routing = "IN12",  "Headset Mic12",
 				"Headset Mic12",  "MICBIAS",
Signature · 1 line
2.34.1
maintainer
#4 lore raw

Re: (subset) [PATCH 0/3] ASoC: qcom: sc8280xp: decouple Arduino Monza config from qcom,qcs8275-sndcard

In reply to Gianfranco Mariotti
Quoted 10 lines · Gianfranco Mariotti

ASoC: qcom: sc8280xp: decouple Arduino Monza config from qcom,qcs8275-sndcard

Commit 4ba2678ad03e ("ASoC: qcom: sc8280xp: add monaco/monza controls for qcs8275") attached Arduino VENTUNO Q (Monza) MAX98090 widgets, pin switches, DAI format, and 256*fs codec sysclk setup directly to qcs8275_priv_data, which backs the generic "qcom,qcs8275-sndcard" compatible already shared by Monaco EVK, Monaco AC EVK, and other QCS8275 carrier boards.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[1/3] ASoC: dt-bindings: qcom,sm8250: add arduino,monza-sndcard compatible

      https://git.kernel.org/broonie/sound/c/bace70c91d6c
[2/3] ASoC: qcom: sc8280xp: move Arduino Monza config out of qcs8275_priv_data
      https://git.kernel.org/broonie/sound/c/9ad29504a610

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark