Re: [PATCH 2/2] ASoC: ti: omap-mcbsp: Implement set_tdm_slot
From: Jarkko Nikula
Date: Tue Nov 17 2026 - 14:15:03 EST
Hi
On 11/17/26 12:03 AM, Joseph Telaak wrote:
As bit clock and frame provider, McBSP sizes the frame from the SRGAcked-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxx>
input, the set_clkdiv() divider and the rate. Only a machine driver can
call set_clkdiv(), so with simple-audio-card or audio-graph-card the
divider stays 1 and the bit clock runs at the full SRG input: 96 MHz on
OMAP3, a 2000-bit frame at 48 kHz.
Implement set_tdm_slot() so these cards can ask for a frame of slots x
slot_width bit clocks with dai-tdm-slot-num and dai-tdm-slot-width.
hw_params() then picks the divider for the rate, and startup() offers
only the rates the SRG input divides to within 0.1%, the IEC 60958 level
II clock tolerance. McBSP sends a frame's words back to back, so
startup() also limits the sample width to the slot width and the
channels to the active slots, which must be the low ones, and refuses
I2S or left-justified with other than two slots. This applies only when
McBSP provides both clocks; without slots nothing changes.
Tested on an OMAP3630 board whose McBSP4 drives the I2S input of an
ADV7513 with no MCLK, with 2 x 32-bit slots and adv7511 taking S32_LE:
a left-only and a right-only 44.1 kHz tone each play at full level
(96 MHz / 34 gives 44117.6 Hz), 48 kHz (0.8% off) and S16_LE are
refused.
Signed-off-by: Joseph Telaak <joseph@xxxxxxxxxx>
---
sound/soc/ti/omap-mcbsp-priv.h | 4 ++
sound/soc/ti/omap-mcbsp.c | 155 ++++++++++++++++++++++++++++++++++++++++-
2 files changed, 158 insertions(+), 1 deletion(-)