Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111071
b: refs/heads/master
c: 00ef50c
h: refs/heads/master
i:
  111069: 77b322d
  111067: c9acff5
  111063: c08922e
  111055: 5a710f6
  111039: c96d123
v: v3
  • Loading branch information
Matthew Ranostay authored and Jaroslav Kysela committed Oct 10, 2008
1 parent 590db35 commit 175f30c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 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: f3911c5ab93e4295938b2013104d2986ea601454
refs/heads/master: 00ef50c242f05381cd3fbf56bbda28155cbbb7c8
35 changes: 33 additions & 2 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ struct sigmatel_spec {
unsigned int mic_switch: 1;
unsigned int alt_switch: 1;
unsigned int hp_detect: 1;
unsigned int spdif_mute: 1;

/* gpio lines */
unsigned int eapd_mask;
Expand Down Expand Up @@ -547,10 +548,32 @@ static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct sigmatel_spec *spec = codec->spec;
struct hda_input_mux *smux = &spec->private_smux;
unsigned int smux_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
int err, val;
hda_nid_t nid;

return snd_hda_input_mux_put(codec, spec->sinput_mux, ucontrol,
err = snd_hda_input_mux_put(codec, spec->sinput_mux, ucontrol,
spec->smux_nids[smux_idx], &spec->cur_smux[smux_idx]);
if (err < 0)
return err;

if (spec->spdif_mute) {
if (smux_idx == 0)
nid = spec->multiout.dig_out_nid;
else
nid = codec->slave_dig_outs[smux_idx - 1];
if (spec->cur_smux[smux_idx] == smux->num_items - 1)
val = AMP_OUT_MUTE;
if (smux_idx == 0)
nid = spec->multiout.dig_out_nid;
else
nid = codec->slave_dig_outs[smux_idx - 1];
/* un/mute SPDIF out */
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE, val);
}
return 0;
}

static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
Expand Down Expand Up @@ -1228,6 +1251,15 @@ static int stac92xx_build_controls(struct hda_codec *codec)
return err;
}
if (spec->num_smuxes > 0) {
int wcaps = get_wcaps(codec, spec->multiout.dig_out_nid);
struct hda_input_mux *smux = &spec->private_smux;
/* check for mute support on SPDIF out */
if (wcaps & AC_WCAP_OUT_AMP) {
smux->items[smux->num_items].label = "Off";
smux->items[smux->num_items].index = 0;
smux->num_items++;
spec->spdif_mute = 1;
}
stac_smux_mixer.count = spec->num_smuxes;
err = snd_ctl_add(codec->bus->card,
snd_ctl_new1(&stac_smux_mixer, codec));
Expand Down Expand Up @@ -4377,7 +4409,6 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)

spec->num_muxes = ARRAY_SIZE(stac92hd71bxx_mux_nids);
spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);
spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);

switch (spec->board_config) {
case STAC_HP_M4:
Expand Down

0 comments on commit 175f30c

Please sign in to comment.