diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2006-12-18 07:20:06 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:02:33 -0500 |
commit | b0148a98ec5151fec82064d95f11eb9efbc628ea (patch) | |
tree | d90cc2e61215f583b3af7fdb4cac078872a11dde /sound/aoa | |
parent | 333824034a19baf71b2bd5fe2153630982f379b0 (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.c | 11 |
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 0b7650788f1f..b00fc4842c93 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) | |||
825 | int err = -ENXIO; | 825 | int err = -ENXIO; |
826 | 826 | ||
827 | mutex_lock(&onyx->mutex); | 827 | mutex_lock(&onyx->mutex); |
828 | /* take codec out of suspend */ | 828 | |
829 | /* reset codec */ | ||
830 | onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0); | ||
831 | msleep(1); | ||
832 | onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1); | ||
833 | msleep(1); | ||
834 | onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0); | ||
835 | msleep(1); | ||
836 | |||
837 | /* take codec out of suspend (if it still is after reset) */ | ||
829 | if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v)) | 838 | if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v)) |
830 | goto out_unlock; | 839 | goto out_unlock; |
831 | onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV)); | 840 | onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV)); |