Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133106
b: refs/heads/master
c: 668b965
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 6, 2009
1 parent bd63e1c commit ed3d4f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 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: 7a411ee01bf3114ba2a2ae013eaae4e3c41f8eb5
refs/heads/master: 668b9652be33510a2a42b290dd335d34d38e2068
33 changes: 14 additions & 19 deletions trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,10 +1227,7 @@ static const char *slave_vols[] = {
"LFE Playback Volume",
"Side Playback Volume",
"Headphone Playback Volume",
"Headphone2 Playback Volume",
"Speaker Playback Volume",
"External Speaker Playback Volume",
"Speaker2 Playback Volume",
NULL
};

Expand All @@ -1241,10 +1238,7 @@ static const char *slave_sws[] = {
"LFE Playback Switch",
"Side Playback Switch",
"Headphone Playback Switch",
"Headphone2 Playback Switch",
"Speaker Playback Switch",
"External Speaker Playback Switch",
"Speaker2 Playback Switch",
"IEC958 Playback Switch",
NULL
};
Expand Down Expand Up @@ -2976,8 +2970,8 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec)
}

/* create volume control/switch for the given prefx type */
static int create_controls(struct hda_codec *codec, const char *pfx,
hda_nid_t nid, int chs)
static int create_controls_idx(struct hda_codec *codec, const char *pfx,
int idx, hda_nid_t nid, int chs)
{
struct sigmatel_spec *spec = codec->spec;
char name[32];
Expand All @@ -3001,19 +2995,22 @@ static int create_controls(struct hda_codec *codec, const char *pfx,
}

sprintf(name, "%s Playback Volume", pfx);
err = stac92xx_add_control(spec, STAC_CTL_WIDGET_VOL, name,
err = stac92xx_add_control_idx(spec, STAC_CTL_WIDGET_VOL, idx, name,
HDA_COMPOSE_AMP_VAL_OFS(nid, chs, 0, HDA_OUTPUT,
spec->volume_offset));
if (err < 0)
return err;
sprintf(name, "%s Playback Switch", pfx);
err = stac92xx_add_control(spec, STAC_CTL_WIDGET_MUTE, name,
err = stac92xx_add_control_idx(spec, STAC_CTL_WIDGET_MUTE, idx, name,
HDA_COMPOSE_AMP_VAL(nid, chs, 0, HDA_OUTPUT));
if (err < 0)
return err;
return 0;
}

#define create_controls(codec, pfx, nid, chs) \
create_controls_idx(codec, pfx, 0, nid, chs)

static int add_spec_dacs(struct sigmatel_spec *spec, hda_nid_t nid)
{
if (spec->multiout.num_dacs > 4) {
Expand Down Expand Up @@ -3051,12 +3048,6 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,
static const char *chname[4] = {
"Front", "Surround", NULL /*CLFE*/, "Side"
};
static const char *hp_pfxs[] = {
"Headphone", "Headphone2", "Headphone3", "Headphone4"
};
static const char *speaker_pfxs[] = {
"Speaker", "External Speaker", "Speaker2", "Speaker3"
};
hda_nid_t nid;
int i, err;
unsigned int wid_caps;
Expand Down Expand Up @@ -3087,18 +3078,22 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,

} else {
const char *name;
int idx;
switch (type) {
case AUTO_PIN_HP_OUT:
name = hp_pfxs[i];
name = "Headphone";
idx = i;
break;
case AUTO_PIN_SPEAKER_OUT:
name = speaker_pfxs[i];
name = "Speaker";
idx = i;
break;
default:
name = chname[i];
idx = 0;
break;
}
err = create_controls(codec, name, nid, 3);
err = create_controls_idx(codec, name, idx, nid, 3);
if (err < 0)
return err;
if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) {
Expand Down

0 comments on commit ed3d4f6

Please sign in to comment.