ASoC: pcm512x: implement set_tdm_slot interface
authorMatthias Reichl <hias@horus.com>
Thu, 22 Feb 2018 10:55:06 +0000 (11:55 +0100)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:07:56 +0000 (00:07 +0100)
commit594e1f24838de4ab516c6a6c396dfea86ce00d94
tree7843dbb90e0116ef62a1a00231aa2f245a5c5dc8
parenteb435bf43ebf73ef81c725f6c001a7d0dec728b7
ASoC: pcm512x: implement set_tdm_slot interface

PCM512x can accept data padded with additional BCLK cycles
but the driver currently lacks an interface to configure this.

This leads to the problem that S24_LE format in master mode
can result in non-integer clock divisors and pcm512x running
at a rather off rate.

For example 48kHz with 48fs BCLK and SCLK at 24.576MHz uses
a divisor of 10 (rounded down from 10.6666) and results in a
51.2kHz LRCLK. With 64fs BCLK a divisor of 8 is used and
LRCLK runs at exactly 48kHz.

Fix this by providing a minimal set_tdm_slot implementation
so machine drivers can optionally configure custom BCLK ratios.

Signed-off-by: Matthias Reichl <hias@horus.com>
sound/soc/codecs/pcm512x.c