[PATCH RFC 3/3] drm/i2c: tda998x: add support for bclk_ratio

Sven Van Asbroeck thesven73 at gmail.com
Mon Feb 25 16:26:39 UTC 2019


On Fri, Feb 22, 2019 at 4:27 PM Russell King <rmk+kernel at armlinux.org.uk> wrote:
>
> It appears that TDA998x derives the CTS value using the supplied I2S
> bit clock (BCLK) rather than 128·fs.  TDA998x uses two constants named
> m and k in the CTS generator such that we have this relationship
> between the source BCLK and the sink fs:
>
>         128·fs_sink = BCLK·m / k
>
> Where BCLK = bclk_ratio·fs_source.
>
> We have been lucky up to now that all users have scaled their bclk_ratio
> to match the sample width - for example, on Beagle Bone Black, with a
> 16-bit sample width, BCLK = 32·fs, which increases to 64·fs for 32-bit
> samples.  24-bit samples are sent as 32-bit.
>
> We are now starting to see users whose I2S blocks send at 64·fs for
> 16-bit samples, which means TDA998x now breaks.
>
> ASoC has a snd_soc_dai_set_bclk_ratio() call available which sets the
> ratio of BCLK to the sample rate.  Implement support for this.
>
> Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>

Works with an imx6q ssi, but only if the card driver calls
set_bclk_ratio() with the correct value, which is 32/channel
for the fsl_ssi in master mode.

I will post an RFC patch shortly which adds bclk-ratio support
to simple-card.

Tested-by: Sven Van Asbroeck <TheSven73 at gmail.com>


More information about the dri-devel mailing list