[alsa-devel] [PATCH 1/2] ASoC: pcm512x: Implement the set_bclk_ratio interface

Dimitris Papavasiliou dpapavas at gmail.com
Sat Jan 26 20:00:09 CET 2019


On 1/26/19 8:48 PM, Peter Rosin wrote:
> On 2019-01-26 14:17, Dimitris Papavasiliou wrote:
>> +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);
>> +
>> +	if (ratio > 256)
>> +		return -EINVAL;
> 
> ratio == 0 should also generate -EINVAL.

Sorry, I forgot to mention in the notes, that I allowed setting a
zero ratio on purpose, in order to allow "unsetting" the bclk
ratio (since it only takes effect if it is positive).  I'm not
sure if it will ever be necessary to do that in practice, but I
thought I'd allow it, since it has a valid effect.


More information about the Alsa-devel mailing list