aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_sigmatel.c132
1 files changed, 0 insertions, 132 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 4cce92cf8ead..83a338b9c080 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -228,7 +228,6 @@ struct sigmatel_spec {
228 228
229 /* playback */ 229 /* playback */
230 struct hda_input_mux *mono_mux; 230 struct hda_input_mux *mono_mux;
231 struct hda_input_mux *amp_mux;
232 unsigned int cur_mmux; 231 unsigned int cur_mmux;
233 struct hda_multi_out multiout; 232 struct hda_multi_out multiout;
234 hda_nid_t dac_nids[5]; 233 hda_nid_t dac_nids[5];
@@ -281,7 +280,6 @@ struct sigmatel_spec {
281 unsigned int cur_smux[2]; 280 unsigned int cur_smux[2];
282 unsigned int cur_amux; 281 unsigned int cur_amux;
283 hda_nid_t *amp_nids; 282 hda_nid_t *amp_nids;
284 unsigned int num_amps;
285 unsigned int powerdown_adcs; 283 unsigned int powerdown_adcs;
286 284
287 /* i/o switches */ 285 /* i/o switches */
@@ -300,7 +298,6 @@ struct sigmatel_spec {
300 struct hda_input_mux private_dimux; 298 struct hda_input_mux private_dimux;
301 struct hda_input_mux private_imux; 299 struct hda_input_mux private_imux;
302 struct hda_input_mux private_smux; 300 struct hda_input_mux private_smux;
303 struct hda_input_mux private_amp_mux;
304 struct hda_input_mux private_mono_mux; 301 struct hda_input_mux private_mono_mux;
305}; 302};
306 303
@@ -590,34 +587,6 @@ static hda_nid_t stac9205_pin_nids[12] = {
590 0x21, 0x22, 587 0x21, 0x22,
591}; 588};
592 589
593#define stac92xx_amp_volume_info snd_hda_mixer_amp_volume_info
594
595static int stac92xx_amp_volume_get(struct snd_kcontrol *kcontrol,
596 struct snd_ctl_elem_value *ucontrol)
597{
598 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
599 struct sigmatel_spec *spec = codec->spec;
600 hda_nid_t nid = spec->amp_nids[spec->cur_amux];
601
602 kcontrol->private_value ^= get_amp_nid(kcontrol);
603 kcontrol->private_value |= nid;
604
605 return snd_hda_mixer_amp_volume_get(kcontrol, ucontrol);
606}
607
608static int stac92xx_amp_volume_put(struct snd_kcontrol *kcontrol,
609 struct snd_ctl_elem_value *ucontrol)
610{
611 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
612 struct sigmatel_spec *spec = codec->spec;
613 hda_nid_t nid = spec->amp_nids[spec->cur_amux];
614
615 kcontrol->private_value ^= get_amp_nid(kcontrol);
616 kcontrol->private_value |= nid;
617
618 return snd_hda_mixer_amp_volume_put(kcontrol, ucontrol);
619}
620
621static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol, 590static int stac92xx_dmux_enum_info(struct snd_kcontrol *kcontrol,
622 struct snd_ctl_elem_info *uinfo) 591 struct snd_ctl_elem_info *uinfo)
623{ 592{
@@ -813,41 +782,6 @@ static int stac92xx_mono_mux_enum_put(struct snd_kcontrol *kcontrol,
813 spec->mono_nid, &spec->cur_mmux); 782 spec->mono_nid, &spec->cur_mmux);
814} 783}
815 784
816static int stac92xx_amp_mux_enum_info(struct snd_kcontrol *kcontrol,
817 struct snd_ctl_elem_info *uinfo)
818{
819 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
820 struct sigmatel_spec *spec = codec->spec;
821 return snd_hda_input_mux_info(spec->amp_mux, uinfo);
822}
823
824static int stac92xx_amp_mux_enum_get(struct snd_kcontrol *kcontrol,
825 struct snd_ctl_elem_value *ucontrol)
826{
827 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
828 struct sigmatel_spec *spec = codec->spec;
829
830 ucontrol->value.enumerated.item[0] = spec->cur_amux;
831 return 0;
832}
833
834static int stac92xx_amp_mux_enum_put(struct snd_kcontrol *kcontrol,
835 struct snd_ctl_elem_value *ucontrol)
836{
837 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
838 struct sigmatel_spec *spec = codec->spec;
839 struct snd_kcontrol *ctl =
840 snd_hda_find_mixer_ctl(codec, "Amp Capture Volume");
841 if (!ctl)
842 return -EINVAL;
843
844 snd_ctl_notify(codec->bus->card, SNDRV_CTL_EVENT_MASK_VALUE |
845 SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
846
847 return snd_hda_input_mux_put(codec, spec->amp_mux, ucontrol,
848 0, &spec->cur_amux);
849}
850
851#define stac92xx_aloopback_info snd_ctl_boolean_mono_info 785#define stac92xx_aloopback_info snd_ctl_boolean_mono_info
852 786
853static int stac92xx_aloopback_get(struct snd_kcontrol *kcontrol, 787static int stac92xx_aloopback_get(struct snd_kcontrol *kcontrol,
@@ -1002,31 +936,6 @@ static struct hda_verb stac9205_core_init[] = {
1002 .put = stac92xx_mono_mux_enum_put, \ 936 .put = stac92xx_mono_mux_enum_put, \
1003 } 937 }
1004 938
1005#define STAC_AMP_MUX \
1006 { \
1007 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1008 .name = "Amp Selector Capture Switch", \
1009 .count = 1, \
1010 .info = stac92xx_amp_mux_enum_info, \
1011 .get = stac92xx_amp_mux_enum_get, \
1012 .put = stac92xx_amp_mux_enum_put, \
1013 }
1014
1015#define STAC_AMP_VOL(xname, nid, chs, idx, dir) \
1016 { \
1017 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1018 .name = xname, \
1019 .index = 0, \
1020 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
1021 SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
1022 SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \
1023 .info = stac92xx_amp_volume_info, \
1024 .get = stac92xx_amp_volume_get, \
1025 .put = stac92xx_amp_volume_put, \
1026 .tlv = { .c = snd_hda_mixer_amp_tlv }, \
1027 .private_value = HDA_COMPOSE_AMP_VAL(nid, chs, idx, dir) \
1028 }
1029
1030#define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \ 939#define STAC_ANALOG_LOOPBACK(verb_read, verb_write, cnt) \
1031 { \ 940 { \
1032 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ 941 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
@@ -2698,8 +2607,6 @@ enum {
2698 STAC_CTL_WIDGET_VOL, 2607 STAC_CTL_WIDGET_VOL,
2699 STAC_CTL_WIDGET_MUTE, 2608 STAC_CTL_WIDGET_MUTE,
2700 STAC_CTL_WIDGET_MONO_MUX, 2609 STAC_CTL_WIDGET_MONO_MUX,
2701 STAC_CTL_WIDGET_AMP_MUX,
2702 STAC_CTL_WIDGET_AMP_VOL,
2703 STAC_CTL_WIDGET_HP_SWITCH, 2610 STAC_CTL_WIDGET_HP_SWITCH,
2704 STAC_CTL_WIDGET_IO_SWITCH, 2611 STAC_CTL_WIDGET_IO_SWITCH,
2705 STAC_CTL_WIDGET_CLFE_SWITCH, 2612 STAC_CTL_WIDGET_CLFE_SWITCH,
@@ -2710,8 +2617,6 @@ static struct snd_kcontrol_new stac92xx_control_templates[] = {
2710 HDA_CODEC_VOLUME(NULL, 0, 0, 0), 2617 HDA_CODEC_VOLUME(NULL, 0, 0, 0),
2711 HDA_CODEC_MUTE(NULL, 0, 0, 0), 2618 HDA_CODEC_MUTE(NULL, 0, 0, 0),
2712 STAC_MONO_MUX, 2619 STAC_MONO_MUX,
2713 STAC_AMP_MUX,
2714 STAC_AMP_VOL(NULL, 0, 0, 0, 0),
2715 STAC_CODEC_HP_SWITCH(NULL), 2620 STAC_CODEC_HP_SWITCH(NULL),
2716 STAC_CODEC_IO_SWITCH(NULL, 0), 2621 STAC_CODEC_IO_SWITCH(NULL, 0),
2717 STAC_CODEC_CLFE_SWITCH(NULL, 0), 2622 STAC_CODEC_CLFE_SWITCH(NULL, 0),
@@ -3268,37 +3173,6 @@ static int stac92xx_auto_create_mono_output_ctls(struct hda_codec *codec)
3268 "Mono Mux", spec->mono_nid); 3173 "Mono Mux", spec->mono_nid);
3269} 3174}
3270 3175
3271/* labels for amp mux outputs */
3272static const char *stac92xx_amp_labels[3] = {
3273 "Front Microphone", "Microphone", "Line In",
3274};
3275
3276/* create amp out controls mux on capable codecs */
3277static int stac92xx_auto_create_amp_output_ctls(struct hda_codec *codec)
3278{
3279 struct sigmatel_spec *spec = codec->spec;
3280 struct hda_input_mux *amp_mux = &spec->private_amp_mux;
3281 int i, err;
3282
3283 for (i = 0; i < spec->num_amps; i++) {
3284 amp_mux->items[amp_mux->num_items].label =
3285 stac92xx_amp_labels[i];
3286 amp_mux->items[amp_mux->num_items].index = i;
3287 amp_mux->num_items++;
3288 }
3289
3290 if (spec->num_amps > 1) {
3291 err = stac92xx_add_control(spec, STAC_CTL_WIDGET_AMP_MUX,
3292 "Amp Selector Capture Switch", 0);
3293 if (err < 0)
3294 return err;
3295 }
3296 return stac92xx_add_control(spec, STAC_CTL_WIDGET_AMP_VOL,
3297 "Amp Capture Volume",
3298 HDA_COMPOSE_AMP_VAL(spec->amp_nids[0], 3, 0, HDA_INPUT));
3299}
3300
3301
3302/* create PC beep volume controls */ 3176/* create PC beep volume controls */
3303static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec, 3177static int stac92xx_auto_create_beep_ctls(struct hda_codec *codec,
3304 hda_nid_t nid) 3178 hda_nid_t nid)
@@ -3869,11 +3743,6 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3869 if (err < 0) 3743 if (err < 0)
3870 return err; 3744 return err;
3871 } 3745 }
3872 if (spec->num_amps > 0) {
3873 err = stac92xx_auto_create_amp_output_ctls(codec);
3874 if (err < 0)
3875 return err;
3876 }
3877 if (spec->num_dmics > 0 && !spec->dinput_mux) 3746 if (spec->num_dmics > 0 && !spec->dinput_mux)
3878 if ((err = stac92xx_auto_create_dmic_input_ctls(codec, 3747 if ((err = stac92xx_auto_create_dmic_input_ctls(codec,
3879 &spec->autocfg)) < 0) 3748 &spec->autocfg)) < 0)
@@ -3910,7 +3779,6 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
3910 spec->dinput_mux = &spec->private_dimux; 3779 spec->dinput_mux = &spec->private_dimux;
3911 spec->sinput_mux = &spec->private_smux; 3780 spec->sinput_mux = &spec->private_smux;
3912 spec->mono_mux = &spec->private_mono_mux; 3781 spec->mono_mux = &spec->private_mono_mux;
3913 spec->amp_mux = &spec->private_amp_mux;
3914 return 1; 3782 return 1;
3915} 3783}
3916 3784