Skip to content

[PW_SID:1096338] ASoC: add shared BCLK rate constraint for cross-DAI coordination#1960

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1096338
Closed

[PW_SID:1096338] ASoC: add shared BCLK rate constraint for cross-DAI coordination#1960
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1096338

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1096338 applied to workflow__riscv__fixes

Name: ASoC: add shared BCLK rate constraint for cross-DAI coordination
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1096338
Version: 3

Add a bclk field to struct snd_soc_dai and a helper function
snd_soc_dai_set_bclk_clk() that platform drivers can use to declare
which clock is their BCLK.

Also cache the bclk_ratio in snd_soc_dai_set_bclk_ratio() so that
the framework can use it later in hw_rule evaluation for TDM
configurations where BCLK = rate * slots * slot_width.

When multiple DAIs on the same card share the same physical BCLK
(detected via clk_is_match()), the ASoC core can automatically
constrain their hw_params so that the resulting BCLK rates are
compatible. This commit adds the data structure support; the actual
constraint logic follows in the next patch.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
When multiple CPU DAIs on the same sound card share the same physical
BCLK, add a hw_rule during PCM open that constrains the sample rate so
the resulting BCLK rate stays consistent across all sharing DAIs.

The hw_rule is registered unconditionally for every DAI that has a bclk
clock pointer set. The actual peer scanning happens inside the rule
callback at hw_refine time: it walks all DAIs on the card, looking for
an active peer that shares the same physical BCLK (via clk_is_match())
and has already completed hw_params (checked via dai->symmetric_rate
!= 0). This ensures the constraint uses the real BCLK rate established
by the peer's clk_set_rate() in hw_params, not a stale boot-time
default.

The first DAI to complete hw_params is unconstrained (no active peer
yet); subsequent DAIs are constrained to match.

The rule supports two modes:
- If the DAI has an explicit bclk_ratio set (e.g. for TDM where
  BCLK = rate * slots * slot_width), the rate is constrained to
  active_bclk_rate / bclk_ratio.
- Otherwise, the default formula BCLK = rate * channels * sample_bits
  is used to derive the valid rate range.

The constraint is purely additive: DAIs that do not set a bclk clock
pointer are completely unaffected.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1098.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1480.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.44 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.54 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.02 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.61 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 139.56 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1045.37 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1432.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.04 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.17 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1096338 branch May 19, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants