From: Johannes Berg Date: Mon, 18 Dec 2006 12:20:06 +0000 (+0100) Subject: [ALSA] snd-aoa: fix onyx resume X-Git-Tag: v3.12-rc1~31512^2~62^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0148a98ec5151fec82064d95f11eb9efbc628ea;p=kernel%2Fkernel-generic.git [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 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/aoa/codecs/snd-aoa-codec-onyx.c b/sound/aoa/codecs/snd-aoa-codec-onyx.c index 0b76507..b00fc48 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));