Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56206
b: refs/heads/master
c: 35b2672
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed May 11, 2007
1 parent f22f6d0 commit 962aa2d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 713fb93936bebc158b4bbae6be61a6310923543c
refs/heads/master: 35b26722a1716b45b5b92d5af2f1ea1fdd4d0a25
31 changes: 18 additions & 13 deletions trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,8 +1898,9 @@ static int ad1988_spdif_playback_source_get(struct snd_kcontrol *kcontrol,

sel = snd_hda_codec_read(codec, 0x02, 0, AC_VERB_GET_CONNECT_SEL, 0);
if (sel > 0) {
sel = snd_hda_codec_read(codec, 0x0b, 0, AC_VERB_GET_CONNECT_SEL, 0);
if (sel <= 3)
sel = snd_hda_codec_read(codec, 0x0b, 0,
AC_VERB_GET_CONNECT_SEL, 0);
if (sel < 3)
sel++;
else
sel = 0;
Expand All @@ -1912,23 +1913,27 @@ static int ad1988_spdif_playback_source_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
unsigned int sel;
unsigned int val, sel;
int change;

val = ucontrol->value.enumerated.item[0];
sel = snd_hda_codec_read(codec, 0x02, 0, AC_VERB_GET_CONNECT_SEL, 0);
if (! ucontrol->value.enumerated.item[0]) {
if (!val) {
change = sel != 0;
if (change)
snd_hda_codec_write(codec, 0x02, 0, AC_VERB_SET_CONNECT_SEL, 0);
if (change || codec->in_resume)
snd_hda_codec_write(codec, 0x02, 0,
AC_VERB_SET_CONNECT_SEL, 0);
} else {
change = sel == 0;
if (change)
snd_hda_codec_write(codec, 0x02, 0, AC_VERB_SET_CONNECT_SEL, 1);
sel = snd_hda_codec_read(codec, 0x0b, 0, AC_VERB_GET_CONNECT_SEL, 0) + 1;
change |= sel == ucontrol->value.enumerated.item[0];
if (change)
snd_hda_codec_write(codec, 0x02, 0, AC_VERB_SET_CONNECT_SEL,
ucontrol->value.enumerated.item[0] - 1);
if (change || codec->in_resume)
snd_hda_codec_write(codec, 0x02, 0,
AC_VERB_SET_CONNECT_SEL, 1);
sel = snd_hda_codec_read(codec, 0x0b, 0,
AC_VERB_GET_CONNECT_SEL, 0) + 1;
change |= sel != val;
if (change || codec->in_resume)
snd_hda_codec_write(codec, 0x0b, 0,
AC_VERB_SET_CONNECT_SEL, val - 1);
}
return change;
}
Expand Down

0 comments on commit 962aa2d

Please sign in to comment.