alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/2] master clock issues
@ 2017-03-17 15:41 olivier moysan
  2017-03-17 15:41 ` [RFC PATCH v2 1/2] ASoC: wm8994: default master clock selection olivier moysan
  2017-03-17 15:41 ` [RFC PATCH v2 2/2] ASoC: wm8994: delay aifxclk activation olivier moysan
  0 siblings, 2 replies; 3+ messages in thread
From: olivier moysan @ 2017-03-17 15:41 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, mcoquelin.stm32,
	alexandre.torgue, alsa-devel, olivier.moysan
  Cc: arnaud.pouliquen

Hello,

I face two issues using wm8994 codec driver.
Below is a description of the use cases rising the problem.
I added the patches which allow to fix these issues.
These minimalist patches can be seen as a starting point for a discussion on the best
way to handle the use cases exposed.


- ASoC: wm8994: default master clock selection

Use case:
CPU DAI and codec are managed through simple card.
Wolson codec wm8994 is set as slave of CPU DAI and CPU DAI feeds codec with master clock.
Master clock is derived from mclk-fs property and provided to CPU DAI and codec 
through snd_soc_dai_set_sysclk API. 

Analysis:
The simple card assumes id 0 for master clock.
However wm8994 codec exposes master clock ids from 1 to 4. (MCLK1, MCLK2 ..)

The proposal in this patch is to define a default selection regarding master clock
when id 0 is provided.


- ASoC: wm8994: delay aifxclk activation

Use case:
Wolson codec wm8994 is set as slave of CPU DAI and CPU DAI feeds codec with master clock.
CPU DAI generates master clock when enabled in trigger callback.
So master clock is available only at runtime. 
Master clock is not available when configuring codec through alsa controls.

Analysis:
When we configure aifx clock while master clock is not active, related registers are not updated in wm8894 codec.
A way to go around this problem, is to delay aifxclk activation until SND_SOC_DAPM_POST_PMU DAPM stage.
The purpose of patch here is to illustrate this workaround. 

What I cannot clearly figure out, is  how this may impact other uses of wm8894 codec.
I try to know if it's worth investigating further in this direction or if it will not be applicable.
If not applicable, what maybe the other options ?

Changes in v2:
	Add change log on aifxclk delay patch.

regards
olivier

olivier moysan (2):
  ASoC: wm8994: default master clock selection
  ASoC: wm8994: delay aifxclk activation

 sound/soc/codecs/wm8994.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2017-03-17 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-17 15:41 [RFC PATCH v2 0/2] master clock issues olivier moysan
2017-03-17 15:41 ` [RFC PATCH v2 1/2] ASoC: wm8994: default master clock selection olivier moysan
2017-03-17 15:41 ` [RFC PATCH v2 2/2] ASoC: wm8994: delay aifxclk activation olivier moysan

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).