alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Query on sysclk source
@ 2021-02-22 16:02 Sameer Pujar
  2021-02-22 16:07 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Sameer Pujar @ 2021-02-22 16:02 UTC (permalink / raw)
  To: Linux-ALSA; +Cc: Mark Brown

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/soc/atmel/sam9g20_wm8731.c#n105(clk_id 
as sysclk source)
   - 
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/atmel/sam9x5_wm8731.c#n50(clk_id 
as sysclk source)
   - 
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/sound/soc/intel/boards/bytcr_wm5102.c#n78(clk_id 
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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Query on sysclk source
  2021-02-22 16:02 Query on sysclk source Sameer Pujar
@ 2021-02-22 16:07 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-02-22 16:07 UTC (permalink / raw)
  To: Sameer Pujar; +Cc: Linux-ALSA

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-22 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 16:02 Query on sysclk source Sameer Pujar
2021-02-22 16:07 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).