![](https://secure.gravatar.com/avatar/21c96b641c1fea341bf8c485ee77eaf9.jpg?s=120&d=mm&r=g)
Liam Girdwood wrote:
Some codecs can only support a small range of sample rates e.g. 8k & 48k, whilst your controller may support more. This just makes sure the audio is set a rate the codec can handle, otherwise audio quality will probably suffer.
What about boards where the codec does *not* dictate the available sample rates? That is, what if the SOC can't generate the frequencies necessary to drive the codec at all the rates it supports? The codec driver would then need to be told by the machine driver which sample rates are going to be used. When the codec driver is initialized, it needs to set the snd_soc_codec.dai field to point to the codec's DAI, and that structure contains the list of supported sample rates.
I guess in the PowerPC world, the codec driver can query the codec node in the device tree, but ideally there would need to be some standard interface.