ASoC: ti: davinci-i2s: Add TDM support
authorBastien Curutchet <bastien.curutchet@bootlin.com>
Tue, 2 Apr 2024 07:12:07 +0000 (09:12 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 9 Apr 2024 15:58:38 +0000 (16:58 +0100)
commit37e313cda35aa16623ccae630530651c786a1392
tree3368b160b1e7131de3ecb00bd538ce26fb628f71
parent7dd7a6d2648b0b253cb8be3cdf8e895a995548fe
ASoC: ti: davinci-i2s: Add TDM support

TDM is not supported by the McBSP driver. The McBSP datasheet does not
name explicitly TDM as a supported format but it is possible to configure
the McBSP to do TDM if all slots are used by McBSP.

Add TDM support. It uses single-phase frame. Slot width is used to
compute the McBSP's word length.

Implement the set_tdm_slot() hook of snd_soc_dai_ops struct. It only
supports TDM if all slots are used by McBSP.

The snd_soc_dai_driver's channels_max is updated from 2 to 128.

This was tested with BP_FC format on a platform designed off of
DAVINCI/OMAP_L138. A check is done in davinci_i2s_set_dai_fmt() to
prevent TDM to be used with BC_FC and BC_FP formats.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://msgid.link/r/20240402071213.11671-8-bastien.curutchet@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ti/davinci-i2s.c