[alsa-devel] [RFC PATCH] ASoC: pcm512x: Implement the set_bclk_ratio interface

Dimitris Papavasiliou dpapavas at gmail.com
Tue Jan 15 13:19:12 CET 2019


On Tue, Jan 15, 2019 at 10:08 AM Peter Rosin <peda at axentia.se> wrote:
>
> On 2019-01-14 18:36, Pierre-Louis Bossart wrote:
> >
> >> You should perhaps check if (ratio >= 1 && ratio <= 256) prior to
> >> accepting a divider that can't be programmed? But maybe that's enforced
> >> somewhere else? And perhaps the sanity check should be even stricter?
> > Yes it should be stricter with a power of two only. I tried really hard
> > to make this codec work with ratios of 50 (and a 19.2 MHz mclk) on an Up
> > board and it's just not possible, probably not supported by hardware.
>
> Disallowing anything but powers of two just because 50 doesn't work seems
> pretty wild. According to docs I think 48 should work just fine.
>
> Section 8.3.2 Audio Data Interface page 16.
> http://www.ti.com/lit/ds/symlink/pcm5142.pdf
>
> Or?

According to the datasheet[1], you can program any divider between 1
and 256, via register 33 (page 80), but, as Peter points out, in the
description of the audio data interface (page 15), only the values 32,
48, 64, 128, 256 are mentioned as permissible.  So one approach would
be to restrict the values accepted by the callback to this set.  Since
the datasheet is not terribly clear on whether only these are allowed,
and since the ratio is set explicitly in the machine driver, it could
be argued that it would be preferable to allow all values that can be
set in the register, to minimize the risk of needlessly rejecting
valid configurations.

[1] http://www.ti.com/lit/ds/symlink/pcm5121.pdf


More information about the Alsa-devel mailing list