Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120417
b: refs/heads/master
c: 42dc237
h: refs/heads/master
i:
  120415: 4b9e358
v: v3
  • Loading branch information
Takashi Iwai committed Oct 27, 2008
1 parent 434650b commit a6498ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 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: 74aeaabc3e452b29bc1b9eac5aa48923569f8a4e
refs/heads/master: 42dc2378b52bb6e155dd2e4fb4ca694785bf2c1d
22 changes: 14 additions & 8 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -4990,7 +4990,7 @@ static struct hda_verb alc260_test_init_verbs[] = {
*/

static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
const char *pfx)
const char *pfx, int *vol_bits)
{
hda_nid_t nid_vol;
unsigned long vol_val, sw_val;
Expand All @@ -5012,10 +5012,14 @@ static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
} else
return 0; /* N/A */

snprintf(name, sizeof(name), "%s Playback Volume", pfx);
err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
if (err < 0)
return err;
if (!(*vol_bits & (1 << nid_vol))) {
/* first control for the volume widget */
snprintf(name, sizeof(name), "%s Playback Volume", pfx);
err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
if (err < 0)
return err;
*vol_bits |= (1 << nid_vol);
}
snprintf(name, sizeof(name), "%s Playback Switch", pfx);
err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, sw_val);
if (err < 0)
Expand All @@ -5029,28 +5033,30 @@ static int alc260_auto_create_multi_out_ctls(struct alc_spec *spec,
{
hda_nid_t nid;
int err;
int vols = 0;

spec->multiout.num_dacs = 1;
spec->multiout.dac_nids = spec->private_dac_nids;
spec->multiout.dac_nids[0] = 0x02;

nid = cfg->line_out_pins[0];
if (nid) {
err = alc260_add_playback_controls(spec, nid, "Front");
err = alc260_add_playback_controls(spec, nid, "Front", &vols);
if (err < 0)
return err;
}

nid = cfg->speaker_pins[0];
if (nid) {
err = alc260_add_playback_controls(spec, nid, "Speaker");
err = alc260_add_playback_controls(spec, nid, "Speaker", &vols);
if (err < 0)
return err;
}

nid = cfg->hp_pins[0];
if (nid) {
err = alc260_add_playback_controls(spec, nid, "Headphone");
err = alc260_add_playback_controls(spec, nid, "Headphone",
&vols);
if (err < 0)
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ static int stac92xx_build_controls(struct hda_codec *codec)
return err;
spec->multiout.share_spdif = 1;
}
if (spec->dig_in_nid && (!spec->gpio_dir & 0x01)) {
if (spec->dig_in_nid && !(spec->gpio_dir & 0x01)) {
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
if (err < 0)
return err;
Expand Down

0 comments on commit a6498ce

Please sign in to comment.