diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 10bbbaf6ebc3..f7ff3f7ccb8e 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1276,6 +1276,7 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1276 | spec->multiout.no_share_stream = 1; | 1276 | spec->multiout.no_share_stream = 1; |
1277 | 1277 | ||
1278 | codec->no_trigger_sense = 1; | 1278 | codec->no_trigger_sense = 1; |
1279 | codec->no_sticky_stream = 1; | ||
1279 | 1280 | ||
1280 | return 0; | 1281 | return 0; |
1281 | } | 1282 | } |
@@ -1463,6 +1464,7 @@ static int patch_ad1983(struct hda_codec *codec) | |||
1463 | codec->patch_ops = ad198x_patch_ops; | 1464 | codec->patch_ops = ad198x_patch_ops; |
1464 | 1465 | ||
1465 | codec->no_trigger_sense = 1; | 1466 | codec->no_trigger_sense = 1; |
1467 | codec->no_sticky_stream = 1; | ||
1466 | 1468 | ||
1467 | return 0; | 1469 | return 0; |
1468 | } | 1470 | } |
@@ -1917,6 +1919,7 @@ static int patch_ad1981(struct hda_codec *codec) | |||
1917 | } | 1919 | } |
1918 | 1920 | ||
1919 | codec->no_trigger_sense = 1; | 1921 | codec->no_trigger_sense = 1; |
1922 | codec->no_sticky_stream = 1; | ||
1920 | 1923 | ||
1921 | return 0; | 1924 | return 0; |
1922 | } | 1925 | } |
@@ -2880,7 +2883,7 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, | |||
2880 | 2883 | ||
2881 | /* create input playback/capture controls for the given pin */ | 2884 | /* create input playback/capture controls for the given pin */ |
2882 | static int new_analog_input(struct ad198x_spec *spec, hda_nid_t pin, | 2885 | static int new_analog_input(struct ad198x_spec *spec, hda_nid_t pin, |
2883 | const char *ctlname, int boost) | 2886 | const char *ctlname, int ctlidx, int boost) |
2884 | { | 2887 | { |
2885 | char name[32]; | 2888 | char name[32]; |
2886 | int err, idx; | 2889 | int err, idx; |
@@ -2909,25 +2912,27 @@ static int new_analog_input(struct ad198x_spec *spec, hda_nid_t pin, | |||
2909 | } | 2912 | } |
2910 | 2913 | ||
2911 | /* create playback/capture controls for input pins */ | 2914 | /* create playback/capture controls for input pins */ |
2912 | static int ad1988_auto_create_analog_input_ctls(struct ad198x_spec *spec, | 2915 | static int ad1988_auto_create_analog_input_ctls(struct hda_codec *codec, |
2913 | const struct auto_pin_cfg *cfg) | 2916 | const struct auto_pin_cfg *cfg) |
2914 | { | 2917 | { |
2918 | struct ad198x_spec *spec = codec->spec; | ||
2915 | struct hda_input_mux *imux = &spec->private_imux; | 2919 | struct hda_input_mux *imux = &spec->private_imux; |
2916 | int i, err; | 2920 | int i, err, type, type_idx; |
2917 | 2921 | ||
2918 | for (i = 0; i < AUTO_PIN_LAST; i++) { | 2922 | for (i = 0; i < cfg->num_inputs; i++) { |
2919 | err = new_analog_input(spec, cfg->input_pins[i], | 2923 | const char *label; |
2920 | auto_pin_cfg_labels[i], | 2924 | type = cfg->inputs[i].type; |
2921 | i <= AUTO_PIN_FRONT_MIC); | 2925 | label = hda_get_autocfg_input_label(codec, cfg, i); |
2926 | snd_hda_add_imux_item(imux, label, | ||
2927 | ad1988_pin_to_adc_idx(cfg->inputs[i].pin), | ||
2928 | &type_idx); | ||
2929 | err = new_analog_input(spec, cfg->inputs[i].pin, | ||
2930 | label, type_idx, | ||
2931 | type == AUTO_PIN_MIC); | ||
2922 | if (err < 0) | 2932 | if (err < 0) |
2923 | return err; | 2933 | return err; |
2924 | imux->items[imux->num_items].label = auto_pin_cfg_labels[i]; | ||
2925 | imux->items[imux->num_items].index = ad1988_pin_to_adc_idx(cfg->input_pins[i]); | ||
2926 | imux->num_items++; | ||
2927 | } | 2934 | } |
2928 | imux->items[imux->num_items].label = "Mix"; | 2935 | snd_hda_add_imux_item(imux, "Mix", 9, NULL); |
2929 | imux->items[imux->num_items].index = 9; | ||
2930 | imux->num_items++; | ||
2931 | 2936 | ||
2932 | if ((err = add_control(spec, AD_CTL_WIDGET_VOL, | 2937 | if ((err = add_control(spec, AD_CTL_WIDGET_VOL, |
2933 | "Analog Mix Playback Volume", | 2938 | "Analog Mix Playback Volume", |
@@ -2994,12 +2999,11 @@ static void ad1988_auto_init_extra_out(struct hda_codec *codec) | |||
2994 | static void ad1988_auto_init_analog_input(struct hda_codec *codec) | 2999 | static void ad1988_auto_init_analog_input(struct hda_codec *codec) |
2995 | { | 3000 | { |
2996 | struct ad198x_spec *spec = codec->spec; | 3001 | struct ad198x_spec *spec = codec->spec; |
3002 | const struct auto_pin_cfg *cfg = &spec->autocfg; | ||
2997 | int i, idx; | 3003 | int i, idx; |
2998 | 3004 | ||
2999 | for (i = 0; i < AUTO_PIN_LAST; i++) { | 3005 | for (i = 0; i < cfg->num_inputs; i++) { |
3000 | hda_nid_t nid = spec->autocfg.input_pins[i]; | 3006 | hda_nid_t nid = cfg->inputs[i].pin; |
3001 | if (! nid) | ||
3002 | continue; | ||
3003 | switch (nid) { | 3007 | switch (nid) { |
3004 | case 0x15: /* port-C */ | 3008 | case 0x15: /* port-C */ |
3005 | snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0); | 3009 | snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0); |
@@ -3009,7 +3013,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) | |||
3009 | break; | 3013 | break; |
3010 | } | 3014 | } |
3011 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 3015 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
3012 | i <= AUTO_PIN_FRONT_MIC ? PIN_VREF80 : PIN_IN); | 3016 | i == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); |
3013 | if (nid != AD1988_PIN_CD_NID) | 3017 | if (nid != AD1988_PIN_CD_NID) |
3014 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 3018 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
3015 | AMP_OUT_MUTE); | 3019 | AMP_OUT_MUTE); |
@@ -3040,7 +3044,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec) | |||
3040 | "Speaker")) < 0 || | 3044 | "Speaker")) < 0 || |
3041 | (err = ad1988_auto_create_extra_out(codec, spec->autocfg.hp_pins[0], | 3045 | (err = ad1988_auto_create_extra_out(codec, spec->autocfg.hp_pins[0], |
3042 | "Headphone")) < 0 || | 3046 | "Headphone")) < 0 || |
3043 | (err = ad1988_auto_create_analog_input_ctls(spec, &spec->autocfg)) < 0) | 3047 | (err = ad1988_auto_create_analog_input_ctls(codec, &spec->autocfg)) < 0) |
3044 | return err; | 3048 | return err; |
3045 | 3049 | ||
3046 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; | 3050 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
@@ -3235,6 +3239,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3235 | spec->vmaster_nid = 0x04; | 3239 | spec->vmaster_nid = 0x04; |
3236 | 3240 | ||
3237 | codec->no_trigger_sense = 1; | 3241 | codec->no_trigger_sense = 1; |
3242 | codec->no_sticky_stream = 1; | ||
3238 | 3243 | ||
3239 | return 0; | 3244 | return 0; |
3240 | } | 3245 | } |
@@ -3449,6 +3454,7 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3449 | codec->patch_ops = ad198x_patch_ops; | 3454 | codec->patch_ops = ad198x_patch_ops; |
3450 | 3455 | ||
3451 | codec->no_trigger_sense = 1; | 3456 | codec->no_trigger_sense = 1; |
3457 | codec->no_sticky_stream = 1; | ||
3452 | 3458 | ||
3453 | return 0; | 3459 | return 0; |
3454 | } | 3460 | } |
@@ -4422,6 +4428,7 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
4422 | } | 4428 | } |
4423 | 4429 | ||
4424 | codec->no_trigger_sense = 1; | 4430 | codec->no_trigger_sense = 1; |
4431 | codec->no_sticky_stream = 1; | ||
4425 | 4432 | ||
4426 | return 0; | 4433 | return 0; |
4427 | } | 4434 | } |
@@ -4761,6 +4768,7 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4761 | } | 4768 | } |
4762 | 4769 | ||
4763 | codec->no_trigger_sense = 1; | 4770 | codec->no_trigger_sense = 1; |
4771 | codec->no_sticky_stream = 1; | ||
4764 | 4772 | ||
4765 | return 0; | 4773 | return 0; |
4766 | } | 4774 | } |