Skip to content

Commit b0148a9

Browse files
jmbergJaroslav Kysela
authored andcommitted
[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>
1 parent 3338240 commit b0148a9

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎sound/aoa/codecs/snd-aoa-codec-onyx.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,16 @@ static int onyx_resume(struct codec_info_item *cii)
825825
int err = -ENXIO;
826826

827827
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) */
829838
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
830839
goto out_unlock;
831840
onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));

0 commit comments

Comments
 (0)