linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Takashi Iwai <tiwai@suse.de>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	ALSA development <alsa-devel@alsa-project.org>,
	Paul Mackerras <paulus@samba.org>
Subject: [PATCH] snd-aoa: fix onyx resume
Date: Thu, 14 Dec 2006 15:27:48 +0100	[thread overview]
Message-ID: <1166106468.3161.6.camel@johannes.berg> (raw)

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

             reply	other threads:[~2006-12-14 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14 14:27 Johannes Berg [this message]
2006-12-19 10:30 ` [Alsa-devel] [PATCH] snd-aoa: fix onyx resume Takashi Iwai
2007-02-01 20:17   ` Johannes Berg
2007-02-02 12:27     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1166106468.3161.6.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).