Skip to content

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

Closed
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1099402
Closed

[PW_SID:1099402] ASoC: add shared BCLK rate constraint for cross-DAI coordination#1998
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1099402

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1099402 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=1099402
Version: 4

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>
Define a guard class wrapping snd_soc_card_mutex_lock() and
snd_soc_card_mutex_unlock() so that scope-based locking can be used
while still picking up the SND_SOC_CARD_CLASS_RUNTIME lockdep subclass.

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 rule callback scans all DAIs on the card at hw_refine time, 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: "[v4,1/3] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 114.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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: 1092.79 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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: 1457.56 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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: 19.34 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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: 23.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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: "[v4,1/3] ASoC: soc-dai: add shared BCLK clock for cross-DAI rate constraints"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v4,1/3] 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.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 114.58 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1042.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1401.62 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 20.67 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.68 seconds
Result: WARNING
Output:

CHECK: Please don't use multiple blank lines
#24: FILE: sound/soc/soc-pcm.c:29:
 
+

total: 0 errors, 0 warnings, 1 checks, 9 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 07553e7eae51 ("ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 9 lines checked
CHECK: Please don't use multiple blank lines


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 77.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v4,2/3] ASoC: soc-pcm: add DEFINE_GUARD for snd_soc_card_mutex"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v4,3/3] 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: 1042.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v4,3/3] 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: 1411.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v4,3/3] 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: 19.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v4,3/3] 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: 20.82 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v4,3/3] 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 3: "[v4,3/3] ASoC: soc-pcm: constrain hw_params when DAIs share the same BCLK"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v4,3/3] 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.27 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1099402 branch May 22, 2026 19:31
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