Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133114
b: refs/heads/master
c: b880c74
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 10, 2009
1 parent 11d3a20 commit 8796a83
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 45 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: dd5746a85cb21ea5b3afca0b569586a05aa56846
refs/heads/master: b880c74adf7e79b97de710a152ea82f292f9abc7
61 changes: 17 additions & 44 deletions trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,17 @@ static void conexant_free(struct hda_codec *codec)
kfree(codec->spec);
}

static struct snd_kcontrol_new cxt_capture_mixers[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Source",
.info = conexant_mux_enum_info,
.get = conexant_mux_enum_get,
.put = conexant_mux_enum_put
},
{}
};

static const char *slave_vols[] = {
"Headphone Playback Volume",
"Speaker Playback Volume",
Expand Down Expand Up @@ -522,6 +533,12 @@ static int conexant_build_controls(struct hda_codec *codec)
return err;
}

if (spec->input_mux) {
err = snd_hda_add_new_ctls(codec, cxt_capture_mixers);
if (err < 0)
return err;
}

return 0;
}

Expand Down Expand Up @@ -753,13 +770,6 @@ static void cxt5045_hp_unsol_event(struct hda_codec *codec,
}

static struct snd_kcontrol_new cxt5045_mixers[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Source",
.info = conexant_mux_enum_info,
.get = conexant_mux_enum_get,
.put = conexant_mux_enum_put
},
HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x01, HDA_INPUT),
HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x01, HDA_INPUT),
HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x02, HDA_INPUT),
Expand Down Expand Up @@ -793,13 +803,6 @@ static struct snd_kcontrol_new cxt5045_benq_mixers[] = {
};

static struct snd_kcontrol_new cxt5045_mixers_hp530[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Source",
.info = conexant_mux_enum_info,
.get = conexant_mux_enum_get,
.put = conexant_mux_enum_put
},
HDA_CODEC_VOLUME("Int Mic Capture Volume", 0x1a, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("Int Mic Capture Switch", 0x1a, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("Ext Mic Capture Volume", 0x1a, 0x01, HDA_INPUT),
Expand Down Expand Up @@ -1170,20 +1173,6 @@ static struct hda_channel_mode cxt5047_modes[1] = {
{ 2, NULL },
};

static struct hda_input_mux cxt5047_capture_source = {
.num_items = 1,
.items = {
{ "Mic", 0x2 },
}
};

static struct hda_input_mux cxt5047_hp_capture_source = {
.num_items = 1,
.items = {
{ "ExtMic", 0x2 },
}
};

static struct hda_input_mux cxt5047_toshiba_capture_source = {
.num_items = 2,
.items = {
Expand Down Expand Up @@ -1321,13 +1310,6 @@ static struct snd_kcontrol_new cxt5047_mixers[] = {
};

static struct snd_kcontrol_new cxt5047_toshiba_mixers[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Source",
.info = conexant_mux_enum_info,
.get = conexant_mux_enum_get,
.put = conexant_mux_enum_put
},
HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x19, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x19, 0x02, HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT),
Expand All @@ -1349,13 +1331,6 @@ static struct snd_kcontrol_new cxt5047_toshiba_mixers[] = {
};

static struct snd_kcontrol_new cxt5047_hp_mixers[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Capture Source",
.info = conexant_mux_enum_info,
.get = conexant_mux_enum_get,
.put = conexant_mux_enum_put
},
HDA_CODEC_VOLUME("Mic Bypass Capture Volume", 0x19, 0x02, HDA_INPUT),
HDA_CODEC_MUTE("Mic Bypass Capture Switch", 0x19,0x02,HDA_INPUT),
HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x03, HDA_INPUT),
Expand Down Expand Up @@ -1614,7 +1589,6 @@ static int patch_cxt5047(struct hda_codec *codec)
spec->num_adc_nids = 1;
spec->adc_nids = cxt5047_adc_nids;
spec->capsrc_nids = cxt5047_capsrc_nids;
spec->input_mux = &cxt5047_capture_source;
spec->num_mixers = 1;
spec->mixers[0] = cxt5047_mixers;
spec->num_init_verbs = 1;
Expand All @@ -1633,7 +1607,6 @@ static int patch_cxt5047(struct hda_codec *codec)
codec->patch_ops.unsol_event = cxt5047_hp2_unsol_event;
break;
case CXT5047_LAPTOP_HP:
spec->input_mux = &cxt5047_hp_capture_source;
spec->num_init_verbs = 2;
spec->init_verbs[1] = cxt5047_hp_init_verbs;
spec->mixers[0] = cxt5047_hp_mixers;
Expand Down

0 comments on commit 8796a83

Please sign in to comment.