Commit b0148a98 authored by Johannes Berg's avatar Johannes Berg Committed by Jaroslav Kysela

[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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 33382403
...@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_info_item *cii) ...@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_info_item *cii)
int err = -ENXIO; int err = -ENXIO;
mutex_lock(&onyx->mutex); 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)) if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
goto out_unlock; goto out_unlock;
onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV)); onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment