[PATCH v3 0/2] ASoC: ti: omap-mcbsp: TDM slots for generic cards

From: Joseph Telaak

Date: Mon Nov 30 2026 - 19:01:09 EST


With simple-audio-card or audio-graph-card, McBSP as clock provider runs
its bit clock at the full SRG input, since only a machine driver can set
its divider. Patch 2 adds set_tdm_slot() so these cards can ask for a
frame of slots x slot_width bit clocks; patch 1 lets the divider use all
8 bits of CLKGDV.

The ADV7513 in the test takes S32_LE only with a companion adv7511
patch:
https://lore.kernel.org/r/20261116-adv7511-s32-v1-1-40ae8228db42@xxxxxxxxxx

---
Changes in v3:
- Rebased onto asoc for-next 8cb402ec2c74.
- 2/2: dropped slot_sysclk: with slots, set_dai_sysclk() refuses a new
frequency while a stream is configured, until its hw_free() (Jarkko).
Only with slots: McBSP stays configured until the last close, and
omap3pandora sets 256 x rate in each hw_params(), so a rate change on
one open would fail.
- 2/2: dropped sysclk_fclk: the SRG source comes from the register
cache, and from CLKS the sysclk must be the fclk rate (Jarkko). The
check is in hw_params(), not set_dai_sysclk(): simple-audio-card sets
the sysclk at init, before the format and the slots.
- 2/2: slots apply only when McBSP drives both bit clock pins from the
SRG, and the fclk check is skipped on OMAP1, where CLKS is the pin.
- 2/2: the DAI's remove() clears the slots, so they don't outlive the
card that set them.
- Tested again on the same board, including mclk-fs being refused.
- Link to v2: https://patch.msgid.link/20261123-omap-mcbsp-tdm-slot-v2-0-3e3aae215952@xxxxxxxxxx

Changes in v2:
- 2/2: hw_params() checks the stream against the slots and the sysclk
(Mark).
- 2/2: rates are limited at open only for a sysclk set outside a stream,
as simple-audio-card does at init; a sysclk a card sets in hw_params()
is checked there (Mark).
- 2/2: both directions share the SRG, so the second is held to the
first's rate and sysclk until the first's hw_free().
- 2/2: channels are pinned to the active slots, non-empty TX and RX masks
need the same weight, and unsupported slots are reported.
- 2/2: a sysclk from the internal fclk must be that clock's rate, so
simple-card's mclk-fs (rate x fs) is refused instead of misprogrammed.
- 2/2: dropped Jarkko's Acked-by since the patch changed.
- 1/2: commit message wording only; keeps Jarkko's Acked-by.
- Not supported: dai-tdm-slot-width-map switching.
- Not tested on hardware: full duplex and a sysclk set in hw_params();
the test board has playback only.
- Link to v1: https://patch.msgid.link/20261116-omap-mcbsp-tdm-slot-v1-0-6c9f7aa45a29@xxxxxxxxxx

---
Joseph Telaak (2):
ASoC: ti: omap-mcbsp: Use all 8 bits of CLKGDV
ASoC: ti: omap-mcbsp: Implement set_tdm_slot

sound/soc/ti/omap-mcbsp-priv.h | 12 +-
sound/soc/ti/omap-mcbsp.c | 348 ++++++++++++++++++++++++++++++++++++++++-
2 files changed, 355 insertions(+), 5 deletions(-)
---
base-commit: 8cb402ec2c746f32b17e1aab14e900e7e45cb025
change-id: 20261115-omap-mcbsp-tdm-slot-7ee61348226b

Best regards,
--
Joseph Telaak <joseph@xxxxxxxxxx>