* [PATCH v2 1/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock
2026-10-08 11:06 [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Mohammad Rafi Shaik
@ 2026-10-08 11:06 ` Mohammad Rafi Shaik
2026-10-08 11:06 ` [PATCH v2 2/5] ASoC: codec: pcm1681: Add optional SCK clock and runtime PM support Mohammad Rafi Shaik
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Mohammad Rafi Shaik @ 2026-10-08 11:06 UTC (permalink / raw)
To: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, Shawn Guo
Cc: Mohammad Rafi Shaik, linux-sound, devicetree, linux-kernel,
linux-arm-msm
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>
---
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 1f0e6787a..1b3803518 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] 9+ messages in thread* [PATCH v2 2/5] ASoC: codec: pcm1681: Add optional SCK clock and runtime PM support
2026-10-08 11:06 [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Mohammad Rafi Shaik
2026-10-08 11:06 ` [PATCH v2 1/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock Mohammad Rafi Shaik
@ 2026-10-08 11:06 ` Mohammad Rafi Shaik
2026-10-08 11:06 ` [PATCH v2 3/5] ASoC: codec: pcm1681: Add TDM support Mohammad Rafi Shaik
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Mohammad Rafi Shaik @ 2026-10-08 11:06 UTC (permalink / raw)
To: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, Shawn Guo
Cc: Mohammad Rafi Shaik, linux-sound, devicetree, linux-kernel,
linux-arm-msm
The PCM1681 requires its SCK system clock to be running before register
access. On platforms where SCK is provided by a gateable clock, register
access may fail when the clock is disabled.
Add support for an optional "sck" clock and enable it before accessing the
device. After enabling SCK, wait for the required 65536 system clock cycles
to allow the device to complete its internal reset sequence.
Use runtime PM to manage SCK instead of keeping it enabled for the lifetime
of the device. Disable the clock during runtime suspend and restore it on
runtime resume. Use autosuspend to avoid unnecessary clock toggling between
closely spaced accesses.
Since the device register state may be lost when SCK is disabled, enable
the regmap cache. Switch regmap to cache-only mode and mark the cache
dirty on runtime suspend, then synchronize the cached register state after
SCK is restored on runtime resume. Mark the zero-detect status register
volatile since it is updated by hardware.
Drop idle_bias_on so that the component can reach SND_SOC_BIAS_OFF and
runtime suspend can gate SCK.
Assisted-by: LLM
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
sound/soc/codecs/pcm1681.c | 137 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 131 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
index 60fdbe5c4..a1ccf1edf 100644
--- a/sound/soc/codecs/pcm1681.c
+++ b/sound/soc/codecs/pcm1681.c
@@ -12,6 +12,8 @@
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/of.h>
+#include <linux/clk.h>
+#include <linux/pm_runtime.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
@@ -36,6 +38,12 @@
#define PCM1681_DEEMPH_CONTROL 0x0a /* De-emphasis control */
#define PCM1681_ZERO_DETECT_STATUS 0x0e /* Zero detect status reg */
+/*
+ * The DAC requires 65536 system clock cycles after the clock is supplied to
+ * complete its internal reset sequence before it is ready to be used.
+ */
+#define PCM1681_SCK_SETTLE_CYCLES 65536
+
static const struct reg_default pcm1681_reg_defaults[] = {
{ 0x01, 0xff },
{ 0x02, 0xff },
@@ -67,6 +75,12 @@ static bool pcm1681_writeable_reg(struct device *dev, unsigned int reg)
(reg != PCM1681_ZERO_DETECT_STATUS);
}
+static bool pcm1681_volatile_reg(struct device *dev, unsigned int reg)
+{
+ /* Status is updated by the hardware and must never be cached */
+ return reg == PCM1681_ZERO_DETECT_STATUS;
+}
+
struct pcm1681_private {
struct regmap *regmap;
unsigned int format;
@@ -74,8 +88,24 @@ struct pcm1681_private {
unsigned int deemph;
/* Current rate for deemphasis control */
unsigned int rate;
+ struct clk *sck;
};
+/* Wait for the DAC to come out of its internal reset after sck is enabled */
+static void pcm1681_sck_settle(struct pcm1681_private *priv)
+{
+ unsigned long rate = clk_get_rate(priv->sck);
+
+ /*
+ * sck is optional, so there may be no clock to wait on, and its rate
+ * is not always discoverable. Only wait when the cycle count can be
+ * converted into a delay.
+ */
+ if (rate)
+ fsleep(DIV_ROUND_UP_ULL(PCM1681_SCK_SETTLE_CYCLES *
+ (u64)USEC_PER_SEC, rate));
+}
+
static const int pcm1681_deemph[] = { 44100, 48000, 32000 };
static int pcm1681_set_deemph(struct snd_soc_component *component)
@@ -282,6 +312,8 @@ static const struct regmap_config pcm1681_regmap = {
.num_reg_defaults = ARRAY_SIZE(pcm1681_reg_defaults),
.writeable_reg = pcm1681_writeable_reg,
.readable_reg = pcm1681_accessible_reg,
+ .volatile_reg = pcm1681_volatile_reg,
+ .cache_type = REGCACHE_MAPLE,
};
static const struct snd_soc_component_driver soc_component_dev_pcm1681 = {
@@ -291,7 +323,6 @@ static const struct snd_soc_component_driver soc_component_dev_pcm1681 = {
.num_dapm_widgets = ARRAY_SIZE(pcm1681_dapm_widgets),
.dapm_routes = pcm1681_dapm_routes,
.num_dapm_routes = ARRAY_SIZE(pcm1681_dapm_routes),
- .idle_bias_on = 1,
.use_pmdown_time = 1,
.endianness = 1,
};
@@ -304,34 +335,128 @@ MODULE_DEVICE_TABLE(i2c, pcm1681_i2c_id);
static int pcm1681_i2c_probe(struct i2c_client *client)
{
+ struct device *dev = &client->dev;
int ret;
struct pcm1681_private *priv;
- priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
+ priv->sck = devm_clk_get_optional(dev, "sck");
+ if (IS_ERR(priv->sck))
+ return dev_err_probe(dev, PTR_ERR(priv->sck),
+ "Failed to get sck\n");
+
priv->regmap = devm_regmap_init_i2c(client, &pcm1681_regmap);
if (IS_ERR(priv->regmap)) {
ret = PTR_ERR(priv->regmap);
- dev_err(&client->dev, "Failed to create regmap: %d\n", ret);
+ dev_err(dev, "Failed to create regmap: %d\n", ret);
return ret;
}
+ /* Must be set before runtime PM is enabled, the callbacks use it */
i2c_set_clientdata(client, priv);
- return devm_snd_soc_register_component(&client->dev,
- &soc_component_dev_pcm1681,
- &pcm1681_dai, 1);
+ ret = clk_prepare_enable(priv->sck);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to enable sck\n");
+
+ pcm1681_sck_settle(priv);
+
+ /* The clock is on, so hand the now-active device over to runtime PM */
+ pm_runtime_set_autosuspend_delay(dev, 100);
+ pm_runtime_use_autosuspend(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+ pm_runtime_idle(dev);
+
+ ret = devm_snd_soc_register_component(dev,
+ &soc_component_dev_pcm1681,
+ &pcm1681_dai, 1);
+ if (ret) {
+ dev_err(dev, "Failed to register component: %d\n", ret);
+ goto err_pm;
+ }
+
+ return 0;
+
+err_pm:
+ pm_runtime_dont_use_autosuspend(dev);
+ pm_runtime_disable(dev);
+ if (!pm_runtime_status_suspended(dev))
+ clk_disable_unprepare(priv->sck);
+ pm_runtime_set_suspended(dev);
+
+ return ret;
}
+static void pcm1681_i2c_remove(struct i2c_client *client)
+{
+ struct pcm1681_private *priv = i2c_get_clientdata(client);
+ struct device *dev = &client->dev;
+
+ pm_runtime_dont_use_autosuspend(dev);
+ pm_runtime_disable(dev);
+ /* Runtime PM may already have gated the clock */
+ if (!pm_runtime_status_suspended(dev))
+ clk_disable_unprepare(priv->sck);
+ pm_runtime_set_suspended(dev);
+}
+
+static int pcm1681_runtime_suspend(struct device *dev)
+{
+ struct pcm1681_private *priv = dev_get_drvdata(dev);
+
+ /*
+ * Registers lose their contents once the clock is gated, so serve
+ * further access from the cache and replay it on resume.
+ */
+ regcache_cache_only(priv->regmap, true);
+ regcache_mark_dirty(priv->regmap);
+
+ clk_disable_unprepare(priv->sck);
+
+ return 0;
+}
+
+static int pcm1681_runtime_resume(struct device *dev)
+{
+ struct pcm1681_private *priv = dev_get_drvdata(dev);
+ int ret;
+
+ ret = clk_prepare_enable(priv->sck);
+ if (ret) {
+ dev_err(dev, "Failed to enable sck: %d\n", ret);
+ return ret;
+ }
+
+ pcm1681_sck_settle(priv);
+
+ regcache_cache_only(priv->regmap, false);
+ ret = regcache_sync(priv->regmap);
+ if (ret) {
+ dev_err(dev, "Failed to sync regcache: %d\n", ret);
+ regcache_cache_only(priv->regmap, true);
+ clk_disable_unprepare(priv->sck);
+ return ret;
+ }
+
+ return 0;
+}
+
+static DEFINE_RUNTIME_DEV_PM_OPS(pcm1681_pm_ops, pcm1681_runtime_suspend,
+ pcm1681_runtime_resume, NULL);
+
static struct i2c_driver pcm1681_i2c_driver = {
.driver = {
.name = "pcm1681",
.of_match_table = of_match_ptr(pcm1681_dt_ids),
+ .pm = pm_ptr(&pcm1681_pm_ops),
},
.id_table = pcm1681_i2c_id,
.probe = pcm1681_i2c_probe,
+ .remove = pcm1681_i2c_remove,
};
module_i2c_driver(pcm1681_i2c_driver);
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v2 3/5] ASoC: codec: pcm1681: Add TDM support
2026-10-08 11:06 [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Mohammad Rafi Shaik
2026-10-08 11:06 ` [PATCH v2 1/5] ASoC: dt-bindings: ti,pcm1681: Document the optional SCK clock Mohammad Rafi Shaik
2026-10-08 11:06 ` [PATCH v2 2/5] ASoC: codec: pcm1681: Add optional SCK clock and runtime PM support Mohammad Rafi Shaik
@ 2026-10-08 11:06 ` Mohammad Rafi Shaik
2026-10-08 11:06 ` [PATCH v2 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord sound card Mohammad Rafi Shaik
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Mohammad Rafi Shaik @ 2026-10-08 11:06 UTC (permalink / raw)
To: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, Shawn Guo
Cc: Mohammad Rafi Shaik, linux-sound, devicetree, linux-kernel,
linux-arm-msm
The PCM1681 selects the audio interface format using FMT[3:0] in the
format register. The driver currently supports only I2S, left-justified,
and right-justified formats, preventing a machine driver from selecting
TDM mode.
Add support for SND_SOC_DAIFMT_DSP_A and program the PCM1681 I2S TDM
format when it is selected. Also advertise DSP_A in the selectable DAI
formats.
While adding TDM support, correct the reset default for the format
register from 0x06 to 0x05. The current default does not match the
hardware reset value. Although this has no effect while regmap caching
is disabled, it could cause the TDM format write to be skipped if
regmap caching is enabled in the future.
The existing I2S, left-justified, and right-justified formats remain
unchanged.
Assisted-by: LLM
Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
---
sound/soc/codecs/pcm1681.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
index a1ccf1edf..3675b2236 100644
--- a/sound/soc/codecs/pcm1681.c
+++ b/sound/soc/codecs/pcm1681.c
@@ -53,7 +53,7 @@ static const struct reg_default pcm1681_reg_defaults[] = {
{ 0x06, 0xff },
{ 0x07, 0x00 },
{ 0x08, 0x00 },
- { 0x09, 0x06 },
+ { 0x09, 0x05 },
{ 0x0A, 0x00 },
{ 0x0B, 0xff },
{ 0x0C, 0x0f },
@@ -217,6 +217,9 @@ static int pcm1681_hw_params(struct snd_pcm_substream *substream,
case SND_SOC_DAIFMT_LEFT_J:
val = 0x05;
break;
+ case SND_SOC_DAIFMT_DSP_A:
+ val = 0x06;
+ break;
default:
dev_err(component->dev, "Invalid DAI format\n");
return -EINVAL;
@@ -232,7 +235,8 @@ static int pcm1681_hw_params(struct snd_pcm_substream *substream,
static const u64 pcm1681_selectable_formats =
SND_SOC_POSSIBLE_DAIFMT_I2S |
SND_SOC_POSSIBLE_DAIFMT_RIGHT_J |
- SND_SOC_POSSIBLE_DAIFMT_LEFT_J;
+ SND_SOC_POSSIBLE_DAIFMT_LEFT_J |
+ SND_SOC_POSSIBLE_DAIFMT_DSP_A;
static const struct snd_soc_dai_ops pcm1681_dai_ops = {
.set_fmt = pcm1681_set_dai_fmt,
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v2 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord sound card
2026-10-08 11:06 [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Mohammad Rafi Shaik
` (2 preceding siblings ...)
2026-10-08 11:06 ` [PATCH v2 3/5] ASoC: codec: pcm1681: Add TDM support Mohammad Rafi Shaik
@ 2026-10-08 11:06 ` Mohammad Rafi Shaik
2026-10-08 19:48 ` Rob Herring (Arm)
2026-10-08 11:06 ` [PATCH v2 5/5] ASoC: qcom: sc8280xp: Add Nord sound card support Mohammad Rafi Shaik
2026-10-09 1:50 ` [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Shawn Guo
5 siblings, 1 reply; 9+ messages in thread
From: Mohammad Rafi Shaik @ 2026-10-08 11:06 UTC (permalink / raw)
To: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, Shawn Guo
Cc: Mohammad Rafi Shaik, linux-sound, devicetree, linux-kernel,
linux-arm-msm
Document the bindings for the Qualcomm Nord 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 fc7bccdac..372919ff9 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-sndcard
- qcom,qcm6490-idp-sndcard
- qcom,qcs615-sndcard
- qcom,qcs6490-rb3gen2-sndcard
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord sound card
2026-10-08 11:06 ` [PATCH v2 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord sound card Mohammad Rafi Shaik
@ 2026-10-08 19:48 ` Rob Herring (Arm)
0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring (Arm) @ 2026-10-08 19:48 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Shawn Guo, Conor Dooley, Kevin Lu, Shenghao Ding,
Krzysztof Kozlowski, Liam Girdwood, linux-sound,
Srinivas Kandagatla, linux-kernel, linux-arm-msm, Sen Wang,
Mark Brown, devicetree, Takashi Iwai, Jaroslav Kysela, Baojun Xu
On Thu, 08 Oct 2026 16:36:44 +0530, Mohammad Rafi Shaik wrote:
> Document the bindings for the Qualcomm Nord 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(+)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 5/5] ASoC: qcom: sc8280xp: Add Nord sound card support
2026-10-08 11:06 [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Mohammad Rafi Shaik
` (3 preceding siblings ...)
2026-10-08 11:06 ` [PATCH v2 4/5] ASoC: dt-bindings: qcom,sm8250: Add Nord sound card Mohammad Rafi Shaik
@ 2026-10-08 11:06 ` Mohammad Rafi Shaik
2026-10-09 1:50 ` [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Shawn Guo
5 siblings, 0 replies; 9+ messages in thread
From: Mohammad Rafi Shaik @ 2026-10-08 11:06 UTC (permalink / raw)
To: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, Shawn Guo
Cc: Mohammad Rafi Shaik, linux-sound, devicetree, linux-kernel,
linux-arm-msm
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@oss.qualcomm.com>
---
sound/soc/qcom/sc8280xp.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index b5d367486..a759ae951 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -25,6 +25,10 @@
#define I2S_BIT_RATE(rate, channels, format) \
((rate) * (channels) * (format))
+#define ADAU1977_SYSCLK 0
+#define ADAU1977_SYSCLK_SRC_MCLK 0
+#define ADAU1977_SYSCLK_SRC_LRCLK 1
+
static struct snd_soc_dapm_widget sc8280xp_dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
@@ -92,6 +96,7 @@ struct qcom_snd_soc_common {
bool wcd_jack;
const struct sc8280xp_dai_data *dai_data;
size_t num_dai_data;
+ int (*snd_init)(struct snd_soc_pcm_runtime *rtd);
int (*snd_prepare)(struct snd_pcm_substream *substream);
};
@@ -224,9 +229,16 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_card *card = rtd->card;
struct snd_soc_jack *dp_jack = NULL;
int dp_pcm_id = 0;
+ int ret;
dai_data = sc8280xp_get_dai_data(data->priv, cpu_dai->id);
+ if (data->priv->snd_init) {
+ ret = data->priv->snd_init(rtd);
+ if (ret)
+ return ret;
+ }
+
switch (cpu_dai->id) {
case WSA_CODEC_DMA_RX_0:
case WSA_CODEC_DMA_RX_1:
@@ -305,6 +317,35 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
return 0;
}
+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;
+ 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 },
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/5] ASoC: qcom: Add Nord audio support
2026-10-08 11:06 [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Mohammad Rafi Shaik
` (4 preceding siblings ...)
2026-10-08 11:06 ` [PATCH v2 5/5] ASoC: qcom: sc8280xp: Add Nord sound card support Mohammad Rafi Shaik
@ 2026-10-09 1:50 ` Shawn Guo
2026-10-09 6:18 ` Mohammad Rafi Shaik
5 siblings, 1 reply; 9+ messages in thread
From: Shawn Guo @ 2026-10-09 1:50 UTC (permalink / raw)
To: Mohammad Rafi Shaik
Cc: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, linux-sound,
devicetree, linux-kernel, linux-arm-msm
On Thu, Oct 08, 2026 at 04:36:40PM +0530, Mohammad Rafi Shaik wrote:
> This series adds audio support for the Qualcomm Nord Ride and
> RRD boards 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.
>
> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
> ---
> Changes in v2:
> - Dropped patch 1 from v1, as the ADAU1979 codec change has already been applied.
> - Moved the compatible string from the board-specific file to the SoC file, as suggested by Shawn.
> - Added runtime PM support to the PCM1681 codec to manage the SCK clock sequence.
> - Added TDM support to the PCM1681 codec.
> - Added the required POR delay to the PCM1681 codec, as suggested by Mark Brown.
> - Replaced LPASS DAI IDs with QAIF DAI IDs.
> - Link to v1: https://patch.msgid.link/20260907-nord-asoc-driver-support-v1-0-997d3b20cf43@oss.qualcomm.com
I expect some PCM1681 driver changes in v2 to address Konrad's
comment [1]. Or do I miss something?
Shawn
[1] https://lore.kernel.org/all/d2d2feff-4823-43dc-9014-099e69195280@oss.qualcomm.com/
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/5] ASoC: qcom: Add Nord audio support
2026-10-09 1:50 ` [PATCH v2 0/5] ASoC: qcom: Add Nord audio support Shawn Guo
@ 2026-10-09 6:18 ` Mohammad Rafi Shaik
0 siblings, 0 replies; 9+ messages in thread
From: Mohammad Rafi Shaik @ 2026-10-09 6:18 UTC (permalink / raw)
To: Shawn Guo
Cc: Shenghao Ding, Kevin Lu, Baojun Xu, Sen Wang, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla, linux-sound,
devicetree, linux-kernel, linux-arm-msm
On 10/9/2026 7:20 AM, Shawn Guo wrote:
> On Thu, Oct 08, 2026 at 04:36:40PM +0530, Mohammad Rafi Shaik wrote:
>> This series adds audio support for the Qualcomm Nord Ride and
>> RRD boards 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.
>>
>> Signed-off-by: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
>> ---
>> Changes in v2:
>> - Dropped patch 1 from v1, as the ADAU1979 codec change has already been applied.
>> - Moved the compatible string from the board-specific file to the SoC file, as suggested by Shawn.
>> - Added runtime PM support to the PCM1681 codec to manage the SCK clock sequence.
>> - Added TDM support to the PCM1681 codec.
>> - Added the required POR delay to the PCM1681 codec, as suggested by Mark Brown.
>> - Replaced LPASS DAI IDs with QAIF DAI IDs.
>> - Link to v1: https://patch.msgid.link/20260907-nord-asoc-driver-support-v1-0-997d3b20cf43@oss.qualcomm.com
>
> I expect some PCM1681 driver changes in v2 to address Konrad's
> comment [1]. Or do I miss something?
>
Thanks for pointing out.
i missed this since comment in Device tree. Will fix in next revision.
Best Regards,
Rafi.
> Shawn
>
> [1] https://lore.kernel.org/all/d2d2feff-4823-43dc-9014-099e69195280@oss.qualcomm.com/
^ permalink raw reply [flat|nested] 9+ messages in thread