mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ASoC: ti: omap-mcbsp: TDM slots for generic cards
@ 2026-12-01  0:00 Joseph Telaak
  2026-12-01  0:00 ` [PATCH v3 1/2] ASoC: ti: omap-mcbsp: Use all 8 bits of CLKGDV Joseph Telaak
  2026-12-01  0:01 ` [PATCH v3 2/2] ASoC: ti: omap-mcbsp: Implement set_tdm_slot Joseph Telaak
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph Telaak @ 2026-12-01  0:00 UTC (permalink / raw)
  To: Jarkko Nikula, Sen Wang, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: linux-sound, linux-omap, linux-kernel, Joseph Telaak

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@telaak.dev

---
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@telaak.dev

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@telaak.dev

---
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@telaak.dev>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-01 22:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01  0:00 [PATCH v3 0/2] ASoC: ti: omap-mcbsp: TDM slots for generic cards Joseph Telaak
2026-12-01  0:00 ` [PATCH v3 1/2] ASoC: ti: omap-mcbsp: Use all 8 bits of CLKGDV Joseph Telaak
2026-12-01  0:01 ` [PATCH v3 2/2] ASoC: ti: omap-mcbsp: Implement set_tdm_slot Joseph Telaak
2026-12-01 21:22   ` Jarkko Nikula
2026-12-01 22:33     ` Joseph Telaak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®