linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] snd-aoa: fix onyx resume
@ 2006-12-14 14:27 Johannes Berg
  2006-12-19 10:30 ` [Alsa-devel] " Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2006-12-14 14:27 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: linuxppc-dev list, ALSA development, Paul Mackerras

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. 

--- linux-2.6-git.orig/sound/aoa/codecs/snd-aoa-codec-onyx.c	2006-12-13 19:32:38.520763489 +0100
+++ linux-2.6-git/sound/aoa/codecs/snd-aoa-codec-onyx.c	2006-12-13 19:34:58.597763489 +0100
@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_info
 	int err = -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))
 		goto out_unlock;
 	onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));

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

* Re: [Alsa-devel] [PATCH] snd-aoa: fix onyx resume
  2006-12-14 14:27 [PATCH] snd-aoa: fix onyx resume Johannes Berg
@ 2006-12-19 10:30 ` Takashi Iwai
  2007-02-01 20:17   ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2006-12-19 10:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev list, ALSA development, Paul Mackerras

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

> 
> ---
> 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. 
> 
> --- linux-2.6-git.orig/sound/aoa/codecs/snd-aoa-codec-onyx.c	2006-12-13 19:32:38.520763489 +0100
> +++ linux-2.6-git/sound/aoa/codecs/snd-aoa-codec-onyx.c	2006-12-13 19:34:58.597763489 +0100
> @@ -825,7 +825,16 @@ static int onyx_resume(struct codec_info
>  	int err = -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))
>  		goto out_unlock;
>  	onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));
> 
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 

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

* Re: [Alsa-devel] [PATCH] snd-aoa: fix onyx resume
  2006-12-19 10:30 ` [Alsa-devel] " Takashi Iwai
@ 2007-02-01 20:17   ` Johannes Berg
  2007-02-02 12:27     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2007-02-01 20:17 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: linuxppc-dev list, ALSA development, Paul Mackerras

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

On Tue, 2006-12-19 at 11:30 +0100, Takashi Iwai wrote:
> 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.

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

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

* Re: [Alsa-devel] [PATCH] snd-aoa: fix onyx resume
  2007-02-01 20:17   ` Johannes Berg
@ 2007-02-02 12:27     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2007-02-02 12:27 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev list, ALSA development, Paul Mackerras

At Thu, 01 Feb 2007 21:17:39 +0100,
Johannes Berg wrote:
> 
> On Tue, 2006-12-19 at 11:30 +0100, Takashi Iwai wrote:
> > 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.
> 
> 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

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

end of thread, other threads:[~2007-02-02 12:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 14:27 [PATCH] snd-aoa: fix onyx resume Johannes Berg
2006-12-19 10:30 ` [Alsa-devel] " Takashi Iwai
2007-02-01 20:17   ` Johannes Berg
2007-02-02 12:27     ` Takashi Iwai

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