Skip to content

Commit

Permalink
[ALSA] snd-aoa: fix onyx resume
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
jmberg authored and Jaroslav Kysela committed Feb 9, 2007
1 parent 3338240 commit b0148a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sound/aoa/codecs/snd-aoa-codec-onyx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit b0148a9

Please sign in to comment.