Mark Brown
3bd860dcf9
ASoC: add shared BCLK rate constraint for cross-DAI coordination
...
Troy Mitchell <troy.mitchell@linux.spacemit.com > says:
On some SoCs (e.g. SpacemiT K3), multiple I2S controllers share the
same physical BCLK. When one controller is already streaming, the
others must use hw_params that result in the same BCLK rate, otherwise
the shared clock would be reconfigured and corrupt the active stream.
This series adds framework-level support for this constraint:
Patch 1 adds the dt-bindings for the spacemit,k3-i2s compatible.
The K3 SoC uses the same I2S IP as K1 but requires additional clocks:
a dedicated sysclk_div, along with c_sysclk and c_bclk which are
shared across multiple I2S controllers.
Patch 2 adds a DEFINE_GUARD wrapping snd_soc_card_mutex_lock() and
snd_soc_card_mutex_unlock() so that scope-based locking picks up the
SND_SOC_CARD_CLASS_RUNTIME lockdep subclass.
Patch 3 adds the constraint logic in soc-pcm.c. During PCM open,
every DAI that has a bclk clock pointer gets a hw_rule registered
unconditionally. The rule callback runs at hw_refine time: it scans
the card for an active peer sharing the same physical BCLK (via
clk_is_match()) that has already completed hw_params, then constrains
the current stream's rate to match the established BCLK rate. The
first DAI to complete hw_params is unconstrained; subsequent DAIs
must match. Two modes are supported:
- Default (I2S): BCLK = rate * channels * sample_bits. The rule
derives the valid rate range from the current channel and
sample_bits intervals.
- Explicit ratio (TDM): if the driver sets dai->bclk_ratio
(e.g. slots * slot_width), the rule computes the single valid
rate as active_bclk_rate / bclk_ratio.
This series was prompted by review feedback on the SpacemiT K3 I2S
series, where a vendor-specific fixed-sample-rate property was rejected
in favor of a generic framework solution:
https://lore.kernel.org/all/afFqgF6ZRwYdfUmL@sirena.co.uk/
Link: https://patch.msgid.link/20260522-i2s-same-blk-v4-0-a71a86faaa20@linux.spacemit.com
2026-05-25 11:42:45 +01:00
..
2025-08-07 10:07:06 +02:00
2025-07-07 09:43:53 +02:00
2024-12-02 11:34:44 -08:00
2023-04-11 21:08:31 +02:00
2025-10-21 11:46:50 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-05-21 14:36:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-02-18 10:56:35 +01:00
2025-09-24 13:52:35 +02:00
2025-08-07 10:07:06 +02:00
2026-01-27 11:17:26 +01:00
2026-04-20 11:10:39 +02:00
2025-09-12 09:22:44 +02:00
2026-03-11 09:43:23 +01:00
2026-02-23 10:41:41 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-04-08 09:14:42 +02:00
2025-09-12 09:19:56 +02:00
2026-02-23 10:38:33 +01:00
2025-10-23 09:56:05 +02:00
2026-03-24 13:50:31 +01:00
2026-01-12 11:41:02 +01:00
2026-02-23 10:41:42 +01:00
2025-07-07 09:43:53 +02:00
2025-12-22 17:57:35 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-03-16 10:11:02 +01:00
2025-08-07 10:07:06 +02:00
2026-02-23 10:41:42 +01:00
2026-01-12 09:34:26 +01:00
2025-08-07 10:07:06 +02:00
2025-04-17 13:58:55 +02:00
2026-03-23 10:55:58 +01:00
2025-08-07 10:07:06 +02:00
2025-11-19 14:08:51 +01:00
2025-08-07 10:07:06 +02:00
2025-07-07 09:43:53 +02:00
2025-09-12 09:19:56 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-09-12 09:19:56 +02:00
2025-11-20 14:15:30 +01:00
2025-09-24 13:52:35 +02:00
2024-12-02 11:34:44 -08:00
2025-08-07 10:07:06 +02:00
2025-10-13 17:33:50 +02:00
2025-08-07 10:07:06 +02:00
2025-09-24 13:52:35 +02:00
2025-09-24 13:52:35 +02:00
2026-03-11 09:45:22 +01:00
2024-12-02 11:34:44 -08:00
2023-01-30 15:55:28 +01:00
2025-08-07 10:07:06 +02:00
2025-10-22 08:52:32 +02:00
2023-08-11 14:23:32 +02:00
2025-09-12 09:19:56 +02:00
2025-08-07 10:07:06 +02:00
2025-12-18 11:29:42 +01:00
2025-09-24 13:52:35 +02:00
2025-08-07 10:07:06 +02:00
2026-03-16 10:05:33 +01:00
2025-10-21 10:35:30 +02:00
2026-01-09 09:58:13 +01:00
2025-10-23 14:30:11 +02:00
2025-08-07 10:07:06 +02:00
2025-09-12 09:22:44 +02:00
2026-02-05 18:00:45 +01:00
2025-08-07 10:07:06 +02:00
2026-02-23 10:41:42 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-01-20 19:44:19 -08:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-03-16 09:52:51 +01:00
2025-05-13 15:15:34 +02:00
2024-07-29 10:50:51 +02:00
2022-02-09 13:00:45 +00:00
2025-09-16 15:24:48 +01:00
2026-01-28 10:07:23 +01:00
2025-08-07 10:07:06 +02:00
2026-01-02 11:01:13 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-01-12 11:39:44 +01:00
2024-12-02 11:34:44 -08:00
2025-11-25 14:10:06 +01:00
2025-11-25 14:10:06 +01:00
2025-09-12 09:19:56 +02:00
2025-09-12 09:19:56 +02:00
2025-10-30 10:28:24 +01:00
2026-02-27 09:49:02 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-09-24 13:52:35 +02:00
2025-09-06 16:08:10 +05:30
2026-03-31 14:13:14 +01:00
2026-03-09 10:15:00 +01:00
2025-11-25 14:10:06 +01:00
2025-09-24 13:52:35 +02:00
2025-10-20 10:24:03 +02:00
2026-03-26 09:41:44 +01:00
2025-09-12 09:19:56 +02:00
2025-09-16 14:41:57 +01:00
2026-02-16 12:09:48 +01:00
2026-04-07 12:32:21 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-01-28 09:29:57 +01:00
2025-08-07 10:07:06 +02:00
2026-05-21 10:04:00 +02:00
2026-01-13 15:17:35 +01:00
2025-08-07 10:07:06 +02:00
2025-11-25 14:10:07 +01:00
2025-10-21 11:46:50 +02:00
2024-11-04 09:15:38 +01:00
2025-09-08 09:38:27 +02:00
2025-11-25 14:10:06 +01:00
2025-06-23 09:25:46 +02:00
2025-11-14 10:01:52 +01:00
2026-03-23 11:06:38 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-09-24 13:52:35 +02:00
2025-08-07 10:07:06 +02:00
2026-03-10 10:10:24 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-24 11:59:46 -07:00
2025-08-07 10:07:06 +02:00
2025-11-14 10:01:52 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-11-28 09:29:31 +01:00
2025-09-24 13:52:35 +02:00
2026-05-21 14:36:06 +02:00
2025-08-07 10:07:06 +02:00
2022-11-15 15:41:45 +01:00
2025-06-16 09:45:14 +02:00
2025-09-12 09:22:45 +02:00
2026-03-19 13:52:56 +01:00
2025-08-07 10:07:06 +02:00
2026-01-27 20:27:59 +01:00
2025-09-03 09:38:13 +02:00
2026-02-23 10:41:43 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2023-11-13 17:59:48 +02:00
2025-11-06 18:19:44 +01:00
2025-08-07 10:07:06 +02:00
2026-03-11 09:45:48 +01:00
2026-04-10 09:01:24 +02:00
2025-08-07 10:07:06 +02:00
2025-08-26 12:03:09 +02:00
2022-02-25 09:59:35 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-02-23 10:41:43 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2026-03-25 18:44:36 +01:00
2025-11-25 14:10:07 +01:00
2026-02-23 10:42:14 +01:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-11 11:09:23 +02:00
2025-08-07 10:07:06 +02:00
2025-11-25 14:10:07 +01:00
2025-10-09 12:11:29 +02:00
2025-09-24 13:52:35 +02:00
2026-02-23 10:41:43 +01:00
2026-01-28 15:32:16 -05:00
2026-05-21 14:36:07 +02:00
2025-09-12 09:19:56 +02:00
2025-08-07 10:07:06 +02:00
2025-10-10 09:37:19 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-09-03 09:38:13 +02:00
2025-08-07 10:07:06 +02:00
2025-09-03 09:38:13 +02:00
2023-08-29 10:21:56 -07:00
2025-09-12 09:22:44 +02:00
2025-11-25 14:10:07 +01:00
2025-09-12 09:19:56 +02:00
2025-11-25 14:10:07 +01:00
2025-08-07 10:07:06 +02:00
2025-09-03 09:38:13 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-12-22 17:57:36 +01:00
2025-08-07 10:07:06 +02:00
2026-03-16 09:51:05 +01:00
2025-12-08 05:45:56 +01:00
2025-05-21 12:25:24 +03:00
2026-05-21 12:00:04 +02:00
2026-02-27 10:05:21 +01:00
2025-07-17 09:22:46 +02:00
2025-11-17 10:57:28 +01:00
2026-04-28 07:39:15 +09:00
2026-03-16 09:51:05 +01:00
2026-03-30 09:51:15 +02:00
2026-03-23 09:54:24 +01:00
2026-04-09 15:59:30 +02:00
2022-11-15 11:21:43 +01:00
2026-03-02 10:11:15 +01:00
2026-02-27 10:05:21 +01:00
2026-04-13 20:10:58 -07:00
2026-03-16 09:51:05 +01:00
2026-04-16 20:34:34 -07:00
2026-04-07 12:32:28 +02:00
2026-03-09 10:25:34 +01:00