* [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support
@ 2026-09-07 18:09 Mohammad Rafi Shaik
2026-09-07 18:09 ` [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table Mohammad Rafi Shaik
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-07 18:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla
Cc: linux-sound, linux-kernel, devicetree, linux-arm-msm,
Mohammad Rafi Shaik
This series adds audio support for the Qualcomm Nord Ride platform and
includes the required machine driver, device tree binding updates, and
codec improvements needed for the board's external audio codec
configuration.
Nord Ride uses a PCM1681 DAC for playback and an ADAU1979 ADC for capture.
Compared to other SC8280XP based platforms, Nord Ride requires
board-specific DAI format and codec clock configuration to support
the external PCM1681 DAC and ADAU1979 ADC.
The series includes:
- Adding OF device matching support to the ADAU1977/78/79 I2C driver,
enabling Device Tree based instantiation.
- Adding optional SCK clock support to the PCM1681 codec driver and
documenting the corresponding DT binding.
- Adding Nord Ride sound card support to the SC8280XP machine driver
with board-specific audio configuration.
- Adding DT bindings for the Nord Ride sound card.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
Mohammad Rafi Shaik (5):
ASoC: codec: adau1977-i2c: Add OF device match table
ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock
ASoC: codec: pcm1681: Enable system clock before regmap access
ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card
ASoC: qcom: sc8280xp: Add Nord Ride sound card support
.../devicetree/bindings/sound/qcom,sm8250.yaml | 1 +
.../devicetree/bindings/sound/ti,pcm1681.yaml | 7 +++
sound/soc/codecs/Kconfig | 4 +-
sound/soc/codecs/adau1977-i2c.c | 9 ++++
sound/soc/codecs/pcm1681.c | 18 +++++++
sound/soc/qcom/sc8280xp.c | 57 ++++++++++++++++++++++
6 files changed, 94 insertions(+), 2 deletions(-)
---
base-commit: 944a035ecca915ae947905dcfb03f2b9dc6d032c
change-id: 20260907-nord-asoc-driver-support-ecf0f38204dc
Best regards,
--
Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
@ 2026-09-07 18:09 ` Mohammad Rafi Shaik
2026-09-09 14:44 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 2/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock Mohammad Rafi Shaik
` (4 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-07 18:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla
Cc: linux-sound, linux-kernel, devicetree, linux-arm-msm,
Mohammad Rafi Shaik
The ADAU1977 I2C driver lacks an OF device match table, preventing
it from binding to codec instances described via Device Tree. Systems
using compatible strings such as "adi,adau1977", "adi,adau1978", or
"adi,adau1979" fail to probe the driver as a result.
Add a descriptive prompt string for SND_SOC_ADAU1977_I2C/SPI so
the driver is visible and selectable when running menuconfig.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
sound/soc/codecs/Kconfig | 4 ++--
sound/soc/codecs/adau1977-i2c.c | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index d3730c4da51b..6f481a54313f 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -526,13 +526,13 @@ config SND_SOC_ADAU1977
tristate
config SND_SOC_ADAU1977_SPI
- tristate
+ tristate "Analog Devices ADAU1977 CODEC - SPI"
depends on SPI_MASTER
select SND_SOC_ADAU1977
select REGMAP_SPI
config SND_SOC_ADAU1977_I2C
- tristate
+ tristate "Analog Devices ADAU1977 CODEC - I2C"
depends on I2C
select SND_SOC_ADAU1977
select REGMAP_I2C
diff --git a/sound/soc/codecs/adau1977-i2c.c b/sound/soc/codecs/adau1977-i2c.c
index d1c6c4ddf506..9f54fa8375b1 100644
--- a/sound/soc/codecs/adau1977-i2c.c
+++ b/sound/soc/codecs/adau1977-i2c.c
@@ -34,9 +34,18 @@ static const struct i2c_device_id adau1977_i2c_ids[] = {
};
MODULE_DEVICE_TABLE(i2c, adau1977_i2c_ids);
+static const struct of_device_id adau1977_i2c_of_match[] __maybe_unused = {
+ { .compatible = "adi,adau1977" },
+ { .compatible = "adi,adau1978" },
+ { .compatible = "adi,adau1979" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, adau1977_i2c_of_match);
+
static struct i2c_driver adau1977_i2c_driver = {
.driver = {
.name = "adau1977",
+ .of_match_table = of_match_ptr(adau1977_i2c_of_match),
},
.probe = adau1977_i2c_probe,
.id_table = adau1977_i2c_ids,
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v1 2/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
2026-09-07 18:09 ` [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table Mohammad Rafi Shaik
@ 2026-09-07 18:09 ` Mohammad Rafi Shaik
2026-09-09 14:50 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access Mohammad Rafi Shaik
` (3 subsequent siblings)
5 siblings, 1 reply; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-07 18:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla
Cc: linux-sound, linux-kernel, devicetree, linux-arm-msm,
Mohammad Rafi Shaik
The PCM1681 can use an external system clock supplied on the SCK input
pin. Platforms that provide this clock need a way to describe the clock
connection in Device Tree.
Document the optional 'clocks' and 'clock-names' properties and define
the clock name as "sck" to represent the external system clock source.
This allows boards using an externally supplied SCK clock to accurately
describe the hardware configuration.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
Documentation/devicetree/bindings/sound/ti,pcm1681.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/ti,pcm1681.yaml b/Documentation/devicetree/bindings/sound/ti,pcm1681.yaml
index 1f0e6787a746..1b38035189a0 100644
--- a/Documentation/devicetree/bindings/sound/ti,pcm1681.yaml
+++ b/Documentation/devicetree/bindings/sound/ti,pcm1681.yaml
@@ -21,6 +21,13 @@ properties:
reg:
maxItems: 1
+ clocks:
+ maxItems: 1
+ description: System clock (SCK)
+
+ clock-names:
+ const: sck
+
"#sound-dai-cells":
const: 0
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
2026-09-07 18:09 ` [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table Mohammad Rafi Shaik
2026-09-07 18:09 ` [PATCH v1 2/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock Mohammad Rafi Shaik
@ 2026-09-07 18:09 ` Mohammad Rafi Shaik
2026-09-08 17:26 ` Mark Brown
2026-09-09 14:59 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card Mohammad Rafi Shaik
` (2 subsequent siblings)
5 siblings, 2 replies; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-07 18:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla
Cc: linux-sound, linux-kernel, devicetree, linux-arm-msm,
Mohammad Rafi Shaik
The PCM1681 DAC requires the SCK (system clock) input to be
present for proper device operation. On platforms where SCK
is provided by a controllable clock source, register accesses
over I2C may fail when the clock is not enabled.
Add optional clock support to the PCM1681 driver by acquiring
the "sck" clock, enabling it during probe, and registering a
managed cleanup action to disable it during device removal or
probe failure.
This allows platforms to model the PCM1681 system clock through
the common clock framework and ensures the device is operational
before regmap initialization and register accesses occur.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
sound/soc/codecs/pcm1681.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
index 60fdbe5c4e05..cfe549176d14 100644
--- a/sound/soc/codecs/pcm1681.c
+++ b/sound/soc/codecs/pcm1681.c
@@ -12,6 +12,7 @@
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/of.h>
+#include <linux/clk.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -74,6 +75,7 @@ struct pcm1681_private {
unsigned int deemph;
/* Current rate for deemphasis control */
unsigned int rate;
+ struct clk *sclk;
};
static const int pcm1681_deemph[] = { 44100, 48000, 32000 };
@@ -311,6 +313,22 @@ static int pcm1681_i2c_probe(struct i2c_client *client)
if (!priv)
return -ENOMEM;
+ priv->sclk = devm_clk_get_optional(&client->dev, "sck");
+ if (IS_ERR(priv->sclk))
+ return dev_err_probe(&client->dev, PTR_ERR(priv->sclk),
+ "Failed to get sck\n");
+
+ ret = clk_prepare_enable(priv->sclk);
+ if (ret)
+ return dev_err_probe(&client->dev, ret,
+ "Failed to enable sck\n");
+
+ ret = devm_add_action_or_reset(&client->dev,
+ (void (*)(void *))clk_disable_unprepare,
+ priv->sclk);
+ if (ret)
+ return ret;
+
priv->regmap = devm_regmap_init_i2c(client, &pcm1681_regmap);
if (IS_ERR(priv->regmap)) {
ret = PTR_ERR(priv->regmap);
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v1 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
` (2 preceding siblings ...)
2026-09-07 18:09 ` [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access Mohammad Rafi Shaik
@ 2026-09-07 18:09 ` Mohammad Rafi Shaik
2026-09-09 14:54 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 5/5] ASoC: qcom: sc8280xp: Add Nord Ride sound card support Mohammad Rafi Shaik
2026-09-09 14:46 ` [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Shawn Guo
5 siblings, 1 reply; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-07 18:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla
Cc: linux-sound, linux-kernel, devicetree, linux-arm-msm,
Mohammad Rafi Shaik
Document the bindings for the Qualcomm Nord Ride board
specific sound card.
The bindings are the same as for other newer Qualcomm ADSP
sound cards, thus keep them in existing qcom,sm8250.yaml file.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
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 1536fcd96d68..bdbaa8c822fc 100644
--- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
@@ -38,6 +38,7 @@ properties:
- fairphone,fp5-sndcard
- qcom,apq8096-sndcard
- qcom,glymur-sndcard
+ - qcom,nord-ride-sndcard
- qcom,qcm6490-idp-sndcard
- qcom,qcs615-sndcard
- qcom,qcs6490-rb3gen2-sndcard
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v1 5/5] ASoC: qcom: sc8280xp: Add Nord Ride sound card support
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
` (3 preceding siblings ...)
2026-09-07 18:09 ` [PATCH v1 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card Mohammad Rafi Shaik
@ 2026-09-07 18:09 ` Mohammad Rafi Shaik
2026-09-09 15:37 ` Shawn Guo
2026-09-09 14:46 ` [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Shawn Guo
5 siblings, 1 reply; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-07 18:09 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla
Cc: linux-sound, linux-kernel, devicetree, linux-arm-msm,
Mohammad Rafi Shaik
Add support for the Nord Ride sound card by introducing a new
compatible string and associated platform private data.
Nord uses external audio codecs with interface requirements that
differ from the generic SC8280XP platforms. Add a dedicated
hw_params callback to configure the appropriate DAI format for
playback and capture streams and to program the codec system clock
configuration required by the board.
The callback configures the PCM1681 playback path to operate in I2S
mode and the ADAU1979 capture path to operate in DSP_A mode. For
capture, the ADAU1979 system clock is sourced from LRCLK as
required by the hardware design.
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
sound/soc/qcom/sc8280xp.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index 4d48e1012cd4..4d8eafca4b7f 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -18,6 +18,7 @@
#include "common.h"
#include "sdw.h"
+#define LRCLK_SYSCLK 1
#define I2S_MCLKFS 256
#define I2S_MCLK_RATE(rate) \
@@ -72,6 +73,8 @@ struct qcom_snd_soc_common {
bool mi2s_bclk_enable;
bool wcd_jack;
int (*snd_prepare)(struct snd_pcm_substream *substream);
+ int (*snd_hw_params)(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params);
};
struct sc8280xp_snd_data {
@@ -244,6 +247,47 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
return 0;
}
+static int nord_snd_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ 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 rate = params_rate(params);
+ int ret;
+
+ switch (cpu_dai->id) {
+ case TERTIARY_MI2S_RX:
+ ret = snd_soc_dai_set_fmt(codec_dai,
+ SND_SOC_DAIFMT_CBC_CFC |
+ SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_I2S);
+ if (ret && ret != -ENOTSUPP)
+ return ret;
+
+ break;
+ case TERTIARY_TDM_TX_7:
+ ret = snd_soc_dai_set_fmt(codec_dai,
+ SND_SOC_DAIFMT_CBC_CFC |
+ SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_DSP_A);
+ if (ret && ret != -ENOTSUPP)
+ return ret;
+
+ /* adau1979 MCLK sourced from LRCLK */
+ ret = snd_soc_component_set_sysclk(codec_dai->component,
+ 0, LRCLK_SYSCLK,
+ rate, SND_SOC_CLOCK_IN);
+ if (ret && ret != -ENOTSUPP)
+ return ret;
+ break;
+ default:
+ break;
+ };
+
+ return 0;
+}
+
static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
@@ -255,6 +299,12 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
int bclk_freq = sc8280xp_get_bclk_freq(params);
int ret;
+ if (data->priv->snd_hw_params) {
+ ret = data->priv->snd_hw_params(substream, params);
+ if (ret)
+ return ret;
+ }
+
switch (cpu_dai->id) {
case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX:
case QUINARY_MI2S_RX ... QUINARY_MI2S_TX:
@@ -461,6 +511,12 @@ static const struct qcom_snd_soc_common kaanapali_priv_data = {
.wcd_jack = true,
};
+static const struct qcom_snd_soc_common nord_ride_priv_data = {
+ .driver_name = "nord",
+ .mi2s_bclk_enable = true,
+ .snd_hw_params = nord_snd_hw_params,
+};
+
static const struct qcom_snd_soc_common qcs9100_priv_data = {
.driver_name = "sa8775p",
.dapm_widgets = sc8280xp_dapm_widgets,
@@ -564,6 +620,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-ride-sndcard", .data = &nord_ride_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 },
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access
2026-09-07 18:09 ` [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access Mohammad Rafi Shaik
@ 2026-09-08 17:26 ` Mark Brown
2026-09-09 12:36 ` Mohammad Rafi Shaik
2026-09-09 14:59 ` Shawn Guo
1 sibling, 1 reply; 16+ messages in thread
From: Mark Brown @ 2026-09-08 17:26 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Lars-Peter Clausen,
Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
[-- Attachment #1: Type: text/plain, Size: 955 bytes --]
On Mon, Sep 07, 2026 at 11:39:44PM +0530, Mohammad Rafi Shaik wrote:
> The PCM1681 DAC requires the SCK (system clock) input to be
> present for proper device operation. On platforms where SCK
> is provided by a controllable clock source, register accesses
> over I2C may fail when the clock is not enabled.
> @@ -311,6 +313,22 @@ static int pcm1681_i2c_probe(struct i2c_client *client)
> if (!priv)
> return -ENOMEM;
>
> + priv->sclk = devm_clk_get_optional(&client->dev, "sck");
> + if (IS_ERR(priv->sclk))
> + return dev_err_probe(&client->dev, PTR_ERR(priv->sclk),
> + "Failed to get sck\n");
> +
> + ret = clk_prepare_enable(priv->sclk);
> + if (ret)
> + return dev_err_probe(&client->dev, ret,
> + "Failed to enable sck\n");
It looks like the device needs a delay after the clock is enabled before
the register interface is available (see 8.3.2 of
https://www.ti.com/lit/ds/symlink/pcm1681-q1.pdf).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access
2026-09-08 17:26 ` Mark Brown
@ 2026-09-09 12:36 ` Mohammad Rafi Shaik
2026-09-09 12:39 ` Mark Brown
0 siblings, 1 reply; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-09 12:36 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Lars-Peter Clausen,
Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On 9/8/2026 10:56 PM, Mark Brown wrote:
> On Mon, Sep 07, 2026 at 11:39:44PM +0530, Mohammad Rafi Shaik wrote:
>> The PCM1681 DAC requires the SCK (system clock) input to be
>> present for proper device operation. On platforms where SCK
>> is provided by a controllable clock source, register accesses
>> over I2C may fail when the clock is not enabled.
>
>> @@ -311,6 +313,22 @@ static int pcm1681_i2c_probe(struct i2c_client *client)
>> if (!priv)
>> return -ENOMEM;
>>
>> + priv->sclk = devm_clk_get_optional(&client->dev, "sck");
>> + if (IS_ERR(priv->sclk))
>> + return dev_err_probe(&client->dev, PTR_ERR(priv->sclk),
>> + "Failed to get sck\n");
>> +
>> + ret = clk_prepare_enable(priv->sclk);
>> + if (ret)
>> + return dev_err_probe(&client->dev, ret,
>> + "Failed to enable sck\n");
>
> It looks like the device needs a delay after the clock is enabled before
> the register interface is available (see 8.3.2 of
> https://www.ti.com/lit/ds/symlink/pcm1681-q1.pdf).
Thanks Mark, for pointing this out.
Yes, based on the datasheet, I can see that the device requires a
Power-On Reset period of 65,536 system clock cycles before the register
interface becomes available.
Although audio functionality working fine without this delay in my
testing, I seem to have overlooked this requirement.
I will verify the behavior and update the driver to include the proper
delay configuration as specified in the datasheet.
Best regard's
Rafi.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access
2026-09-09 12:36 ` Mohammad Rafi Shaik
@ 2026-09-09 12:39 ` Mark Brown
2026-09-09 12:45 ` Mohammad Rafi Shaik
0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2026-09-09 12:39 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Lars-Peter Clausen,
Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On Wed, Sep 09, 2026 at 06:06:41PM +0530, Mohammad Rafi Shaik wrote:
> Although audio functionality working fine without this delay in my testing,
> I seem to have overlooked this requirement.
These sort of sleep after reset requirements often end up getting
implemented naturally due to other things that are going on and then
issues crop up later.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access
2026-09-09 12:39 ` Mark Brown
@ 2026-09-09 12:45 ` Mohammad Rafi Shaik
0 siblings, 0 replies; 16+ messages in thread
From: Mohammad Rafi Shaik @ 2026-09-09 12:45 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Lars-Peter Clausen,
Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On 9/9/2026 6:09 PM, Mark Brown wrote:
> On Wed, Sep 09, 2026 at 06:06:41PM +0530, Mohammad Rafi Shaik wrote:
>
>> Although audio functionality working fine without this delay in my testing,
>> I seem to have overlooked this requirement.
>
> These sort of sleep after reset requirements often end up getting
> implemented naturally due to other things that are going on and then
> issues crop up later.
yes i agree. The current behavior may be working because the delay is
being met implicitly during initialization, which is not something we
should rely on. I'll add an explicit delay based on the datasheet
requirement to make the initialization sequence robust and avoid future
regressions.
Best Regards,
Rafi.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table
2026-09-07 18:09 ` [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table Mohammad Rafi Shaik
@ 2026-09-09 14:44 ` Shawn Guo
0 siblings, 0 replies; 16+ messages in thread
From: Shawn Guo @ 2026-09-09 14:44 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On Mon, Sep 07, 2026 at 11:39:42PM +0530, Mohammad Rafi Shaik wrote:
> The ADAU1977 I2C driver lacks an OF device match table, preventing
> it from binding to codec instances described via Device Tree. Systems
> using compatible strings such as "adi,adau1977", "adi,adau1978", or
> "adi,adau1979" fail to probe the driver as a result.
This justification isn't accurate -- DT instances do bind today. The I2C
core matches DT clients by stripping the vendor prefix from the first
compatible and comparing the result against the driver's id_table:
of_i2c_get_board_info() drivers/i2c/i2c-core-of.c
of_alias_from_compatible() -> client->name = "adau1979"
i2c_device_match() drivers/i2c/i2c-core-base.c
i2c_match_id(driver->id_table, client) -> matches
So "adi,adau1979" already probes without this patch, and the patch as
written doesn't fix a probe failure.
What it does fix -- and what I think the changelog should say -- is
module autoloading. For any client with an of_node, the bus emits the
OF modalias, not the I2C one:
static int i2c_device_uevent(...)
{
rc = of_device_uevent_modalias(dev, env);
if (rc != -ENODEV)
return rc;
...
return add_uevent_var(env, "MODALIAS=%s%s", I2C_MODULE_PREFIX,
client->name);
}
The kernel therefore advertises "of:N...Cadi,adau1979", which no module
claims without MODULE_DEVICE_TABLE(of, ...). With SND_SOC_ADAU1977_I2C=m
the codec module never gets loaded and the card stays in -EPROBE_DEFER
with nothing in the log pointing at the cause.
>
> Add a descriptive prompt string for SND_SOC_ADAU1977_I2C/SPI so
> the driver is visible and selectable when running menuconfig.
This should probably be a separate change?
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
> sound/soc/codecs/Kconfig | 4 ++--
> sound/soc/codecs/adau1977-i2c.c | 9 +++++++++
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
> index d3730c4da51b..6f481a54313f 100644
> --- a/sound/soc/codecs/Kconfig
> +++ b/sound/soc/codecs/Kconfig
> @@ -526,13 +526,13 @@ config SND_SOC_ADAU1977
> tristate
>
> config SND_SOC_ADAU1977_SPI
> - tristate
> + tristate "Analog Devices ADAU1977 CODEC - SPI"
> depends on SPI_MASTER
> select SND_SOC_ADAU1977
> select REGMAP_SPI
>
> config SND_SOC_ADAU1977_I2C
> - tristate
> + tristate "Analog Devices ADAU1977 CODEC - I2C"
> depends on I2C
> select SND_SOC_ADAU1977
> select REGMAP_I2C
> diff --git a/sound/soc/codecs/adau1977-i2c.c b/sound/soc/codecs/adau1977-i2c.c
> index d1c6c4ddf506..9f54fa8375b1 100644
> --- a/sound/soc/codecs/adau1977-i2c.c
> +++ b/sound/soc/codecs/adau1977-i2c.c
> @@ -34,9 +34,18 @@ static const struct i2c_device_id adau1977_i2c_ids[] = {
> };
> MODULE_DEVICE_TABLE(i2c, adau1977_i2c_ids);
>
> +static const struct of_device_id adau1977_i2c_of_match[] __maybe_unused = {
> + { .compatible = "adi,adau1977" },
> + { .compatible = "adi,adau1978" },
> + { .compatible = "adi,adau1979" },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, adau1977_i2c_of_match);
Worth noting for whoever touches this next: the variant is still resolved
via i2c_get_match_data()'s fallback to id_table, since ADAU1977 == 0
can't be expressed through .data. That's fine as-is, but it means
adau1977_i2c_ids[] is now load-bearing in a way that isn't obvious --
removing it as "redundant" would silently make every compatible probe as
ADAU1977.
> +
> static struct i2c_driver adau1977_i2c_driver = {
> .driver = {
> .name = "adau1977",
> + .of_match_table = of_match_ptr(adau1977_i2c_of_match),
Drop of_match_ptr() and the __maybe_unused. Upstream has been removing
of_match_ptr() from drivers for years.
Shawn
> },
> .probe = adau1977_i2c_probe,
> .id_table = adau1977_i2c_ids,
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
` (4 preceding siblings ...)
2026-09-07 18:09 ` [PATCH v1 5/5] ASoC: qcom: sc8280xp: Add Nord Ride sound card support Mohammad Rafi Shaik
@ 2026-09-09 14:46 ` Shawn Guo
5 siblings, 0 replies; 16+ messages in thread
From: Shawn Guo @ 2026-09-09 14:46 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On Mon, Sep 07, 2026 at 11:39:41PM +0530, Mohammad Rafi Shaik wrote:
> This series adds audio support for the Qualcomm Nord Ride platform and
> includes the required machine driver, device tree binding updates, and
> codec improvements needed for the board's external audio codec
> configuration.
>
> Nord Ride uses a PCM1681 DAC for playback and an ADAU1979 ADC for capture.
> Compared to other SC8280XP based platforms, Nord Ride requires
> board-specific DAI format and codec clock configuration to support
> the external PCM1681 DAC and ADAU1979 ADC.
>
> The series includes:
> - Adding OF device matching support to the ADAU1977/78/79 I2C driver,
> enabling Device Tree based instantiation.
> - Adding optional SCK clock support to the PCM1681 codec driver and
> documenting the corresponding DT binding.
> - Adding Nord Ride sound card support to the SC8280XP machine driver
> with board-specific audio configuration.
> - Adding DT bindings for the Nord Ride sound card.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
Hi Mohammad,
May I ask to be copied on the posting of Nord patches? Thanks!
Shawn
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 2/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock
2026-09-07 18:09 ` [PATCH v1 2/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock Mohammad Rafi Shaik
@ 2026-09-09 14:50 ` Shawn Guo
0 siblings, 0 replies; 16+ messages in thread
From: Shawn Guo @ 2026-09-09 14:50 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On Mon, Sep 07, 2026 at 11:39:43PM +0530, Mohammad Rafi Shaik wrote:
> The PCM1681 can use an external system clock supplied on the SCK input
> pin. Platforms that provide this clock need a way to describe the clock
> connection in Device Tree.
>
> Document the optional 'clocks' and 'clock-names' properties and define
> the clock name as "sck" to represent the external system clock source.
>
> This allows boards using an externally supplied SCK clock to accurately
> describe the hardware configuration.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card
2026-09-07 18:09 ` [PATCH v1 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card Mohammad Rafi Shaik
@ 2026-09-09 14:54 ` Shawn Guo
0 siblings, 0 replies; 16+ messages in thread
From: Shawn Guo @ 2026-09-09 14:54 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On Mon, Sep 07, 2026 at 11:39:45PM +0530, Mohammad Rafi Shaik wrote:
> Document the bindings for the Qualcomm Nord Ride board
> specific sound card.
>
> The bindings are the same as for other newer Qualcomm ADSP
> sound cards, thus keep them in existing qcom,sm8250.yaml file.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
> 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 1536fcd96d68..bdbaa8c822fc 100644
> --- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
> +++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
> @@ -38,6 +38,7 @@ properties:
> - fairphone,fp5-sndcard
> - qcom,apq8096-sndcard
> - qcom,glymur-sndcard
> + - qcom,nord-ride-sndcard
I wonder whether we can make it SoC specific like qcom,nord-sndcard,
so that it servers both Ride and RRD reference boards.
Shawn
> - qcom,qcm6490-idp-sndcard
> - qcom,qcs615-sndcard
> - qcom,qcs6490-rb3gen2-sndcard
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access
2026-09-07 18:09 ` [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access Mohammad Rafi Shaik
2026-09-08 17:26 ` Mark Brown
@ 2026-09-09 14:59 ` Shawn Guo
1 sibling, 0 replies; 16+ messages in thread
From: Shawn Guo @ 2026-09-09 14:59 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On Mon, Sep 07, 2026 at 11:39:44PM +0530, Mohammad Rafi Shaik wrote:
> The PCM1681 DAC requires the SCK (system clock) input to be
> present for proper device operation. On platforms where SCK
> is provided by a controllable clock source, register accesses
> over I2C may fail when the clock is not enabled.
>
> Add optional clock support to the PCM1681 driver by acquiring
> the "sck" clock, enabling it during probe, and registering a
> managed cleanup action to disable it during device removal or
> probe failure.
>
> This allows platforms to model the PCM1681 system clock through
> the common clock framework and ensures the device is operational
> before regmap initialization and register accesses occur.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
> sound/soc/codecs/pcm1681.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
> index 60fdbe5c4e05..cfe549176d14 100644
> --- a/sound/soc/codecs/pcm1681.c
> +++ b/sound/soc/codecs/pcm1681.c
> @@ -12,6 +12,7 @@
> #include <linux/i2c.h>
> #include <linux/regmap.h>
> #include <linux/of.h>
> +#include <linux/clk.h>
> #include <sound/pcm.h>
> #include <sound/pcm_params.h>
> #include <sound/soc.h>
> @@ -74,6 +75,7 @@ struct pcm1681_private {
> unsigned int deemph;
> /* Current rate for deemphasis control */
> unsigned int rate;
> + struct clk *sclk;
> };
>
> static const int pcm1681_deemph[] = { 44100, 48000, 32000 };
> @@ -311,6 +313,22 @@ static int pcm1681_i2c_probe(struct i2c_client *client)
> if (!priv)
> return -ENOMEM;
>
> + priv->sclk = devm_clk_get_optional(&client->dev, "sck");
> + if (IS_ERR(priv->sclk))
> + return dev_err_probe(&client->dev, PTR_ERR(priv->sclk),
> + "Failed to get sck\n");
> +
> + ret = clk_prepare_enable(priv->sclk);
> + if (ret)
> + return dev_err_probe(&client->dev, ret,
> + "Failed to enable sck\n");
> +
> + ret = devm_add_action_or_reset(&client->dev,
> + (void (*)(void *))clk_disable_unprepare,
> + priv->sclk);
> + if (ret)
> + return ret;
> +
All three calls can collapse into one?
priv->sclk = devm_clk_get_optional_enabled(&client->dev, "sck");
if (IS_ERR(priv->sclk))
return dev_err_probe(&client->dev, PTR_ERR(priv->sclk), "Failed to get sck\n");
Also, priv->sclk is never used after probe, so drop the struct member
and use a local.
Shawn
> priv->regmap = devm_regmap_init_i2c(client, &pcm1681_regmap);
> if (IS_ERR(priv->regmap)) {
> ret = PTR_ERR(priv->regmap);
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v1 5/5] ASoC: qcom: sc8280xp: Add Nord Ride sound card support
2026-09-07 18:09 ` [PATCH v1 5/5] ASoC: qcom: sc8280xp: Add Nord Ride sound card support Mohammad Rafi Shaik
@ 2026-09-09 15:37 ` Shawn Guo
0 siblings, 0 replies; 16+ messages in thread
From: Shawn Guo @ 2026-09-09 15:37 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Lars-Peter Clausen, Nuno Sá,
Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Srinivas Kandagatla,
linux-sound, linux-kernel, devicetree, linux-arm-msm
On Mon, Sep 07, 2026 at 11:39:46PM +0530, Mohammad Rafi Shaik wrote:
> Add support for the Nord Ride sound card by introducing a new
> compatible string and associated platform private data.
>
> Nord uses external audio codecs with interface requirements that
> differ from the generic SC8280XP platforms. Add a dedicated
> hw_params callback to configure the appropriate DAI format for
> playback and capture streams and to program the codec system clock
> configuration required by the board.
>
> The callback configures the PCM1681 playback path to operate in I2S
> mode and the ADAU1979 capture path to operate in DSP_A mode. For
> capture, the ADAU1979 system clock is sourced from LRCLK as
> required by the hardware design.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
> sound/soc/qcom/sc8280xp.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 57 insertions(+)
>
> diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> index 4d48e1012cd4..4d8eafca4b7f 100644
> --- a/sound/soc/qcom/sc8280xp.c
> +++ b/sound/soc/qcom/sc8280xp.c
> @@ -18,6 +18,7 @@
> #include "common.h"
> #include "sdw.h"
>
> +#define LRCLK_SYSCLK 1
Rather than open-coding the value, please move
enum adau1977_clk_id;
enum adau1977_sysclk_src;
out of sound/soc/codecs/adau1977.h into include/sound/adau1977.h so
machine drivers can include them, and write the call as
snd_soc_component_set_sysclk(codec_dai->component,
ADAU1977_SYSCLK, ADAU1977_SYSCLK_SRC_LRCLK,
rate, SND_SOC_CLOCK_IN);
That documents both slots and turns a mix-up into a compile error.
> #define I2S_MCLKFS 256
>
> #define I2S_MCLK_RATE(rate) \
> @@ -72,6 +73,8 @@ struct qcom_snd_soc_common {
> bool mi2s_bclk_enable;
> bool wcd_jack;
> int (*snd_prepare)(struct snd_pcm_substream *substream);
> + int (*snd_hw_params)(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params);
> };
>
> struct sc8280xp_snd_data {
> @@ -244,6 +247,47 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
> return 0;
> }
>
> +static int nord_snd_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params)
> +{
> + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
> + 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 rate = params_rate(params);
> + int ret;
> +
> + switch (cpu_dai->id) {
> + case TERTIARY_MI2S_RX:
> + ret = snd_soc_dai_set_fmt(codec_dai,
> + SND_SOC_DAIFMT_CBC_CFC |
> + SND_SOC_DAIFMT_NB_NF |
> + SND_SOC_DAIFMT_I2S);
> + if (ret && ret != -ENOTSUPP)
> + return ret;
> +
> + break;
> + case TERTIARY_TDM_TX_7:
> + ret = snd_soc_dai_set_fmt(codec_dai,
> + SND_SOC_DAIFMT_CBC_CFC |
> + SND_SOC_DAIFMT_NB_NF |
> + SND_SOC_DAIFMT_DSP_A);
> + if (ret && ret != -ENOTSUPP)
> + return ret;
> +
> + /* adau1979 MCLK sourced from LRCLK */
The comment says MCLK is sourced from LRCLK, but the adau1977_set_sysclk()
call selects the PLL input (ADAU1977_PLL_CLK_S) -- MCLK is the other choice.
Something like "PLL clocked from LRCLK, no external MCLK" would match
the register write?
> + ret = snd_soc_component_set_sysclk(codec_dai->component,
> + 0, LRCLK_SYSCLK,
> + rate, SND_SOC_CLOCK_IN);
There seems to be two problems, one functional and one cosmetic.
First, I guess this is called too late to have the intended effect. On
the ADAU1977 side, set_sysclk() doesn't only pick the clock source, it
also computes the rate constraint mask:
} else if (source == ADAU1977_SYSCLK_SRC_LRCLK) {
mask = ADAU1977_RATE_CONSTRAINT_MASK_LRCLK;
}
...
adau1977->constraints.mask = mask;
and that mask is consumed in adau1977_startup():
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_RATE, &adau1977->constraints);
startup() runs before hw_params(), so on the first capture open after
boot the mask is still 0 from probe and the rate constraint is not what
the LRCLK-sourced configuration requires. Setting the source once from a
dai_link init (or from a startup callback) rather than per-hw_params
would get the ordering right and also avoid reprogramming the PLL source
on every stream open. Could you confirm what the first arecord after
ot negotiates? I suspect it only appears to work because the rate you
test with is permitted by the unconstrained list anyway.
Second, on the naming. The prototype is
int snd_soc_component_set_sysclk(struct snd_soc_component *component,
int clk_id, int source,
unsigned int freq, int dir);
so in the call above the literal 0 is the clk_id (ADAU1977_SYSCLK) and
LRCLK_SYSCLK is the source (ADAU1977_SYSCLK_SRC_LRCLK). The macro name
reads like a clk_id, which is the slot it is *not* in, while the argument
that really is a clk_id is an unexplained 0.
> + if (ret && ret != -ENOTSUPP)
> + return ret;
> + break;
> + default:
> + break;
> + };
Stray semicolon
> +
> + return 0;
> +}
> +
> static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
> struct snd_pcm_hw_params *params)
> {
> @@ -255,6 +299,12 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
> int bclk_freq = sc8280xp_get_bclk_freq(params);
> int ret;
>
> + if (data->priv->snd_hw_params) {
> + ret = data->priv->snd_hw_params(substream, params);
> + if (ret)
> + return ret;
> + }
> +
> switch (cpu_dai->id) {
> case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX:
> case QUINARY_MI2S_RX ... QUINARY_MI2S_TX:
> @@ -461,6 +511,12 @@ static const struct qcom_snd_soc_common kaanapali_priv_data = {
> .wcd_jack = true,
> };
>
> +static const struct qcom_snd_soc_common nord_ride_priv_data = {
Again, can we drop "ride" to make it nord specific?
Shawn
> + .driver_name = "nord",
> + .mi2s_bclk_enable = true,
> + .snd_hw_params = nord_snd_hw_params,
> +};
> +
> static const struct qcom_snd_soc_common qcs9100_priv_data = {
> .driver_name = "sa8775p",
> .dapm_widgets = sc8280xp_dapm_widgets,
> @@ -564,6 +620,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-ride-sndcard", .data = &nord_ride_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 },
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-09-09 15:37 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07 18:09 [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Mohammad Rafi Shaik
2026-09-07 18:09 ` [PATCH v1 1/5] ASoC: codec: adau1977-i2c: Add OF device match table Mohammad Rafi Shaik
2026-09-09 14:44 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 2/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock Mohammad Rafi Shaik
2026-09-09 14:50 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 3/5] ASoC: codec: pcm1681: Enable system clock before regmap access Mohammad Rafi Shaik
2026-09-08 17:26 ` Mark Brown
2026-09-09 12:36 ` Mohammad Rafi Shaik
2026-09-09 12:39 ` Mark Brown
2026-09-09 12:45 ` Mohammad Rafi Shaik
2026-09-09 14:59 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord Ride sound card Mohammad Rafi Shaik
2026-09-09 14:54 ` Shawn Guo
2026-09-07 18:09 ` [PATCH v1 5/5] ASoC: qcom: sc8280xp: Add Nord Ride sound card support Mohammad Rafi Shaik
2026-09-09 15:37 ` Shawn Guo
2026-09-09 14:46 ` [PATCH 0/5] ASoC: qcom: Add Nord Ride audio support Shawn Guo
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®