mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
To: Srinivas Kandagatla <srini@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>,
	Abel Vesa <abelvesa@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
Subject: [PATCH 2/3] ASoC: qcom: sc8280xp: move Arduino Monza config out of qcs8275_priv_data
Date: Mon, 30 Nov 2026 02:20:13 +0100	[thread overview]
Message-ID: <20261130012014.181326-3-gianfranco.mariotti94@gmail.com> (raw)
In-Reply-To: <20261130012014.181326-1-gianfranco.mariotti94@gmail.com>

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")
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
---
 sound/soc/qcom/sc8280xp.c | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index e136407c56bf..874b4a19c78a 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -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 },
-- 
2.34.1


  parent reply	other threads:[~2026-11-30  1:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  1:20 [PATCH 0/3] ASoC: qcom: sc8280xp: decouple Arduino Monza config from qcom,qcs8275-sndcard Gianfranco Mariotti
2026-11-30  1:20 ` [PATCH 1/3] ASoC: dt-bindings: qcom,sm8250: add arduino,monza-sndcard compatible Gianfranco Mariotti
2026-11-30  1:20 ` Gianfranco Mariotti [this message]
2026-11-30  1:20 ` [PATCH 3/3] arm64: dts: qcom: monaco-arduino-monza: use " Gianfranco Mariotti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130012014.181326-3-gianfranco.mariotti94@gmail.com \
    --to=gianfranco.mariotti94@gmail.com \
    --cc=abelvesa@kernel.org \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®