Re: [PATCH v3 7/7] ASoC: qcom: sc8280xp: Add Nord sound card support

From: Mohammad Rafi Shaik

Date: Wed Oct 14 2026 - 13:20:16 EST




On 10/13/2026 2:39 PM, Ajay Kumar Nandam wrote:


On 10/9/2026 6:42 PM, Mohammad Rafi Shaik wrote:
Add support for the Nord Ride and RRD sound cards by introducing the
qcom,nord-sndcard compatible and associated platform-specific data.
Nord uses external codecs for its playback and capture paths and requires
board-specific DAI and clock configuration. Configure the codec DAI format
for DSP_A operation and enable MI2S bit clock handling for the platform.
Add a platform-specific sound card initialization callback to configure
the ADAU1979 capture codec to use LRCLK as its system clock source. This
configuration is done during DAI link initialization so that the codec
clock source and associated rate constraints are established before the
capture stream is opened.

Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@xxxxxxxxxxxxxxxx>
---

+static int nord_snd_init(struct snd_soc_pcm_runtime *rtd)
+{
+    struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
+    struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+    int ret;
+
+    switch (cpu_dai->id) {
+    case AIF_TDM_TX_8:
+        /*
+         * adau1979 PLL clocked from LRCLK, no external MCLK. Selecting
+         * the source also installs the PLL rate constraint, which the
+         * codec applies from its startup() callback, so it has to be
+         * in place before the first stream is opened. The frequency is
+         * unused for an LRCLK-sourced PLL.
+         */
+        ret = snd_soc_component_set_sysclk(codec_dai->component,
+                           ADAU1977_SYSCLK,
+                           ADAU1977_SYSCLK_SRC_LRCLK,
+                           48000, SND_SOC_CLOCK_IN);
+        if (ret && ret != -ENOTSUPP)
+            return ret;

If this link is always connected to the ADAU1979, should we be ignoring -ENOTSUPP here?

snd_soc_component_set_sysclk() returns -ENOTSUPP when the component does not provide a .set_sysclk() callback. In that case we'd continue without applying the LRCLK clock source configuration, while the commit message states that this setup is required before startup.

Is there a case where AIF_TDM_TX_8 can be paired with a component that
legitimately lacks .set_sysclk() support?


Ack, will fix this in next revision.

Best Regards,
Rafi.

+        break;
+    default:
+        break;
+    }
+
+    return 0;
+}
+
  static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
                    struct snd_pcm_hw_params *params)
  {
@@ -552,6 +593,15 @@ static const struct qcom_snd_soc_common kaanapali_priv_data = {
      .wcd_jack = true,
  };
+static const struct qcom_snd_soc_common nord_priv_data = {
+    .driver_name = "nord",
+    .mi2s_bclk_enable = true,
+    .codec_dai_fmt = SND_SOC_DAIFMT_CBC_CFC |
+             SND_SOC_DAIFMT_NB_NF |
+             SND_SOC_DAIFMT_DSP_A,
+    .snd_init = nord_snd_init,
+};
+
  static const struct qcom_snd_soc_common qcs9100_priv_data = {
      .driver_name = "sa8775p",
      .dapm_widgets = sc8280xp_dapm_widgets,
@@ -677,6 +727,7 @@ static const struct of_device_id snd_sc8280xp_dt_match[] = {
      { .compatible = "qcom,hawi-sndcard", .data = &hawi_priv_data },
      { .compatible = "qcom,kaanapali-sndcard", .data = &kaanapali_priv_data },
      { .compatible = "qcom,maili-sndcard", .data = &hawi_priv_data },
+    { .compatible = "qcom,nord-sndcard", .data = &nord_priv_data },
      { .compatible = "qcom,qcm6490-idp-sndcard", .data = &qcm6490_priv_data },
      { .compatible = "qcom,qcs615-sndcard", .data = &qcs615_priv_data },
      { .compatible = "qcom,qcs6490-rb3gen2-sndcard", .data = &qcs6490_priv_data },