summaryrefslogtreecommitdiffstats
path: root/sound/aoa
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2006-12-18 13:20:06 +0100
committerJaroslav Kysela <perex@suse.cz>2007-02-09 09:02:33 +0100
commitb0148a98ec5151fec82064d95f11eb9efbc628ea (patch)
treed90cc2e61215f583b3af7fdb4cac078872a11dde /sound/aoa
parent333824034a19baf71b2bd5fe2153630982f379b0 (diff)
[ALSA] snd-aoa: fix onyx resume
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> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/aoa')
-rw-r--r--sound/aoa/codecs/snd-aoa-codec-onyx.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c
index 0b7650788f1..b00fc4842c9 100644
--- a/sound/aoa/codecs/snd-aoa-codec-onyx.c
+++ b/sound/aoa/codecs/snd-aoa-codec-onyx.c
@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_info_item *cii)
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));