* [PATCH 1/6] ASoC: dt-bindings: es8316: Document everest,jack-detect-inverted property
2026-03-05 5:47 [PATCH 0/6] Subject: [PATCH 0/6] Add audio support for QCS6490 Thundercomm RubikPi3 Hongyang Zhao
@ 2026-03-05 5:47 ` Hongyang Zhao
2026-03-06 8:10 ` Krzysztof Kozlowski
2026-03-05 5:47 ` [PATCH 2/6] ASoC: es8316: Get sysclk rate from MCLK clock when not explicitly set Hongyang Zhao
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 5:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu, Hongyang Zhao
The es8316 codec driver already supports the everest,jack-detect-inverted
property to invert the jack detection logic, but it was not documented in
the devicetree binding. Add the missing property documentation.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
Documentation/devicetree/bindings/sound/everest,es8316.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/everest,es8316.yaml b/Documentation/devicetree/bindings/sound/everest,es8316.yaml
index fe5d938ca310..a0a4c1c99cf3 100644
--- a/Documentation/devicetree/bindings/sound/everest,es8316.yaml
+++ b/Documentation/devicetree/bindings/sound/everest,es8316.yaml
@@ -60,6 +60,11 @@ properties:
"#sound-dai-cells":
const: 0
+ everest,jack-detect-inverted:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ Defined to invert the jack detection.
+
required:
- compatible
- reg
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 1/6] ASoC: dt-bindings: es8316: Document everest,jack-detect-inverted property
2026-03-05 5:47 ` [PATCH 1/6] ASoC: dt-bindings: es8316: Document everest,jack-detect-inverted property Hongyang Zhao
@ 2026-03-06 8:10 ` Krzysztof Kozlowski
0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-06 8:10 UTC (permalink / raw)
To: Hongyang Zhao
Cc: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio, linux-sound, devicetree,
linux-kernel, linux-arm-msm, Roger Shimizu
On Thu, Mar 05, 2026 at 01:47:42PM +0800, Hongyang Zhao wrote:
> The es8316 codec driver already supports the everest,jack-detect-inverted
... since commit foobar ...
> property to invert the jack detection logic, but it was not documented in
> the devicetree binding. Add the missing property documentation.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/6] ASoC: es8316: Get sysclk rate from MCLK clock when not explicitly set
2026-03-05 5:47 [PATCH 0/6] Subject: [PATCH 0/6] Add audio support for QCS6490 Thundercomm RubikPi3 Hongyang Zhao
2026-03-05 5:47 ` [PATCH 1/6] ASoC: dt-bindings: es8316: Document everest,jack-detect-inverted property Hongyang Zhao
@ 2026-03-05 5:47 ` Hongyang Zhao
2026-03-13 15:28 ` Mark Brown
2026-03-05 5:47 ` [PATCH 3/6] ASoC: qdsp6: q6prm: Add MCLK and internal digital codec core clock IDs Hongyang Zhao
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 5:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu, Hongyang Zhao
When the sysclk has not been set via set_sysclk(), try to get the clock
rate from the MCLK clock provider. This is useful when the codec's MCLK
is managed by an external clock controller and the machine driver does
not explicitly call set_sysclk().
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
sound/soc/codecs/es8316.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index 9245c33700de..fdde7e4f7365 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -477,9 +477,20 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
u8 bclk_divider;
u16 lrck_divider;
int i;
- unsigned int clk = es8316->sysclk / 2;
+ unsigned int clk;
bool clk_valid = false;
+ if (es8316->sysclk == 0 && es8316->mclk) {
+ /* If the sysclk has not been set, try to get it from the MCLK */
+ es8316->sysclk = clk_get_rate(es8316->mclk);
+ if (es8316->sysclk == 0) {
+ dev_err(component->dev, "unable to get mclk rate\n");
+ return -EINVAL;
+ }
+ }
+
+ clk = es8316->sysclk / 2;
+
/* We will start with halved sysclk and see if we can use it
* for proper clocking. This is to minimise the risk of running
* the CODEC with a too high frequency. We have an SKU where
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 2/6] ASoC: es8316: Get sysclk rate from MCLK clock when not explicitly set
2026-03-05 5:47 ` [PATCH 2/6] ASoC: es8316: Get sysclk rate from MCLK clock when not explicitly set Hongyang Zhao
@ 2026-03-13 15:28 ` Mark Brown
2026-03-15 5:07 ` Hongyang Zhao
0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2026-03-13 15:28 UTC (permalink / raw)
To: Hongyang Zhao
Cc: Liam Girdwood, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Daniel Drake, Katsuhiro Suzuki, Matteo Martelli, Binbin Zhou,
Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio, linux-sound, devicetree,
linux-kernel, linux-arm-msm, Roger Shimizu
[-- Attachment #1: Type: text/plain, Size: 800 bytes --]
On Thu, Mar 05, 2026 at 01:47:43PM +0800, Hongyang Zhao wrote:
> @@ -477,9 +477,20 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
> u8 bclk_divider;
> u16 lrck_divider;
> int i;
> - unsigned int clk = es8316->sysclk / 2;
> + unsigned int clk;
> bool clk_valid = false;
>
> + if (es8316->sysclk == 0 && es8316->mclk) {
> + /* If the sysclk has not been set, try to get it from the MCLK */
> + es8316->sysclk = clk_get_rate(es8316->mclk);
> + if (es8316->sysclk == 0) {
> + dev_err(component->dev, "unable to get mclk rate\n");
> + return -EINVAL;
> + }
It would be better to do this by bootstrapping es8316->sysclk when we
get the clock, we do a clk_set_rate() when we set the sysclk so the two
should be in sync for robust operation.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 2/6] ASoC: es8316: Get sysclk rate from MCLK clock when not explicitly set
2026-03-13 15:28 ` Mark Brown
@ 2026-03-15 5:07 ` Hongyang Zhao
0 siblings, 0 replies; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-15 5:07 UTC (permalink / raw)
To: broonie
Cc: andersson, conor+dt, devicetree, drake, hongyang.zhao, katsuhiro,
konradybcio, krzk+dt, lgirdwood, linux-arm-msm, linux-kernel,
linux-sound, matteomartelli3, perex, robh, rosh, srini, tiwai,
zhoubinbin
Thanks for the review!
> On Thu, Mar 05, 2026 at 01:47:43PM +0800, Hongyang Zhao wrote:
>
> > @@ -477,9 +477,20 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream,
> > u8 bclk_divider;
> > u16 lrck_divider;
> > int i;
> > - unsigned int clk = es8316->sysclk / 2;
> > + unsigned int clk;
> > bool clk_valid = false;
> >
> > + if (es8316->sysclk == 0 && es8316->mclk) {
> > + /* If the sysclk has not been set, try to get it from the MCLK */
> > + es8316->sysclk = clk_get_rate(es8316->mclk);
> > + if (es8316->sysclk == 0) {
> > + dev_err(component->dev, "unable to get mclk rate\n");
> > + return -EINVAL;
> > + }
>
> It would be better to do this by bootstrapping es8316->sysclk when we
> get the clock, we do a clk_set_rate() when we set the sysclk so the two
> should be in sync for robust operation.
I'll move the clk_get_rate() call to es8316_probe(), right after
clk_prepare_enable() succeeds, and drop the fallback logic from hw_params().
Will send a v2.
@@ -774,6 +774,9 @@ static int es8316_probe(struct snd_soc_component *component)
return ret;
}
+ if (es8316->mclk)
+ es8316->sysclk = clk_get_rate(es8316->mclk);
+
/* Reset codec and enable current state machine */
snd_soc_component_write(component, ES8316_RESET, 0x3f);
usleep_range(5000, 5500);
Thanks,
Hongyang
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/6] ASoC: qdsp6: q6prm: Add MCLK and internal digital codec core clock IDs
2026-03-05 5:47 [PATCH 0/6] Subject: [PATCH 0/6] Add audio support for QCS6490 Thundercomm RubikPi3 Hongyang Zhao
2026-03-05 5:47 ` [PATCH 1/6] ASoC: dt-bindings: es8316: Document everest,jack-detect-inverted property Hongyang Zhao
2026-03-05 5:47 ` [PATCH 2/6] ASoC: es8316: Get sysclk rate from MCLK clock when not explicitly set Hongyang Zhao
@ 2026-03-05 5:47 ` Hongyang Zhao
2026-03-09 7:41 ` Srinivas Kandagatla
2026-03-05 5:47 ` [PATCH 4/6] ASoC: qcom: common: Add MI2S port IDs to jack setup Hongyang Zhao
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 5:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu, Hongyang Zhao
Add clock IDs for MCLK_1 through MCLK_4 and internal digital codec core
clock to the PRM clock driver. These clocks are needed to provide MCLK
to external codecs connected via MI2S.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
sound/soc/qcom/qdsp6/q6prm-clocks.c | 5 +++++
sound/soc/qcom/qdsp6/q6prm.h | 11 +++++++++++
2 files changed, 16 insertions(+)
diff --git a/sound/soc/qcom/qdsp6/q6prm-clocks.c b/sound/soc/qcom/qdsp6/q6prm-clocks.c
index 4c574b48ab00..8c28d33b2a54 100644
--- a/sound/soc/qcom/qdsp6/q6prm-clocks.c
+++ b/sound/soc/qcom/qdsp6/q6prm-clocks.c
@@ -59,6 +59,11 @@ static const struct q6dsp_clk_init q6prm_clks[] = {
Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_MCLK),
Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_2X_MCLK),
Q6PRM_CLK(LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK),
+ Q6PRM_CLK(LPASS_CLK_ID_MCLK_1),
+ Q6PRM_CLK(LPASS_CLK_ID_MCLK_2),
+ Q6PRM_CLK(LPASS_CLK_ID_MCLK_3),
+ Q6PRM_CLK(LPASS_CLK_ID_MCLK_4),
+ Q6PRM_CLK(LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE),
Q6DSP_VOTE_CLK(LPASS_HW_MACRO_VOTE, Q6PRM_HW_CORE_ID_LPASS,
"LPASS_HW_MACRO"),
Q6DSP_VOTE_CLK(LPASS_HW_DCODEC_VOTE, Q6PRM_HW_CORE_ID_DCODEC,
diff --git a/sound/soc/qcom/qdsp6/q6prm.h b/sound/soc/qcom/qdsp6/q6prm.h
index a988a32086fe..85e6df6bd39f 100644
--- a/sound/soc/qcom/qdsp6/q6prm.h
+++ b/sound/soc/qcom/qdsp6/q6prm.h
@@ -52,6 +52,17 @@
/* Clock ID for QUINARY MI2S OSR CLK */
#define Q6PRM_LPASS_CLK_ID_QUI_MI2S_OSR 0x116
+/* Clock ID for MCLK1 */
+#define Q6PRM_LPASS_CLK_ID_MCLK_1 0x300
+/* Clock ID for MCLK2 */
+#define Q6PRM_LPASS_CLK_ID_MCLK_2 0x301
+/* Clock ID for MCLK3 */
+#define Q6PRM_LPASS_CLK_ID_MCLK_3 0x302
+/* Clock ID for MCLK4 */
+#define Q6PRM_LPASS_CLK_ID_MCLK_4 0x304
+/* Clock ID for Internal Digital Codec Core */
+#define Q6PRM_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE 0x303
+
#define Q6PRM_LPASS_CLK_ID_WSA_CORE_MCLK 0x305
#define Q6PRM_LPASS_CLK_ID_WSA_CORE_NPL_MCLK 0x306
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 3/6] ASoC: qdsp6: q6prm: Add MCLK and internal digital codec core clock IDs
2026-03-05 5:47 ` [PATCH 3/6] ASoC: qdsp6: q6prm: Add MCLK and internal digital codec core clock IDs Hongyang Zhao
@ 2026-03-09 7:41 ` Srinivas Kandagatla
0 siblings, 0 replies; 15+ messages in thread
From: Srinivas Kandagatla @ 2026-03-09 7:41 UTC (permalink / raw)
To: Hongyang Zhao, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Daniel Drake, Katsuhiro Suzuki,
Matteo Martelli, Binbin Zhou, Jaroslav Kysela, Takashi Iwai,
Srinivas Kandagatla, Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu
On 3/5/26 5:47 AM, Hongyang Zhao wrote:
> Add clock IDs for MCLK_1 through MCLK_4 and internal digital codec core
> clock to the PRM clock driver. These clocks are needed to provide MCLK
> to external codecs connected via MI2S.
This patch has already been submitted previously by Neil, Please pick
the patch from https://lkml.org/lkml/2025/10/6/828
--srini
>
> Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
> ---
> sound/soc/qcom/qdsp6/q6prm-clocks.c | 5 +++++
> sound/soc/qcom/qdsp6/q6prm.h | 11 +++++++++++
> 2 files changed, 16 insertions(+)
>
> diff --git a/sound/soc/qcom/qdsp6/q6prm-clocks.c b/sound/soc/qcom/qdsp6/q6prm-clocks.c
> index 4c574b48ab00..8c28d33b2a54 100644
> --- a/sound/soc/qcom/qdsp6/q6prm-clocks.c
> +++ b/sound/soc/qcom/qdsp6/q6prm-clocks.c
> @@ -59,6 +59,11 @@ static const struct q6dsp_clk_init q6prm_clks[] = {
> Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_MCLK),
> Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_2X_MCLK),
> Q6PRM_CLK(LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK),
> + Q6PRM_CLK(LPASS_CLK_ID_MCLK_1),
> + Q6PRM_CLK(LPASS_CLK_ID_MCLK_2),
> + Q6PRM_CLK(LPASS_CLK_ID_MCLK_3),
> + Q6PRM_CLK(LPASS_CLK_ID_MCLK_4),
> + Q6PRM_CLK(LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE),
> Q6DSP_VOTE_CLK(LPASS_HW_MACRO_VOTE, Q6PRM_HW_CORE_ID_LPASS,
> "LPASS_HW_MACRO"),
> Q6DSP_VOTE_CLK(LPASS_HW_DCODEC_VOTE, Q6PRM_HW_CORE_ID_DCODEC,
> diff --git a/sound/soc/qcom/qdsp6/q6prm.h b/sound/soc/qcom/qdsp6/q6prm.h
> index a988a32086fe..85e6df6bd39f 100644
> --- a/sound/soc/qcom/qdsp6/q6prm.h
> +++ b/sound/soc/qcom/qdsp6/q6prm.h
> @@ -52,6 +52,17 @@
> /* Clock ID for QUINARY MI2S OSR CLK */
> #define Q6PRM_LPASS_CLK_ID_QUI_MI2S_OSR 0x116
>
> +/* Clock ID for MCLK1 */
> +#define Q6PRM_LPASS_CLK_ID_MCLK_1 0x300
> +/* Clock ID for MCLK2 */
> +#define Q6PRM_LPASS_CLK_ID_MCLK_2 0x301
> +/* Clock ID for MCLK3 */
> +#define Q6PRM_LPASS_CLK_ID_MCLK_3 0x302
> +/* Clock ID for MCLK4 */
> +#define Q6PRM_LPASS_CLK_ID_MCLK_4 0x304
> +/* Clock ID for Internal Digital Codec Core */
> +#define Q6PRM_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE 0x303
> +
> #define Q6PRM_LPASS_CLK_ID_WSA_CORE_MCLK 0x305
> #define Q6PRM_LPASS_CLK_ID_WSA_CORE_NPL_MCLK 0x306
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/6] ASoC: qcom: common: Add MI2S port IDs to jack setup
2026-03-05 5:47 [PATCH 0/6] Subject: [PATCH 0/6] Add audio support for QCS6490 Thundercomm RubikPi3 Hongyang Zhao
` (2 preceding siblings ...)
2026-03-05 5:47 ` [PATCH 3/6] ASoC: qdsp6: q6prm: Add MCLK and internal digital codec core clock IDs Hongyang Zhao
@ 2026-03-05 5:47 ` Hongyang Zhao
2026-03-05 5:47 ` [PATCH 5/6] ASoC: qcom: sc8280xp: Set codec DAI format for MI2S links Hongyang Zhao
2026-03-05 5:47 ` [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support Hongyang Zhao
5 siblings, 0 replies; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 5:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu, Hongyang Zhao
Add PRIMARY_MI2S_RX through QUATERNARY_MI2S_TX and QUINARY MI2S port IDs
to the qcom_snd_wcd_jack_setup() switch case, so that codecs connected
via MI2S can use jack detection.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
sound/soc/qcom/common.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 7ee60a58a336..657378474254 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -230,6 +230,8 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
case TX_CODEC_DMA_TX_1:
case TX_CODEC_DMA_TX_2:
case TX_CODEC_DMA_TX_3:
+ case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX:
+ case QUINARY_MI2S_RX ... QUINARY_MI2S_TX:
for_each_rtd_codec_dais(rtd, i, codec_dai) {
rval = snd_soc_component_set_jack(codec_dai->component,
jack, NULL);
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 5/6] ASoC: qcom: sc8280xp: Set codec DAI format for MI2S links
2026-03-05 5:47 [PATCH 0/6] Subject: [PATCH 0/6] Add audio support for QCS6490 Thundercomm RubikPi3 Hongyang Zhao
` (3 preceding siblings ...)
2026-03-05 5:47 ` [PATCH 4/6] ASoC: qcom: common: Add MI2S port IDs to jack setup Hongyang Zhao
@ 2026-03-05 5:47 ` Hongyang Zhao
2026-03-05 5:47 ` [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support Hongyang Zhao
5 siblings, 0 replies; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 5:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu, Hongyang Zhao
Set the codec DAI format to I2S consumer mode (BC_FC) with normal bit
and frame clocks (NB_NF) for MI2S backend links. This is required for
external codecs connected via MI2S to work properly.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
sound/soc/qcom/sc8280xp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index 7925aa3f63ba..04e15c85a145 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -27,6 +27,7 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
{
struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+ struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
struct snd_soc_card *card = rtd->card;
struct snd_soc_jack *dp_jack = NULL;
int dp_pcm_id = 0;
@@ -35,6 +36,9 @@ static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
case PRIMARY_MI2S_RX...QUATERNARY_MI2S_TX:
case QUINARY_MI2S_RX...QUINARY_MI2S_TX:
snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
+ snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_BC_FC |
+ SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_I2S);
break;
case WSA_CODEC_DMA_RX_0:
case WSA_CODEC_DMA_RX_1:
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support
2026-03-05 5:47 [PATCH 0/6] Subject: [PATCH 0/6] Add audio support for QCS6490 Thundercomm RubikPi3 Hongyang Zhao
` (4 preceding siblings ...)
2026-03-05 5:47 ` [PATCH 5/6] ASoC: qcom: sc8280xp: Set codec DAI format for MI2S links Hongyang Zhao
@ 2026-03-05 5:47 ` Hongyang Zhao
2026-03-05 10:01 ` Konrad Dybcio
2026-03-05 12:15 ` Krzysztof Kozlowski
5 siblings, 2 replies; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 5:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Daniel Drake, Katsuhiro Suzuki, Matteo Martelli,
Binbin Zhou, Jaroslav Kysela, Takashi Iwai, Srinivas Kandagatla,
Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu, Hongyang Zhao
Add audio support for the Thundercomm RubikPi3 board:
- Enable AudioReach via qcs6490-audioreach.dtsi
- Add ES8316 codec on I2C0 with MCLK from LPASS PRM and jack detection
- Add fixed 3.3V regulator for ES8316 power supply
- Add MI2S playback/capture dai-links for ES8316
- Add HDMI audio via LT9611 bridge on quaternary MI2S
- Add SPDIF TX/RX on tertiary MI2S exposed at the board 40‑pin header
- Add LPASS pin configurations for quaternary MI2S and LPI I2S1
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
---
.../boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 191 +++++++++++++++++++++
1 file changed, 191 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
index 0b64a0b91202..0d2b019886b2 100644
--- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
+++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts
@@ -19,6 +19,7 @@
#include "pm7325.dtsi"
#include "pm8350c.dtsi" /* PM7350C */
#include "pmk8350.dtsi" /* PMK7325 */
+#include "qcs6490-audioreach.dtsi"
/delete-node/ &adsp_mem;
/delete-node/ &cdsp_mem;
@@ -128,6 +129,23 @@ fan0: pwm-fan {
pinctrl-names = "default";
};
+ vreg_es8316_3v3: vreg-es8316-3v3 {
+ compatible = "regulator-fixed";
+
+ regulator-name = "vreg_es8316_3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ gpio = <&tlmm 117 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&es8316_power_on>;
+ pinctrl-names = "default";
+
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
vreg_eth_1v8: regulator-eth-1v8 {
compatible = "regulator-fixed";
@@ -364,6 +382,16 @@ usb1_sbu_mux: endpoint {
};
};
};
+
+ spdif_tx: spdif-tx {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+
+ spdif_rx: spdif-rx {
+ compatible = "linux,spdif-dir";
+ #sound-dai-cells = <0>;
+ };
};
&apps_rsc {
@@ -727,6 +755,23 @@ &gpu_zap_shader {
firmware-name = "qcom/qcs6490/a660_zap.mbn";
};
+&i2c0 {
+ status = "okay";
+
+ es8316: es8316@11 {
+ compatible = "everest,es8316";
+ reg = <0x11>;
+ #sound-dai-cells = <0>;
+
+ clocks = <&q6prmcc LPASS_CLK_ID_MCLK_1 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+ clock-names = "mclk";
+
+ interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_BOTH>;
+
+ everest,jack-detect-inverted;
+ };
+};
+
/* Pin 3, 5 in 40-pin connector */
&i2c1 {
status = "okay";
@@ -740,6 +785,7 @@ &i2c9 {
lt9611_codec: hdmi-bridge@39 {
compatible = "lontium,lt9611";
reg = <0x39>;
+ #sound-dai-cells = <1>;
interrupts-extended = <&tlmm 20 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
@@ -970,6 +1016,16 @@ &pon_resin {
status = "okay";
};
+&q6apmbedai {
+ pinctrl-0 = <&mi2s0_data0>, <&mi2s0_data1>, <&mi2s0_mclk>,
+ <&mi2s0_sclk>, <&mi2s0_ws>,
+ <&lpass_qua_mi2s_sclk>, <&lpass_qua_mi2s_ws>, <&lpass_qua_mi2s_data0>,
+ <&lpass_qua_mi2s_data1>, <&lpass_qua_mi2s_data2>,
+ <&lpass_lpi_i2s1_clk>, <&lpass_lpi_i2s1_ws>,
+ <&lpass_lpi_i2s1_data0>, <&lpass_lpi_i2s1_data1>;
+ pinctrl-names = "default";
+};
+
&qupv3_id_0 {
firmware-name = "qcom/qcm6490/qupv3fw.elf";
@@ -1006,6 +1062,76 @@ &sdhc_2 {
status = "okay";
};
+&sound {
+ compatible = "qcom,qcs6490-rb3gen2-sndcard";
+ model = "QCS6490-Thundercomm-RubikPi3";
+
+ mi2s-playback-dai-link {
+ link-name = "MI2S-LPAIF-RX-PRIMARY";
+ cpu {
+ sound-dai = <&q6apmbedai PRIMARY_MI2S_RX>;
+ };
+ codec {
+ sound-dai = <&es8316>;
+ };
+ platform {
+ sound-dai = <&q6apm>;
+ };
+ };
+
+ mi2s-capture-dai-link {
+ link-name = "MI2S-LPAIF-TX-PRIMARY";
+ cpu {
+ sound-dai = <&q6apmbedai PRIMARY_MI2S_TX>;
+ };
+ codec {
+ sound-dai = <&es8316>;
+ };
+ platform {
+ sound-dai = <&q6apm>;
+ };
+ };
+
+ quaternary-mi2s-playback-dai-link {
+ link-name = "MI2S-LPAIF_RXTX-RX-PRIMARY";
+ cpu {
+ sound-dai = <&q6apmbedai QUATERNARY_MI2S_RX>;
+ };
+ codec {
+ sound-dai = <<9611_codec 0>;
+ };
+ platform {
+ sound-dai = <&q6apm>;
+ };
+ };
+
+ tert-mi2s-playback-dai-link {
+ link-name = "MI2S-LPAIF-RX-TERTIARY";
+ cpu {
+ sound-dai = <&q6apmbedai TERTIARY_MI2S_RX>;
+ };
+ codec {
+ sound-dai = <&spdif_tx>;
+ };
+ platform {
+ sound-dai = <&q6apm>;
+ };
+ };
+
+ tert-mi2s-capture-dai-link {
+ link-name = "MI2S-LPAIF-TX-TERTIARY";
+ cpu {
+ sound-dai = <&q6apmbedai TERTIARY_MI2S_TX>;
+ };
+ codec {
+ sound-dai = <&spdif_rx>;
+ };
+ platform {
+ sound-dai = <&q6apm>;
+ };
+ };
+};
+
/* Pin 19, 21, 23, 24 in 40-pin connector */
&spi12 {
status = "okay";
@@ -1220,6 +1346,64 @@ &sdc2_data {
drive-strength = <10>;
};
+&lpass_tlmm {
+ lpass_qua_mi2s_sclk: qua-mi2s-sclk-state {
+ pins = "gpio0";
+ function = "qua_mi2s_sclk";
+ drive-strength = <8>;
+ bias-disable;
+ output-high;
+ };
+
+ lpass_qua_mi2s_ws: qua-mi2s-ws-state {
+ pins = "gpio1";
+ function = "qua_mi2s_ws";
+ drive-strength = <8>;
+ output-high;
+ };
+
+ lpass_qua_mi2s_data0: qua-mi2s-data0-state {
+ pins = "gpio2";
+ function = "qua_mi2s_data";
+ drive-strength = <8>;
+ bias-disable;
+ };
+
+ lpass_qua_mi2s_data1: qua-mi2s-data1-state {
+ pins = "gpio3";
+ function = "qua_mi2s_data";
+ drive-strength = <8>;
+ bias-disable;
+ };
+
+ lpass_qua_mi2s_data2: qua-mi2s-data2-state {
+ pins = "gpio4";
+ function = "qua_mi2s_data";
+ drive-strength = <8>;
+ bias-disable;
+ };
+
+ lpass_lpi_i2s1_clk: lpi-i2s1-clk-state {
+ pins = "gpio6";
+ function = "i2s1_clk";
+ };
+
+ lpass_lpi_i2s1_ws: lpi-i2s1-ws-state {
+ pins = "gpio7";
+ function = "i2s1_ws";
+ };
+
+ lpass_lpi_i2s1_data0: lpi-i2s1-data0-state {
+ pins = "gpio8";
+ function = "i2s1_data";
+ };
+
+ lpass_lpi_i2s1_data1: lpi-i2s1-data1-state {
+ pins = "gpio9";
+ function = "i2s1_data";
+ };
+};
+
&tlmm {
pcie1_reset_n: pcie1-reset-n-state {
pins = "gpio2";
@@ -1387,6 +1571,13 @@ pcie0_wake_n: pcie0-wake-n-state {
bias-pull-up;
};
+ es8316_power_on: es8316-power-on-state {
+ pins = "gpio117";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+
wifi_power_on: wifi-power-on-state {
pins = "gpio125";
function = "gpio";
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support
2026-03-05 5:47 ` [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support Hongyang Zhao
@ 2026-03-05 10:01 ` Konrad Dybcio
2026-03-05 10:51 ` Hongyang Zhao
2026-03-05 12:15 ` Krzysztof Kozlowski
1 sibling, 1 reply; 15+ messages in thread
From: Konrad Dybcio @ 2026-03-05 10:01 UTC (permalink / raw)
To: Hongyang Zhao, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Daniel Drake, Katsuhiro Suzuki,
Matteo Martelli, Binbin Zhou, Jaroslav Kysela, Takashi Iwai,
Srinivas Kandagatla, Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu
On 3/5/26 6:47 AM, Hongyang Zhao wrote:
> Add audio support for the Thundercomm RubikPi3 board:
> - Enable AudioReach via qcs6490-audioreach.dtsi
> - Add ES8316 codec on I2C0 with MCLK from LPASS PRM and jack detection
> - Add fixed 3.3V regulator for ES8316 power supply
> - Add MI2S playback/capture dai-links for ES8316
> - Add HDMI audio via LT9611 bridge on quaternary MI2S
> - Add SPDIF TX/RX on tertiary MI2S exposed at the board 40‑pin header
> - Add LPASS pin configurations for quaternary MI2S and LPI I2S1
>
> Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
> ---
[...]
> + spdif_tx: spdif-tx {
> + compatible = "linux,spdif-dit";
> + #sound-dai-cells = <0>;
> + };
> +
> + spdif_rx: spdif-rx {
'r' < 't', please swap them
[...]
> + mi2s-playback-dai-link {
> + link-name = "MI2S-LPAIF-RX-PRIMARY";
> + cpu {
> + sound-dai = <&q6apmbedai PRIMARY_MI2S_RX>;
> + };
> + codec {
> + sound-dai = <&es8316>;
> + };
'co'dec < 'cp'u, please reshuffle
and leave a \n between the property (link-name) and the following subnode
as well as between the individual subnodes (but not after the last one)
[...]
> +&lpass_tlmm {
> + lpass_qua_mi2s_sclk: qua-mi2s-sclk-state {
> + pins = "gpio0";
> + function = "qua_mi2s_sclk";
> + drive-strength = <8>;
> + bias-disable;
> + output-high;
> + };
> +
> + lpass_qua_mi2s_ws: qua-mi2s-ws-state {
> + pins = "gpio1";
> + function = "qua_mi2s_ws";
> + drive-strength = <8>;
> + output-high;
> + };
> +
> + lpass_qua_mi2s_data0: qua-mi2s-data0-state {
> + pins = "gpio2";
> + function = "qua_mi2s_data";
> + drive-strength = <8>;
> + bias-disable;
> + };
> +
> + lpass_qua_mi2s_data1: qua-mi2s-data1-state {
> + pins = "gpio3";
> + function = "qua_mi2s_data";
> + drive-strength = <8>;
> + bias-disable;
> + };
Because they have identical properties, you can squash GPIOs 2-4 into
'lpass_qua_mi2s_data' with:
gpios = "gpio2", "gpio3", "gpio4";
Konrad
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support
2026-03-05 10:01 ` Konrad Dybcio
@ 2026-03-05 10:51 ` Hongyang Zhao
0 siblings, 0 replies; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-05 10:51 UTC (permalink / raw)
To: konrad.dybcio
Cc: andersson, broonie, conor+dt, devicetree, drake, hongyang.zhao,
katsuhiro, konradybcio, krzk+dt, lgirdwood, linux-arm-msm,
linux-kernel, linux-sound, matteomartelli3, perex, robh, rosh,
srini, tiwai, zhoubinbin
Hi Konrad,
Thank you for your review.
> On 3/5/26 6:47 AM, Hongyang Zhao wrote:
> > Add audio support for the Thundercomm RubikPi3 board:
> > - Enable AudioReach via qcs6490-audioreach.dtsi
> > - Add ES8316 codec on I2C0 with MCLK from LPASS PRM and jack detection
> > - Add fixed 3.3V regulator for ES8316 power supply
> > - Add MI2S playback/capture dai-links for ES8316
> > - Add HDMI audio via LT9611 bridge on quaternary MI2S
> > - Add SPDIF TX/RX on tertiary MI2S exposed at the board 40‑pin header
> > - Add LPASS pin configurations for quaternary MI2S and LPI I2S1
> >
> > Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
> > ---
>
> [...]
>
> > + spdif_tx: spdif-tx {
> > + compatible = "linux,spdif-dit";
> > + #sound-dai-cells = <0>;
> > + };
> > +
> > + spdif_rx: spdif-rx {
>
> 'r' < 't', please swap them
I will swap them:
spdif_rx: spdif-rx { ... };
spdif_tx: spdif-tx { ... };
>
> [...]
>
> > + mi2s-playback-dai-link {
> > + link-name = "MI2S-LPAIF-RX-PRIMARY";
> > + cpu {
> > + sound-dai = <&q6apmbedai PRIMARY_MI2S_RX>;
> > + };
> > + codec {
> > + sound-dai = <&es8316>;
> > + };
>
> 'co'dec < 'cp'u, please reshuffle
>
> and leave a \n between the property (link-name) and the following subnode
> as well as between the individual subnodes (but not after the last one)
I will change this series to:
mi2s-playback-dai-link {
link-name = "MI2S-LPAIF-RX-PRIMARY";
codec {
sound-dai = <&es8316>;
};
cpu {
sound-dai = <&q6apmbedai PRIMARY_MI2S_RX>;
};
platform {
sound-dai = <&q6apm>;
};
};
>
> [...]
>
> > +&lpass_tlmm {
> > + lpass_qua_mi2s_sclk: qua-mi2s-sclk-state {
> > + pins = "gpio0";
> > + function = "qua_mi2s_sclk";
> > + drive-strength = <8>;
> > + bias-disable;
> > + output-high;
> > + };
> > +
> > + lpass_qua_mi2s_ws: qua-mi2s-ws-state {
> > + pins = "gpio1";
> > + function = "qua_mi2s_ws";
> > + drive-strength = <8>;
> > + output-high;
> > + };
> > +
> > + lpass_qua_mi2s_data0: qua-mi2s-data0-state {
> > + pins = "gpio2";
> > + function = "qua_mi2s_data";
> > + drive-strength = <8>;
> > + bias-disable;
> > + };
> > +
> > + lpass_qua_mi2s_data1: qua-mi2s-data1-state {
> > + pins = "gpio3";
> > + function = "qua_mi2s_data";
> > + drive-strength = <8>;
> > + bias-disable;
> > + };
>
> Because they have identical properties, you can squash GPIOs 2-4 into
> 'lpass_qua_mi2s_data' with:
>
> gpios = "gpio2", "gpio3", "gpio4";
>
> Konrad
I will revise it to:
lpass_qua_mi2s_data: qua-mi2s-data-state {
pins = "gpio2", "gpio3", "gpio4";
function = "qua_mi2s_data";
drive-strength = <8>;
bias-disable;
};
Thanks,
Hongyang
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support
2026-03-05 5:47 ` [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support Hongyang Zhao
2026-03-05 10:01 ` Konrad Dybcio
@ 2026-03-05 12:15 ` Krzysztof Kozlowski
2026-03-06 4:49 ` Hongyang Zhao
1 sibling, 1 reply; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-05 12:15 UTC (permalink / raw)
To: Hongyang Zhao, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Daniel Drake, Katsuhiro Suzuki,
Matteo Martelli, Binbin Zhou, Jaroslav Kysela, Takashi Iwai,
Srinivas Kandagatla, Bjorn Andersson, Konrad Dybcio
Cc: linux-sound, devicetree, linux-kernel, linux-arm-msm,
Roger Shimizu
On 05/03/2026 06:47, Hongyang Zhao wrote:
>
> &apps_rsc {
> @@ -727,6 +755,23 @@ &gpu_zap_shader {
> firmware-name = "qcom/qcs6490/a660_zap.mbn";
> };
>
> +&i2c0 {
> + status = "okay";
> +
> + es8316: es8316@11 {
Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel
sources for similar cases or you can grow the spec (via pull request to
DT spec repo).
> + compatible = "everest,es8316";
> + reg = <0x11>;
> + #sound-dai-cells = <0>;
> +
> + clocks = <&q6prmcc LPASS_CLK_ID_MCLK_1 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
> + clock-names = "mclk";
> +
> + interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_BOTH>;
> +
> + everest,jack-detect-inverted;
> + };
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 6/6] arm64: dts: qcom: qcs6490-rubikpi3: Add audio support
2026-03-05 12:15 ` Krzysztof Kozlowski
@ 2026-03-06 4:49 ` Hongyang Zhao
0 siblings, 0 replies; 15+ messages in thread
From: Hongyang Zhao @ 2026-03-06 4:49 UTC (permalink / raw)
To: krzk
Cc: andersson, broonie, conor+dt, devicetree, drake, hongyang.zhao,
katsuhiro, konradybcio, krzk+dt, lgirdwood, linux-arm-msm,
linux-kernel, linux-sound, matteomartelli3, perex, robh, rosh,
srini, tiwai, zhoubinbin
Hi Krzysztof,
Thank you for your review.
> On 05/03/2026 06:47, Hongyang Zhao wrote:
> >
> > &apps_rsc {
> > @@ -727,6 +755,23 @@ &gpu_zap_shader {
> > firmware-name = "qcom/qcs6490/a660_zap.mbn";
> > };
> >
> > +&i2c0 {
> > + status = "okay";
> > +
> > + es8316: es8316@11 {
>
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> If you cannot find a name matching your device, please check in kernel
> sources for similar cases or you can grow the spec (via pull request to
> DT spec repo).
I will change the node name to es8316: audio-codec@11 { ... };
>
> > + compatible = "everest,es8316";
> > + reg = <0x11>;
> > + #sound-dai-cells = <0>;
> > +
> > + clocks = <&q6prmcc LPASS_CLK_ID_MCLK_1 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
> > + clock-names = "mclk";
> > +
> > + interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_BOTH>;
> > +
> > + everest,jack-detect-inverted;
> > + };
Thanks,
Hongyang
^ permalink raw reply [flat|nested] 15+ messages in thread