Query on sysclk source
Hi All,
I do have a query for snd_soc_dai_set_sysclk(). It takes 'clk_id' as argument which is used for sysclk source purpose in some drivers and in some it seems to be used for clock ID specifically. Please see below references. - https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound... as sysclk source) - https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound... as sysclk source) - https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound... actually seems refer to specific clock id)
To add snd_soc_component_sysclk() takes both 'clk_id' and 'source' arguments.
Currently snd_soc_dai_set_sysclk() has following implementation. ------------------------------------------------------------------ / int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id,// // unsigned int freq, int dir)// // {// // int ret;// // // if (dai->driver->ops &&// //dai->driver->ops->set_sysclk)// // ret = dai->driver->ops->set_sysclk(dai, clk_id, freq, dir);// // else// // ret = snd_soc_component_set_sysclk(dai->component, clk_id, 0,// // freq, dir);// // // return soc_dai_ret(dai, ret);// // }/ -------------------------------------------------------------------
The 'source' for snd_soc_component_set_sysclk() is hardcoded to 0 always, which may not be the case always. Please see below. - https://elixir.bootlin.com/linux/v5.11/source/sound/soc/samsung/bells.c#L161
Hence I am wondering if 'clk_id' argument is being used inconsistently for snd_soc_dai_set_sysclk() and should we rather have a separate 'source' argument for this as well?
Thanks, Sameer.
On Mon, Feb 22, 2021 at 09:32:53PM +0530, Sameer Pujar wrote:
Hence I am wondering if 'clk_id' argument is being used inconsistently for snd_soc_dai_set_sysclk() and should we rather have a separate 'source' argument for this as well?
Yeah, we should in case someone wants to use it with one of the few devices with selectable sources implemented.
participants (2)
-
Mark Brown
-
Sameer Pujar