All of lore.kernel.org
 help / color / mirror / Atom feed
* ASOC snd_soc_dai_ops for clock mux control
@ 2013-04-03 16:22 Gellner, Christoph (ADITG/SW1)
  2013-04-04  5:55 ` Gabriel M. Beddingfield
  0 siblings, 1 reply; 4+ messages in thread
From: Gellner, Christoph (ADITG/SW1) @ 2013-04-03 16:22 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hi all,

I'm working on the driver of an audio CPU DAI IP providing
-       Internal clocks which can be used for master clock generation by TX as well as RX section
-       One oversampling clock available to RX section
-       One oversampling clock available to TX section.

Kernel version is 3.5.7

I want to add support to the CPU DAI driver to
-       Specify the rate of the input clocks
-       Select which of the clock inputs shall be used by RX and which shall be used by TX section

I'm currently wondering how to map this to existing snd_soc_dai_ops functions.
Currently I see only set_sysclk, set_pll, set_clkdiv for clock control.

I plan to use set_sysclk to specify the rate as well as the direction of each clock.

What is currently missing for me is a way to specify the clock to be used by RX or TX section.

I can't really add this in set_sysclk. In case I switch to clock X when set_sysclk is called with clock ID of X, I need a way to distinguish if RX or TX section or both need to switch to this clock.
But I can't really double the internal clock X in virtual clocks X_TX, X_RX (one time for TX and one time for RX section) as the internal clock X has only one rate for both sections and this would not represent the hardware correctly.

Do you have any recommendation how to implement ?

What do you think about adding a new function pointer to snd_soc_dai_ops ?
int (*set_clkmux)(struct snd_soc_dai *dai, int mux_id, int source_id);
I think this would be the cleanest solution as it models the features of the hardware (the clock multiplexers for RX or TX sections)

It might be possible to use set_pll or set_clkdiv to realize.
I could use set_pll and ignore the freq_in and freq_out
I could use set_clkdiv and interpret div (divider integer value) as a source_id
But this is not a 100% clean solution in my opinion.


Best regards

Christoph

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

end of thread, other threads:[~2013-04-10 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 16:22 ASOC snd_soc_dai_ops for clock mux control Gellner, Christoph (ADITG/SW1)
2013-04-04  5:55 ` Gabriel M. Beddingfield
2013-04-10 13:16   ` Mark Brown
2013-04-10 13:55   ` Gellner, Christoph (ADITG/SW1)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.