[alsa-devel] asoc-v2 ac97-wm9713 suspend/resume
I have been porting linux to the iPAQ 214 which uses a wm9713 codec on the ac97 of a pxa310. It uses it for audio and touchscreen. I'm working from the git tree of arm.linux.org.uk pxa branch and have merged in the asoc-v2-dev of wolfson-asoc (all last thursday).
I have the audio and touchscreen working via a platform driver I've put together (sound/soc/pxa/hpipaq214-audio.c) from copying sound/soc/pxa/zylonite.c etc a few months ago.
I'm now trying to get the audio working through suspend/resume. To save as much power as possible in D3 suspend the wm9713 power is completely turned off in hpipaq214-audio.c via a gpio. This is in suspend_late() and resume_early() to make sure the power is back before the AC97/WM9713 drivers try to wake stuff up.
To make the touchscreen work after suspend I had to add a cold reset to sound/soc/wm9713.c : wm9713_resume().
Also I have to remove the calls to snd_soc_card_suspend_pcms() and snd_soc_card_resume_pcms() from my hpipaq214-audio.c's normal suspend/resume functions. These calls were originally in sound/soc/pxa/zylonite.c but I notice there is now no suspend/resume functions in there. Some of the other platform audio drivers call snd_soc_suspend_pcms() some call snd_soc_suspend() and some snd_soc_card_suspend_pcms().
Only snd_soc_suspend_pcms() seems to actually exists. If I do actually call snd_soc_card_suspend/resume_pcms() then any use of the audio or touchscreen later on freezes the process doing it.
Which am I actually supposed to do, and is there a more 'proper' way way of bringing the wm9713 back up from complete power down on resume?
Oliver Ford
Oliver Ford ipaqlinux@oliford.co.uk writes:
...
Same questions for me, with a different setup : pxa272 + wm9713. I have the same issues on the mioa701 board, with same symptoms : - snd_soc_suspend_* do not work ATM - I had to add a double reset in wm9713 resume() function as you did
Which am I actually supposed to do, and is there a more 'proper' way way of bringing the wm9713 back up from complete power down on resume?
Even if asoc-v2 is still in development, I have the same concerns. Marc, Liam, any idea ?
-- Robert
Robert Jarzmik wrote:
- I had to add a double reset in wm9713 resume() function as you did
Does this actually work for you?
I forgot to say, for me it allows the touchscreen to work, and 'amixer cset xxx xxx' commands seem to make things click, but I get no sound from aplay where I do before the suspend.
Oliver
Oliver Ford ipaqlinux@oliford.co.uk writes:
Robert Jarzmik wrote:
- I had to add a double reset in wm9713 resume() function as you did
Does this actually work for you?
Yes, indeed.
I forgot to say, for me it allows the touchscreen to work, and 'amixer cset xxx xxx' commands seem to make things click, but I get no sound from aplay where I do before the suspend.
I joined here all my modifications to asoc-v2 and my board code. Hope this will help you a bit.
For the other listening here, this is _not_ a submission, I'm still waiting for the official go of asoc-v2 to clean and submit my patches.
-- Robert
On Sun, Jun 22, 2008 at 06:17:01PM +0100, Oliver Ford wrote:
To make the touchscreen work after suspend I had to add a cold reset to sound/soc/wm9713.c : wm9713_resume().
You should do this in your machine driver - the decision about doing a cold reset depends heavily on the system. Some systems will require it but others (especially those where the WM9713 is a wakeup source) would be broken by extra cold resets. This is as much about what the AC97 controller needs on a given system as anything else.
Also I have to remove the calls to snd_soc_card_suspend_pcms() and snd_soc_card_resume_pcms() from my hpipaq214-audio.c's normal suspend/resume functions. These calls were originally in sound/soc/pxa/zylonite.c but I notice there is now no suspend/resume functions in there. Some of the other platform audio drivers call
There are (or were at the time I last worked on ASoC v2 Zylonite) suspend and resume issues in the base Zylonite machine support so I removed the suspend/resume code until it can be tested - IIRC the code was never even compiled.
Only snd_soc_suspend_pcms() seems to actually exists. If I do actually
snd_soc_card_resume_pcms() appears to exist in the current branch?
call snd_soc_card_suspend/resume_pcms() then any use of the audio or touchscreen later on freezes the process doing it.
The audio needs to be the very last thing that is suspended since the codec driver does the final power off of the AC97 bus - once that has happened nothing will be able to access the codec until at least a warm reset has been completed.
Which am I actually supposed to do, and is there a more 'proper' way way of bringing the wm9713 back up from complete power down on resume?
What you're doing seems reasonable.
The most complete worked example of an ASoC v2 driver is the i.MX31ADS/WM8350 driver in sound/soc/imxa31/imx31ads-wm8350.c in the imx31 branch of
git://opensource.wolfsonmicro.com/linux-2.6-audioplus
(it's in a separate place because the base i.MX machine support currently needs a Freescale vendor kernel).
participants (3)
-
Mark Brown
-
Oliver Ford
-
Robert Jarzmik