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

Peter Rosin peda at axentia.se
Tue Jan 15 09:08:43 CET 2019


On 2019-01-14 18:36, Pierre-Louis Bossart wrote:
> 
>>>   
>>>   		mck_rate = sck_rate;
>>>   	} else {
>>> @@ -1383,6 +1389,16 @@ static int pcm512x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
>>>   	return 0;
>>>   }
>>>   
>>> +static int pcm512x_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
>>> +{
>>> +	struct snd_soc_component *component = dai->component;
>>> +	struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
>>> +
>>> +	pcm512x->bclk_ratio = ratio;
>> 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?

Cheers,
Peter



More information about the Alsa-devel mailing list