diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-11 11:05:04 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-12 01:45:02 -0400 |
commit | 30b4503378c976cf66201a1e81820519f6bd79ac (patch) | |
tree | 49ab8e40a825cd0acf2591d1fb9edc35dd5ee410 | |
parent | 9e7717c9eb9da8dba98f36dd3c390a45375499b3 (diff) |
ALSA: hda - Expose secret DAC-AA connection of some VIA codecs
VT1718S and co have a secret connection from DAC to AA-mix, which
doesn't appear in the connection list obtained from the h/w.
Currently the driver fixes the connection index locally at init, but
now we can expose it statically via snd_hda_override_connections()
so that this conection can be checked better by the parser in future.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_via.c | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 77df2bedfb81..5232abc341f8 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -132,7 +132,6 @@ struct via_spec { | |||
132 | hda_nid_t hp_dac_nid; | 132 | hda_nid_t hp_dac_nid; |
133 | bool hp_indep_shared; /* indep HP-DAC is shared with side ch */ | 133 | bool hp_indep_shared; /* indep HP-DAC is shared with side ch */ |
134 | int num_active_streams; | 134 | int num_active_streams; |
135 | int dac_mixer_idx; | ||
136 | 135 | ||
137 | struct nid_path out_path[HDA_SIDE + 1]; | 136 | struct nid_path out_path[HDA_SIDE + 1]; |
138 | struct nid_path hp_path; | 137 | struct nid_path hp_path; |
@@ -1881,8 +1880,6 @@ static int via_auto_create_multi_out_ctls(struct hda_codec *codec) | |||
1881 | 1880 | ||
1882 | idx = get_connection_index(codec, spec->aa_mix_nid, | 1881 | idx = get_connection_index(codec, spec->aa_mix_nid, |
1883 | spec->multiout.dac_nids[0]); | 1882 | spec->multiout.dac_nids[0]); |
1884 | if (idx < 0 && spec->dac_mixer_idx) | ||
1885 | idx = spec->dac_mixer_idx; | ||
1886 | if (idx >= 0) { | 1883 | if (idx >= 0) { |
1887 | /* add control to mixer */ | 1884 | /* add control to mixer */ |
1888 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, | 1885 | err = via_add_control(spec, VIA_CTL_WIDGET_VOL, |
@@ -3028,6 +3025,41 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec) | |||
3028 | } | 3025 | } |
3029 | } | 3026 | } |
3030 | 3027 | ||
3028 | /* Add a connection to the primary DAC from AA-mixer for some codecs | ||
3029 | * This isn't listed from the raw info, but the chip has a secret connection. | ||
3030 | */ | ||
3031 | static int add_secret_dac_path(struct hda_codec *codec) | ||
3032 | { | ||
3033 | struct via_spec *spec = codec->spec; | ||
3034 | int i, nums; | ||
3035 | hda_nid_t conn[8]; | ||
3036 | hda_nid_t nid; | ||
3037 | |||
3038 | if (!spec->aa_mix_nid) | ||
3039 | return 0; | ||
3040 | nums = snd_hda_get_connections(codec, spec->aa_mix_nid, conn, | ||
3041 | ARRAY_SIZE(conn) - 1); | ||
3042 | for (i = 0; i < nums; i++) { | ||
3043 | if (get_wcaps_type(get_wcaps(codec, conn[i])) == AC_WID_AUD_OUT) | ||
3044 | return 0; | ||
3045 | } | ||
3046 | |||
3047 | /* find the primary DAC and add to the connection list */ | ||
3048 | nid = codec->start_nid; | ||
3049 | for (i = 0; i < codec->num_nodes; i++, nid++) { | ||
3050 | unsigned int caps = get_wcaps(codec, nid); | ||
3051 | if (get_wcaps_type(caps) == AC_WID_AUD_OUT && | ||
3052 | !(caps & AC_WCAP_DIGITAL)) { | ||
3053 | conn[nums++] = nid; | ||
3054 | return snd_hda_override_conn_list(codec, | ||
3055 | spec->aa_mix_nid, | ||
3056 | nums, conn); | ||
3057 | } | ||
3058 | } | ||
3059 | return 0; | ||
3060 | } | ||
3061 | |||
3062 | |||
3031 | static int patch_vt1718S(struct hda_codec *codec) | 3063 | static int patch_vt1718S(struct hda_codec *codec) |
3032 | { | 3064 | { |
3033 | struct via_spec *spec; | 3065 | struct via_spec *spec; |
@@ -3041,7 +3073,7 @@ static int patch_vt1718S(struct hda_codec *codec) | |||
3041 | spec->aa_mix_nid = 0x21; | 3073 | spec->aa_mix_nid = 0x21; |
3042 | override_mic_boost(codec, 0x2b, 0, 3, 40); | 3074 | override_mic_boost(codec, 0x2b, 0, 3, 40); |
3043 | override_mic_boost(codec, 0x29, 0, 3, 40); | 3075 | override_mic_boost(codec, 0x29, 0, 3, 40); |
3044 | spec->dac_mixer_idx = 5; | 3076 | add_secret_dac_path(codec); |
3045 | 3077 | ||
3046 | /* automatic parse from the BIOS config */ | 3078 | /* automatic parse from the BIOS config */ |
3047 | err = via_parse_auto_config(codec); | 3079 | err = via_parse_auto_config(codec); |
@@ -3402,9 +3434,9 @@ static int patch_vt2002P(struct hda_codec *codec) | |||
3402 | return -ENOMEM; | 3434 | return -ENOMEM; |
3403 | 3435 | ||
3404 | spec->aa_mix_nid = 0x21; | 3436 | spec->aa_mix_nid = 0x21; |
3405 | spec->dac_mixer_idx = 3; | ||
3406 | override_mic_boost(codec, 0x2b, 0, 3, 40); | 3437 | override_mic_boost(codec, 0x2b, 0, 3, 40); |
3407 | override_mic_boost(codec, 0x29, 0, 3, 40); | 3438 | override_mic_boost(codec, 0x29, 0, 3, 40); |
3439 | add_secret_dac_path(codec); | ||
3408 | 3440 | ||
3409 | /* automatic parse from the BIOS config */ | 3441 | /* automatic parse from the BIOS config */ |
3410 | err = via_parse_auto_config(codec); | 3442 | err = via_parse_auto_config(codec); |
@@ -3540,7 +3572,7 @@ static int patch_vt1812(struct hda_codec *codec) | |||
3540 | spec->aa_mix_nid = 0x21; | 3572 | spec->aa_mix_nid = 0x21; |
3541 | override_mic_boost(codec, 0x2b, 0, 3, 40); | 3573 | override_mic_boost(codec, 0x2b, 0, 3, 40); |
3542 | override_mic_boost(codec, 0x29, 0, 3, 40); | 3574 | override_mic_boost(codec, 0x29, 0, 3, 40); |
3543 | spec->dac_mixer_idx = 5; | 3575 | add_secret_dac_path(codec); |
3544 | 3576 | ||
3545 | /* automatic parse from the BIOS config */ | 3577 | /* automatic parse from the BIOS config */ |
3546 | err = via_parse_auto_config(codec); | 3578 | err = via_parse_auto_config(codec); |