From: Johannes Berg <johannes@sipsolutions.net> Date: 2006-12-14 14:31:56
When the machine resumes the onyx codec might be in a weird state. Hence,
simply fully reset it once (and keep the code to take it out of suspend in
case the suspend of the codec chip survives a reset).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
There's another problem with i2sbus suspend, namely that the i2sbus code
doesn't really handle a suspend well at all, it needs to re-init the
hardware during resume. I noticed because firmware on the quad powermac
doesn't set the i2sbus to 44.1kHz but 42kHz or something like that so
when I was playing a song across suspend/resume it ended up slower...
I don't want to fix this until that i2sbus control rewrite/fix though
because it'll most likely collide.
Takashi, please apply this fix.
@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_infointerr=-ENXIO;mutex_lock(&onyx->mutex);-/* take codec out of suspend */++/* reset codec */+onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio,0);+msleep(1);+onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio,1);+msleep(1);+onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio,0);+msleep(1);++/* take codec out of suspend (if it still is after reset) */if(onyx_read_register(onyx,ONYX_REG_CONTROL,&v))gotoout_unlock;onyx_write_register(onyx,ONYX_REG_CONTROL,v&~(ONYX_ADPSV|ONYX_DAPSV));
At Thu, 14 Dec 2006 15:27:48 +0100,
Johannes Berg wrote:
When the machine resumes the onyx codec might be in a weird state. Hence,
simply fully reset it once (and keep the code to take it out of suspend in
case the suspend of the codec chip survives a reset).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Applied to ALSA tree now. Thanks.
Takashi
quoted hunk
---
There's another problem with i2sbus suspend, namely that the i2sbus code
doesn't really handle a suspend well at all, it needs to re-init the
hardware during resume. I noticed because firmware on the quad powermac
doesn't set the i2sbus to 44.1kHz but 42kHz or something like that so
when I was playing a song across suspend/resume it ended up slower...
I don't want to fix this until that i2sbus control rewrite/fix though
because it'll most likely collide.
Takashi, please apply this fix.
@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_infointerr=-ENXIO;mutex_lock(&onyx->mutex);-/* take codec out of suspend */++/* reset codec */+onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio,0);+msleep(1);+onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio,1);+msleep(1);+onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio,0);+msleep(1);++/* take codec out of suspend (if it still is after reset) */if(onyx_read_register(onyx,ONYX_REG_CONTROL,&v))gotoout_unlock;onyx_write_register(onyx,ONYX_REG_CONTROL,v&~(ONYX_ADPSV|ONYX_DAPSV));-------------------------------------------------------------------------
From: Johannes Berg <johannes@sipsolutions.net> Date: 2007-02-02 12:14:28
On Tue, 2006-12-19 at 11:30 +0100, Takashi Iwai wrote:
At Thu, 14 Dec 2006 15:27:48 +0100,
Johannes Berg wrote:
quoted
When the machine resumes the onyx codec might be in a weird state. Hence,
simply fully reset it once (and keep the code to take it out of suspend in
case the suspend of the codec chip survives a reset).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Applied to ALSA tree now. Thanks.
It doesn't seem to be upstream yet, is there some holdup? Not that it's
important to me at this time, just curious.
johannes
At Thu, 01 Feb 2007 21:17:39 +0100,
Johannes Berg wrote:
On Tue, 2006-12-19 at 11:30 +0100, Takashi Iwai wrote:
quoted
At Thu, 14 Dec 2006 15:27:48 +0100,
Johannes Berg wrote:
quoted
When the machine resumes the onyx codec might be in a weird state. Hence,
simply fully reset it once (and keep the code to take it out of suspend in
case the suspend of the codec chip survives a reset).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Applied to ALSA tree now. Thanks.
It doesn't seem to be upstream yet, is there some holdup? Not that it's
important to me at this time, just curious.
It's in alsa.git mm branch. A bunch of patches are only in mm tree
just because the push request missed the 2.6.20 merge window,
unfortunately...
Takashi