Lines Matching full:spec

33  * @spec: hda_gen_spec object to initialize
37 int snd_hda_gen_spec_init(struct hda_gen_spec *spec) in snd_hda_gen_spec_init() argument
39 snd_array_init(&spec->kctls, sizeof(struct snd_kcontrol_new), 32); in snd_hda_gen_spec_init()
40 snd_array_init(&spec->paths, sizeof(struct nid_path), 8); in snd_hda_gen_spec_init()
41 snd_array_init(&spec->loopback_list, sizeof(struct hda_amp_list), 8); in snd_hda_gen_spec_init()
42 mutex_init(&spec->pcm_mutex); in snd_hda_gen_spec_init()
49 * @spec: hda_gen_spec object
55 * name string @name to the list in @spec.
59 snd_hda_gen_add_kctl(struct hda_gen_spec *spec, const char *name, in snd_hda_gen_add_kctl() argument
62 struct snd_kcontrol_new *knew = snd_array_new(&spec->kctls); in snd_hda_gen_add_kctl()
76 static void free_kctls(struct hda_gen_spec *spec) in free_kctls() argument
78 if (spec->kctls.list) { in free_kctls()
79 struct snd_kcontrol_new *kctl = spec->kctls.list; in free_kctls()
81 for (i = 0; i < spec->kctls.used; i++) in free_kctls()
84 snd_array_free(&spec->kctls); in free_kctls()
87 static void snd_hda_gen_spec_free(struct hda_gen_spec *spec) in snd_hda_gen_spec_free() argument
89 if (!spec) in snd_hda_gen_spec_free()
91 free_kctls(spec); in snd_hda_gen_spec_free()
92 snd_array_free(&spec->paths); in snd_hda_gen_spec_free()
93 snd_array_free(&spec->loopback_list); in snd_hda_gen_spec_free()
101 struct hda_gen_spec *spec = codec->spec; in parse_user_hints() local
137 spec->suppress_auto_mute = !val; in parse_user_hints()
140 spec->suppress_auto_mic = !val; in parse_user_hints()
143 spec->line_in_auto_switch = !!val; in parse_user_hints()
146 spec->auto_mute_via_amp = !!val; in parse_user_hints()
149 spec->need_dac_fix = !!val; in parse_user_hints()
152 spec->no_primary_hp = !val; in parse_user_hints()
155 spec->no_multi_io = !val; in parse_user_hints()
158 spec->multi_cap_vol = !!val; in parse_user_hints()
161 spec->inv_dmic_split = !!val; in parse_user_hints()
164 spec->indep_hp = !!val; in parse_user_hints()
167 spec->add_stereo_mix_input = !!val; in parse_user_hints()
171 spec->add_jack_modes = !!val; in parse_user_hints()
174 spec->add_jack_modes = !!val; in parse_user_hints()
177 spec->add_jack_modes = !!val; in parse_user_hints()
180 spec->power_down_unused = !!val; in parse_user_hints()
183 spec->hp_mic = !!val; in parse_user_hints()
186 spec->suppress_hp_mic_detect = !val; in parse_user_hints()
189 spec->suppress_vmaster = !val; in parse_user_hints()
192 spec->mixer_nid = val; in parse_user_hints()
254 struct hda_gen_spec *spec = codec->spec; in get_nid_path() local
258 snd_array_for_each(&spec->paths, i, path) { in get_nid_path()
283 struct hda_gen_spec *spec = codec->spec; in snd_hda_get_path_idx() local
284 struct nid_path *array = spec->paths.list; in snd_hda_get_path_idx()
287 if (!spec->paths.used) in snd_hda_get_path_idx()
290 if (idx < 0 || idx >= spec->paths.used) in snd_hda_get_path_idx()
304 struct hda_gen_spec *spec = codec->spec; in snd_hda_get_path_from_idx() local
306 if (idx <= 0 || idx > spec->paths.used) in snd_hda_get_path_from_idx()
308 return snd_array_elem(&spec->paths, idx - 1); in snd_hda_get_path_from_idx()
315 struct hda_gen_spec *spec = codec->spec; in is_dac_already_used() local
319 snd_array_for_each(&spec->paths, i, path) { in is_dac_already_used()
341 struct hda_gen_spec *spec = codec->spec; in is_ctl_used() local
346 snd_array_for_each(&spec->paths, i, path) { in is_ctl_used()
474 struct hda_gen_spec *spec = codec->spec; in snd_hda_add_new_path() local
485 path = snd_array_new(&spec->paths); in snd_hda_add_new_path()
492 spec->paths.used--; in snd_hda_add_new_path()
509 struct hda_gen_spec *spec = codec->spec; in get_preferred_dac() local
510 const hda_nid_t *list = spec->preferred_dacs; in get_preferred_dac()
524 struct hda_gen_spec *spec = codec->spec; in look_for_dac() local
528 for (i = 0; i < spec->num_all_dacs; i++) { in look_for_dac()
529 hda_nid_t nid = spec->all_dacs[i]; in look_for_dac()
578 struct hda_gen_spec *spec = codec->spec; in look_for_out_vol_nid() local
583 if ((spec->out_vol_mask >> nid) & 1) in look_for_out_vol_nid()
627 struct hda_gen_spec *spec = codec->spec; in is_active_nid() local
635 snd_array_for_each(&spec->paths, n, path) { in is_active_nid()
779 struct hda_gen_spec *spec = codec->spec; in activate_amp_in() local
804 if (conn[n] != spec->mixer_merge_nid) in activate_amp_in()
876 struct hda_gen_spec *spec = codec->spec; in snd_hda_activate_path() local
882 if (enable && (spec->power_down_unused || codec->power_save_node)) in snd_hda_activate_path()
903 struct hda_gen_spec *spec = codec->spec; in path_power_down_sync() local
905 if (!(spec->power_down_unused || codec->power_save_node) || path->active) in path_power_down_sync()
913 struct hda_gen_spec *spec = codec->spec; in set_pin_eapd() local
914 if (spec->own_eapd_ctl || in set_pin_eapd()
917 if (spec->keep_eapd_on && !enable) in set_pin_eapd()
973 add_control(struct hda_gen_spec *spec, int type, const char *name, in add_control() argument
978 knew = snd_hda_gen_add_kctl(spec, name, &control_templates[type]); in add_control()
988 static int add_control_with_pfx(struct hda_gen_spec *spec, int type, in add_control_with_pfx() argument
994 if (!add_control(spec, type, name, cidx, val)) in add_control_with_pfx()
999 #define add_pb_vol_ctrl(spec, type, pfx, val) \ argument
1000 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", 0, val)
1001 #define add_pb_sw_ctrl(spec, type, pfx, val) \ argument
1002 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", 0, val)
1003 #define __add_pb_vol_ctrl(spec, type, pfx, cidx, val) \ argument
1004 add_control_with_pfx(spec, type, pfx, "Playback", "Volume", cidx, val)
1005 #define __add_pb_sw_ctrl(spec, type, pfx, cidx, val) \ argument
1006 add_control_with_pfx(spec, type, pfx, "Playback", "Switch", cidx, val)
1018 return __add_pb_vol_ctrl(codec->spec, HDA_CTL_WIDGET_VOL, pfx, cidx, val); in add_vol_ctl()
1064 return __add_pb_sw_ctrl(codec->spec, type, pfx, cidx, val); in add_sw_ctl()
1079 struct hda_gen_spec *spec = codec->spec; in sync_auto_mute_bits() local
1081 if (spec->auto_mute_via_amp) { in sync_auto_mute_bits()
1083 bool enabled = !((spec->mute_bits >> nid) & 1); in sync_auto_mute_bits()
1158 struct hda_gen_spec *spec = codec->spec; in get_line_out_pfx() local
1159 struct auto_pin_cfg *cfg = &spec->autocfg; in get_line_out_pfx()
1162 if (cfg->line_outs == 1 && !spec->multi_ios && in get_line_out_pfx()
1165 return spec->vmaster_mute.hook ? "PCM" : "Master"; in get_line_out_pfx()
1170 if (spec->multiout.num_dacs == 1 && !spec->mixer_nid && in get_line_out_pfx()
1172 !spec->multiout.hp_out_nid[0] && !spec->multiout.extra_out_nid[0]) in get_line_out_pfx()
1173 return spec->vmaster_mute.hook ? "PCM" : "Master"; in get_line_out_pfx()
1185 !path_has_mixer(codec, spec->hp_paths[0], ctl_type)) in get_line_out_pfx()
1197 !path_has_mixer(codec, spec->speaker_paths[0], ctl_type)) in get_line_out_pfx()
1200 if (ch && spec->multi_ios) in get_line_out_pfx()
1208 bool hp_lo_shared = !path_has_mixer(codec, spec->hp_paths[0], ctl_type); in get_line_out_pfx()
1209 bool spk_lo_shared = !path_has_mixer(codec, spec->speaker_paths[0], ctl_type); in get_line_out_pfx()
1211 return spec->vmaster_mute.hook ? "PCM" : "Master"; in get_line_out_pfx()
1220 if (cfg->line_outs == 1 && !spec->multi_ios) in get_line_out_pfx()
1268 struct hda_gen_spec *spec = codec->spec; in assign_out_path_ctls() local
1283 if (spec->dac_min_mute) in assign_out_path_ctls()
1331 struct hda_gen_spec *spec = codec->spec; in get_primary_out() local
1332 struct auto_pin_cfg *cfg = &spec->autocfg; in get_primary_out()
1335 return spec->private_dac_nids[idx]; in get_primary_out()
1337 if (spec->multi_ios > idx) in get_primary_out()
1338 return spec->multi_io[idx].dac; in get_primary_out()
1355 struct hda_gen_spec *spec = codec->spec; in try_assign_dacs() local
1367 if (!spec->obey_preferred_dacs) { in try_assign_dacs()
1379 } else if (spec->obey_preferred_dacs) { in try_assign_dacs()
1412 } else if (is_reachable_path(codec, spec->private_dac_nids[0], pin)) { in try_assign_dacs()
1413 dac = spec->private_dac_nids[0]; in try_assign_dacs()
1422 path = snd_hda_add_new_path(codec, dac, pin, -spec->mixer_nid); in try_assign_dacs()
1423 if (!path && !i && spec->mixer_nid) { in try_assign_dacs()
1444 struct hda_gen_spec *spec = codec->spec; in get_dac_if_single() local
1448 for (i = 0; i < spec->num_all_dacs; i++) { in get_dac_if_single()
1449 hda_nid_t nid = spec->all_dacs[i]; in get_dac_if_single()
1481 struct hda_gen_spec *spec = codec->spec; in count_multiio_pins() local
1482 struct auto_pin_cfg *cfg = &spec->autocfg; in count_multiio_pins()
1512 struct hda_gen_spec *spec = codec->spec; in fill_multi_ios() local
1513 struct auto_pin_cfg *cfg = &spec->autocfg; in fill_multi_ios()
1520 old_pins = spec->multi_ios; in fill_multi_ios()
1537 for (j = 0; j < spec->multi_ios; j++) { in fill_multi_ios()
1538 if (nid == spec->multi_io[j].pin) in fill_multi_ios()
1541 if (j < spec->multi_ios) in fill_multi_ios()
1553 -spec->mixer_nid); in fill_multi_ios()
1559 spec->multi_io[spec->multi_ios].pin = nid; in fill_multi_ios()
1560 spec->multi_io[spec->multi_ios].dac = dac; in fill_multi_ios()
1561 spec->out_paths[cfg->line_outs + spec->multi_ios] = in fill_multi_ios()
1563 spec->multi_ios++; in fill_multi_ios()
1564 if (spec->multi_ios >= 2) in fill_multi_ios()
1571 if (old_pins == spec->multi_ios) { in fill_multi_ios()
1577 if (!hardwired && spec->multi_ios < 2) { in fill_multi_ios()
1579 spec->paths.used -= spec->multi_ios - old_pins; in fill_multi_ios()
1580 spec->multi_ios = old_pins; in fill_multi_ios()
1585 for (i = old_pins; i < spec->multi_ios; i++) { in fill_multi_ios()
1586 path = snd_hda_get_path_from_idx(codec, spec->out_paths[cfg->line_outs + i]); in fill_multi_ios()
1597 struct hda_gen_spec *spec = codec->spec; in map_singles() local
1609 -spec->mixer_nid); in map_singles()
1610 if (!path && !i && spec->mixer_nid) in map_singles()
1623 static inline bool has_aamix_out_paths(struct hda_gen_spec *spec) in has_aamix_out_paths() argument
1625 return spec->aamix_out_paths[0] || spec->aamix_out_paths[1] || in has_aamix_out_paths()
1626 spec->aamix_out_paths[2]; in has_aamix_out_paths()
1632 struct hda_gen_spec *spec = codec->spec; in check_aamix_out_path() local
1638 is_nid_contained(path, spec->mixer_nid)) in check_aamix_out_path()
1641 dac = spec->private_dac_nids[0]; in check_aamix_out_path()
1643 path = snd_hda_add_new_path(codec, dac, pin, spec->mixer_nid); in check_aamix_out_path()
1647 else if (spec->multiout.hp_out_nid[0]) in check_aamix_out_path()
1648 dac = spec->multiout.hp_out_nid[0]; in check_aamix_out_path()
1649 else if (spec->multiout.extra_out_nid[0]) in check_aamix_out_path()
1650 dac = spec->multiout.extra_out_nid[0]; in check_aamix_out_path()
1655 spec->mixer_nid); in check_aamix_out_path()
1668 struct hda_gen_spec *spec = codec->spec; in indep_hp_possible() local
1669 struct auto_pin_cfg *cfg = &spec->autocfg; in indep_hp_possible()
1674 idx = spec->out_paths[0]; in indep_hp_possible()
1676 idx = spec->hp_paths[0]; in indep_hp_possible()
1682 if (!spec->mixer_nid || !is_nid_contained(path, spec->mixer_nid)) in indep_hp_possible()
1687 if (spec->out_paths[i] == idx) in indep_hp_possible()
1689 path = snd_hda_get_path_from_idx(codec, spec->out_paths[i]); in indep_hp_possible()
1690 if (path && is_nid_contained(path, spec->mixer_nid)) in indep_hp_possible()
1694 path = snd_hda_get_path_from_idx(codec, spec->speaker_paths[i]); in indep_hp_possible()
1695 if (path && is_nid_contained(path, spec->mixer_nid)) in indep_hp_possible()
1726 struct hda_gen_spec *spec = codec->spec; in fill_and_eval_dacs() local
1727 struct auto_pin_cfg *cfg = &spec->autocfg; in fill_and_eval_dacs()
1731 spec->multiout.num_dacs = cfg->line_outs; in fill_and_eval_dacs()
1732 spec->multiout.dac_nids = spec->private_dac_nids; in fill_and_eval_dacs()
1733 memset(spec->private_dac_nids, 0, sizeof(spec->private_dac_nids)); in fill_and_eval_dacs()
1734 memset(spec->multiout.hp_out_nid, 0, sizeof(spec->multiout.hp_out_nid)); in fill_and_eval_dacs()
1735 memset(spec->multiout.extra_out_nid, 0, sizeof(spec->multiout.extra_out_nid)); in fill_and_eval_dacs()
1736 spec->multi_ios = 0; in fill_and_eval_dacs()
1737 snd_array_free(&spec->paths); in fill_and_eval_dacs()
1740 memset(spec->out_paths, 0, sizeof(spec->out_paths)); in fill_and_eval_dacs()
1741 memset(spec->hp_paths, 0, sizeof(spec->hp_paths)); in fill_and_eval_dacs()
1742 memset(spec->speaker_paths, 0, sizeof(spec->speaker_paths)); in fill_and_eval_dacs()
1743 memset(spec->aamix_out_paths, 0, sizeof(spec->aamix_out_paths)); in fill_and_eval_dacs()
1744 memset(spec->digout_paths, 0, sizeof(spec->digout_paths)); in fill_and_eval_dacs()
1745 memset(spec->input_paths, 0, sizeof(spec->input_paths)); in fill_and_eval_dacs()
1746 memset(spec->loopback_paths, 0, sizeof(spec->loopback_paths)); in fill_and_eval_dacs()
1747 memset(&spec->digin_path, 0, sizeof(spec->digin_path)); in fill_and_eval_dacs()
1757 spec->private_dac_nids, in fill_and_eval_dacs()
1758 spec->out_paths); in fill_and_eval_dacs()
1761 spec->multiout.hp_out_nid, in fill_and_eval_dacs()
1762 spec->hp_paths); in fill_and_eval_dacs()
1765 spec->multiout.extra_out_nid, in fill_and_eval_dacs()
1766 spec->speaker_paths); in fill_and_eval_dacs()
1767 if (!spec->no_multi_io && in fill_and_eval_dacs()
1778 spec->private_dac_nids, spec->out_paths, in fill_and_eval_dacs()
1779 spec->main_out_badness); in fill_and_eval_dacs()
1781 if (!spec->no_multi_io && fill_mio_first && in fill_and_eval_dacs()
1792 spec->multiout.hp_out_nid, in fill_and_eval_dacs()
1793 spec->hp_paths, in fill_and_eval_dacs()
1794 spec->extra_out_badness); in fill_and_eval_dacs()
1802 spec->multiout.extra_out_nid, in fill_and_eval_dacs()
1803 spec->speaker_paths, in fill_and_eval_dacs()
1804 spec->extra_out_badness); in fill_and_eval_dacs()
1809 if (!spec->no_multi_io && in fill_and_eval_dacs()
1817 if (spec->mixer_nid) { in fill_and_eval_dacs()
1818 spec->aamix_out_paths[0] = in fill_and_eval_dacs()
1819 check_aamix_out_path(codec, spec->out_paths[0]); in fill_and_eval_dacs()
1821 spec->aamix_out_paths[1] = in fill_and_eval_dacs()
1822 check_aamix_out_path(codec, spec->hp_paths[0]); in fill_and_eval_dacs()
1824 spec->aamix_out_paths[2] = in fill_and_eval_dacs()
1825 check_aamix_out_path(codec, spec->speaker_paths[0]); in fill_and_eval_dacs()
1828 if (!spec->no_multi_io && in fill_and_eval_dacs()
1831 spec->multi_ios = 1; /* give badness */ in fill_and_eval_dacs()
1834 spec->multiout.num_dacs = 0; in fill_and_eval_dacs()
1836 if (spec->private_dac_nids[i]) in fill_and_eval_dacs()
1837 spec->multiout.num_dacs++; in fill_and_eval_dacs()
1839 memmove(spec->private_dac_nids + i, in fill_and_eval_dacs()
1840 spec->private_dac_nids + i + 1, in fill_and_eval_dacs()
1842 spec->private_dac_nids[cfg->line_outs - 1] = 0; in fill_and_eval_dacs()
1846 spec->ext_channel_count = spec->min_channel_count = in fill_and_eval_dacs()
1847 spec->multiout.num_dacs * 2; in fill_and_eval_dacs()
1849 if (spec->multi_ios == 2) { in fill_and_eval_dacs()
1851 spec->private_dac_nids[spec->multiout.num_dacs++] = in fill_and_eval_dacs()
1852 spec->multi_io[i].dac; in fill_and_eval_dacs()
1853 } else if (spec->multi_ios) { in fill_and_eval_dacs()
1854 spec->multi_ios = 0; in fill_and_eval_dacs()
1858 if (spec->indep_hp && !indep_hp_possible(codec)) in fill_and_eval_dacs()
1864 spec->multiout.hp_out_nid, in fill_and_eval_dacs()
1865 spec->hp_paths); in fill_and_eval_dacs()
1868 spec->multiout.extra_out_nid, in fill_and_eval_dacs()
1869 spec->speaker_paths); in fill_and_eval_dacs()
1898 struct hda_gen_spec *spec = codec->spec; in debug_show_configs() local
1905 spec->multiout.dac_nids[0], in debug_show_configs()
1906 spec->multiout.dac_nids[1], in debug_show_configs()
1907 spec->multiout.dac_nids[2], in debug_show_configs()
1908 spec->multiout.dac_nids[3], in debug_show_configs()
1911 print_nid_path_idx(codec, " out", spec->out_paths[i]); in debug_show_configs()
1912 if (spec->multi_ios > 0) in debug_show_configs()
1914 spec->multi_ios, in debug_show_configs()
1915 spec->multi_io[0].pin, spec->multi_io[1].pin, in debug_show_configs()
1916 spec->multi_io[0].dac, spec->multi_io[1].dac); in debug_show_configs()
1917 for (i = 0; i < spec->multi_ios; i++) in debug_show_configs()
1919 spec->out_paths[cfg->line_outs + i]); in debug_show_configs()
1924 spec->multiout.hp_out_nid[0], in debug_show_configs()
1925 spec->multiout.hp_out_nid[1], in debug_show_configs()
1926 spec->multiout.hp_out_nid[2], in debug_show_configs()
1927 spec->multiout.hp_out_nid[3]); in debug_show_configs()
1929 print_nid_path_idx(codec, " hp ", spec->hp_paths[i]); in debug_show_configs()
1934 spec->multiout.extra_out_nid[0], in debug_show_configs()
1935 spec->multiout.extra_out_nid[1], in debug_show_configs()
1936 spec->multiout.extra_out_nid[2], in debug_show_configs()
1937 spec->multiout.extra_out_nid[3]); in debug_show_configs()
1939 print_nid_path_idx(codec, " spk", spec->speaker_paths[i]); in debug_show_configs()
1941 print_nid_path_idx(codec, " mix", spec->aamix_out_paths[i]); in debug_show_configs()
1950 struct hda_gen_spec *spec = codec->spec; in fill_all_dac_nids() local
1953 spec->num_all_dacs = 0; in fill_all_dac_nids()
1954 memset(spec->all_dacs, 0, sizeof(spec->all_dacs)); in fill_all_dac_nids()
1958 if (spec->num_all_dacs >= ARRAY_SIZE(spec->all_dacs)) { in fill_all_dac_nids()
1962 spec->all_dacs[spec->num_all_dacs++] = nid; in fill_all_dac_nids()
1968 struct hda_gen_spec *spec = codec->spec; in parse_output_paths() local
1969 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_output_paths()
2053 path = snd_hda_get_path_from_idx(codec, spec->out_paths[0]); in parse_output_paths()
2055 spec->vmaster_nid = look_for_out_vol_nid(codec, path); in parse_output_paths()
2056 if (spec->vmaster_nid) { in parse_output_paths()
2057 snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid, in parse_output_paths()
2058 HDA_OUTPUT, spec->vmaster_tlv); in parse_output_paths()
2059 if (spec->dac_min_mute) in parse_output_paths()
2060 spec->vmaster_tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] |= TLV_DB_SCALE_MUTE; in parse_output_paths()
2065 if (spec->prefer_hp_amp || cfg->line_out_type == AUTO_PIN_HP_OUT) in parse_output_paths()
2073 val = spec->prefer_hp_amp ? PIN_HP : PIN_OUT; in parse_output_paths()
2079 if (spec->indep_hp && !indep_hp_possible(codec)) in parse_output_paths()
2080 spec->indep_hp = 0; in parse_output_paths()
2090 struct hda_gen_spec *spec = codec->spec; in create_multi_out_ctls() local
2094 if (spec->multi_ios > 0 && cfg->line_outs < 3) in create_multi_out_ctls()
2095 noutputs += spec->multi_ios; in create_multi_out_ctls()
2102 path = snd_hda_get_path_from_idx(codec, spec->out_paths[i]); in create_multi_out_ctls()
2186 struct hda_gen_spec *spec = codec->spec; in create_hp_out_ctls() local
2187 return create_extra_outs(codec, spec->autocfg.hp_outs, in create_hp_out_ctls()
2188 spec->hp_paths, in create_hp_out_ctls()
2194 struct hda_gen_spec *spec = codec->spec; in create_speaker_out_ctls() local
2195 return create_extra_outs(codec, spec->autocfg.speaker_outs, in create_speaker_out_ctls()
2196 spec->speaker_paths, in create_speaker_out_ctls()
2216 struct hda_gen_spec *spec = codec->spec; in indep_hp_get() local
2217 ucontrol->value.enumerated.item[0] = spec->indep_hp_enabled; in indep_hp_get()
2229 struct hda_gen_spec *spec = codec->spec; in indep_hp_put() local
2233 mutex_lock(&spec->pcm_mutex); in indep_hp_put()
2234 if (spec->active_streams) { in indep_hp_put()
2239 if (spec->indep_hp_enabled != select) { in indep_hp_put()
2241 if (spec->autocfg.line_out_type == AUTO_PIN_HP_OUT) in indep_hp_put()
2242 dacp = &spec->private_dac_nids[0]; in indep_hp_put()
2244 dacp = &spec->multiout.hp_out_nid[0]; in indep_hp_put()
2247 if (spec->have_aamix_ctl) { in indep_hp_put()
2248 if (spec->autocfg.line_out_type == AUTO_PIN_HP_OUT) in indep_hp_put()
2249 update_aamix_paths(codec, spec->aamix_mode, in indep_hp_put()
2250 spec->out_paths[0], in indep_hp_put()
2251 spec->aamix_out_paths[0], in indep_hp_put()
2252 spec->autocfg.line_out_type); in indep_hp_put()
2254 update_aamix_paths(codec, spec->aamix_mode, in indep_hp_put()
2255 spec->hp_paths[0], in indep_hp_put()
2256 spec->aamix_out_paths[1], in indep_hp_put()
2260 spec->indep_hp_enabled = select; in indep_hp_put()
2261 if (spec->indep_hp_enabled) in indep_hp_put()
2264 *dacp = spec->alt_dac_nid; in indep_hp_put()
2270 mutex_unlock(&spec->pcm_mutex); in indep_hp_put()
2285 struct hda_gen_spec *spec = codec->spec; in create_indep_hp_ctls() local
2288 if (!spec->indep_hp) in create_indep_hp_ctls()
2290 if (spec->autocfg.line_out_type == AUTO_PIN_HP_OUT) in create_indep_hp_ctls()
2291 dac = spec->multiout.dac_nids[0]; in create_indep_hp_ctls()
2293 dac = spec->multiout.hp_out_nid[0]; in create_indep_hp_ctls()
2295 spec->indep_hp = 0; in create_indep_hp_ctls()
2299 spec->indep_hp_enabled = false; in create_indep_hp_ctls()
2300 spec->alt_dac_nid = dac; in create_indep_hp_ctls()
2301 if (!snd_hda_gen_add_kctl(spec, NULL, &indep_hp_ctl)) in create_indep_hp_ctls()
2314 struct hda_gen_spec *spec = codec->spec; in ch_mode_info() local
2319 uinfo->value.enumerated.items = spec->multi_ios + 1; in ch_mode_info()
2320 if (uinfo->value.enumerated.item > spec->multi_ios) in ch_mode_info()
2321 uinfo->value.enumerated.item = spec->multi_ios; in ch_mode_info()
2322 chs = uinfo->value.enumerated.item * 2 + spec->min_channel_count; in ch_mode_info()
2331 struct hda_gen_spec *spec = codec->spec; in ch_mode_get() local
2333 (spec->ext_channel_count - spec->min_channel_count) / 2; in ch_mode_get()
2340 struct hda_gen_spec *spec = codec->spec; in get_multiio_path() local
2342 spec->out_paths[spec->autocfg.line_outs + idx]); in get_multiio_path()
2350 static bool aamix_default(struct hda_gen_spec *spec) in aamix_default() argument
2352 return !spec->have_aamix_ctl || spec->aamix_mode; in aamix_default()
2357 struct hda_gen_spec *spec = codec->spec; in set_multi_io() local
2358 hda_nid_t nid = spec->multi_io[idx].pin; in set_multi_io()
2370 snd_hda_activate_path(codec, path, true, aamix_default(spec)); in set_multi_io()
2374 snd_hda_activate_path(codec, path, false, aamix_default(spec)); in set_multi_io()
2375 set_pin_target(codec, nid, spec->multi_io[idx].ctl_in, true); in set_multi_io()
2389 struct hda_gen_spec *spec = codec->spec; in ch_mode_put() local
2393 if (ch < 0 || ch > spec->multi_ios) in ch_mode_put()
2395 if (ch == (spec->ext_channel_count - spec->min_channel_count) / 2) in ch_mode_put()
2397 spec->ext_channel_count = ch * 2 + spec->min_channel_count; in ch_mode_put()
2398 for (i = 0; i < spec->multi_ios; i++) in ch_mode_put()
2400 spec->multiout.max_channels = max(spec->ext_channel_count, in ch_mode_put()
2401 spec->const_channel_count); in ch_mode_put()
2402 if (spec->need_dac_fix) in ch_mode_put()
2403 spec->multiout.num_dacs = spec->multiout.max_channels / 2; in ch_mode_put()
2417 struct hda_gen_spec *spec = codec->spec; in create_multi_channel_mode() local
2419 if (spec->multi_ios > 0) { in create_multi_channel_mode()
2420 if (!snd_hda_gen_add_kctl(spec, NULL, &channel_mode_enum)) in create_multi_channel_mode()
2436 struct hda_gen_spec *spec = codec->spec; in loopback_mixing_get() local
2437 ucontrol->value.enumerated.item[0] = spec->aamix_mode; in loopback_mixing_get()
2445 struct hda_gen_spec *spec = codec->spec; in update_aamix_paths() local
2456 if (out_type == AUTO_PIN_HP_OUT && spec->indep_hp_enabled && in update_aamix_paths()
2457 mix_path->path[0] != spec->alt_dac_nid) in update_aamix_paths()
2475 struct hda_gen_spec *spec = codec->spec; in update_output_paths() local
2483 spec->aamix_mode); in update_output_paths()
2491 struct hda_gen_spec *spec = codec->spec; in loopback_mixing_put() local
2492 const struct auto_pin_cfg *cfg = &spec->autocfg; in loopback_mixing_put()
2495 if (val == spec->aamix_mode) in loopback_mixing_put()
2497 spec->aamix_mode = val; in loopback_mixing_put()
2498 if (has_aamix_out_paths(spec)) { in loopback_mixing_put()
2499 update_aamix_paths(codec, val, spec->out_paths[0], in loopback_mixing_put()
2500 spec->aamix_out_paths[0], in loopback_mixing_put()
2502 update_aamix_paths(codec, val, spec->hp_paths[0], in loopback_mixing_put()
2503 spec->aamix_out_paths[1], in loopback_mixing_put()
2505 update_aamix_paths(codec, val, spec->speaker_paths[0], in loopback_mixing_put()
2506 spec->aamix_out_paths[2], in loopback_mixing_put()
2509 update_output_paths(codec, cfg->line_outs, spec->out_paths); in loopback_mixing_put()
2511 update_output_paths(codec, cfg->hp_outs, spec->hp_paths); in loopback_mixing_put()
2514 spec->speaker_paths); in loopback_mixing_put()
2529 struct hda_gen_spec *spec = codec->spec; in create_loopback_mixing_ctl() local
2531 if (!spec->mixer_nid) in create_loopback_mixing_ctl()
2533 if (!snd_hda_gen_add_kctl(spec, NULL, &loopback_mixing_enum)) in create_loopback_mixing_ctl()
2535 spec->have_aamix_ctl = 1; in create_loopback_mixing_ctl()
2548 struct hda_gen_spec *spec = codec->spec; in update_hp_mic() local
2553 pin = spec->hp_mic_pin; in update_hp_mic()
2554 as_mic = spec->cur_mux[adc_mux] == spec->hp_mic_mux_idx; in update_hp_mic()
2571 if (val == AC_PINCTL_VREF_HIZ && spec->shared_mic_vref_pin) { in update_hp_mic()
2572 const hda_nid_t vref_pin = spec->shared_mic_vref_pin; in update_hp_mic()
2579 if (!spec->hp_mic_jack_modes) { in update_hp_mic()
2592 struct hda_gen_spec *spec = codec->spec; in create_hp_mic() local
2593 struct auto_pin_cfg *cfg = &spec->autocfg; in create_hp_mic()
2597 if (!spec->hp_mic) { in create_hp_mic()
2598 if (spec->suppress_hp_mic_detect) in create_hp_mic()
2612 spec->hp_mic = 0; /* clear once */ in create_hp_mic()
2631 spec->hp_mic = 1; in create_hp_mic()
2632 spec->hp_mic_pin = nid; in create_hp_mic()
2634 spec->suppress_auto_mic = 1; in create_hp_mic()
2690 struct hda_gen_spec *spec = codec->spec; in find_kctl_name() local
2694 snd_array_for_each(&spec->kctls, i, kctl) { in find_kctl_name()
2704 struct hda_gen_spec *spec = codec->spec; in get_jack_mode_name() local
2707 snd_hda_get_pin_label(codec, pin, &spec->autocfg, name, name_len, &idx); in get_jack_mode_name()
2716 struct hda_gen_spec *spec = codec->spec; in get_out_jack_num_items() local
2717 if (spec->add_jack_modes) { in get_out_jack_num_items()
2728 struct hda_gen_spec *spec = codec->spec; in create_out_jack_modes() local
2733 if (pin == spec->hp_mic_pin) in create_out_jack_modes()
2739 knew = snd_hda_gen_add_kctl(spec, name, in create_out_jack_modes()
2858 struct hda_gen_spec *spec = codec->spec; in get_in_jack_num_items() local
2860 if (spec->add_jack_modes) in get_in_jack_num_items()
2867 struct hda_gen_spec *spec = codec->spec; in create_in_jack_mode() local
2872 if (pin == spec->hp_mic_pin) in create_in_jack_mode()
2885 knew = snd_hda_gen_add_kctl(spec, name, &in_jack_mode_enum); in create_in_jack_mode()
3004 struct hda_gen_spec *spec = codec->spec; in create_hp_mic_jack_mode() local
3007 knew = snd_hda_gen_add_kctl(spec, "Headphone Mic Jack Mode", in create_hp_mic_jack_mode()
3012 spec->hp_mic_jack_modes = 1; in create_hp_mic_jack_mode()
3021 static int add_loopback_list(struct hda_gen_spec *spec, hda_nid_t mix, int idx) in add_loopback_list() argument
3025 list = snd_array_new(&spec->loopback_list); in add_loopback_list()
3031 spec->loopback.amplist = spec->loopback_list.list; in add_loopback_list()
3078 struct hda_gen_spec *spec = codec->spec; in new_analog_input() local
3090 spec->loopback_paths[input_idx] = snd_hda_get_path_idx(codec, path); in new_analog_input()
3094 err = __add_pb_vol_ctrl(spec, HDA_CTL_WIDGET_VOL, ctlname, ctlidx, mix_val); in new_analog_input()
3101 err = __add_pb_sw_ctrl(spec, HDA_CTL_WIDGET_MUTE, ctlname, ctlidx, mute_val); in new_analog_input()
3109 err = add_loopback_list(spec, mix_nid, idx); in new_analog_input()
3113 if (spec->mixer_nid != spec->mixer_merge_nid && in new_analog_input()
3114 !spec->loopback_merge_path) { in new_analog_input()
3115 path = snd_hda_add_new_path(codec, spec->mixer_nid, in new_analog_input()
3116 spec->mixer_merge_nid, 0); in new_analog_input()
3122 spec->loopback_merge_path = in new_analog_input()
3139 struct hda_gen_spec *spec = codec->spec; in fill_adc_nids() local
3141 hda_nid_t *adc_nids = spec->adc_nids; in fill_adc_nids()
3142 int max_nums = ARRAY_SIZE(spec->adc_nids); in fill_adc_nids()
3155 spec->num_adc_nids = nums; in fill_adc_nids()
3158 spec->num_all_adcs = nums; in fill_adc_nids()
3159 memcpy(spec->all_adcs, spec->adc_nids, nums * sizeof(hda_nid_t)); in fill_adc_nids()
3169 struct hda_gen_spec *spec = codec->spec; in check_dyn_adc_switch() local
3170 struct hda_input_mux *imux = &spec->input_mux; in check_dyn_adc_switch()
3176 for (n = 0; n < spec->num_adc_nids; n++) { in check_dyn_adc_switch()
3178 if (!spec->input_paths[i][n]) in check_dyn_adc_switch()
3190 for (n = 0; n < spec->num_adc_nids; n++) { in check_dyn_adc_switch()
3191 if (spec->input_paths[i][n]) { in check_dyn_adc_switch()
3192 spec->dyn_adc_idx[i] = n; in check_dyn_adc_switch()
3199 spec->dyn_adc_switch = 1; in check_dyn_adc_switch()
3200 } else if (nums != spec->num_adc_nids) { in check_dyn_adc_switch()
3203 for (n = 0; n < spec->num_adc_nids; n++) { in check_dyn_adc_switch()
3207 spec->adc_nids[nums] = spec->adc_nids[n]; in check_dyn_adc_switch()
3210 spec->input_paths[i][nums]); in check_dyn_adc_switch()
3211 spec->input_paths[i][nums] = in check_dyn_adc_switch()
3212 spec->input_paths[i][n]; in check_dyn_adc_switch()
3213 spec->input_paths[i][n] = 0; in check_dyn_adc_switch()
3218 spec->num_adc_nids = nums; in check_dyn_adc_switch()
3222 (imux->num_items == 2 && spec->hp_mic)) { in check_dyn_adc_switch()
3224 spec->num_adc_nids = 1; /* reduce to a single ADC */ in check_dyn_adc_switch()
3228 if (!spec->dyn_adc_switch && spec->multi_cap_vol) in check_dyn_adc_switch()
3229 spec->num_adc_nids = 1; in check_dyn_adc_switch()
3239 struct hda_gen_spec *spec = codec->spec; in parse_capture_source() local
3240 struct hda_input_mux *imux = &spec->input_mux; in parse_capture_source()
3247 hda_nid_t adc = spec->adc_nids[c]; in parse_capture_source()
3255 spec->input_paths[imux_idx][c] = in parse_capture_source()
3259 if (spec->hp_mic_pin == pin) in parse_capture_source()
3260 spec->hp_mic_mux_idx = imux->num_items; in parse_capture_source()
3261 spec->imux_pins[imux->num_items] = pin; in parse_capture_source()
3264 if (spec->dyn_adc_switch) in parse_capture_source()
3265 spec->dyn_adc_idx[imux_idx] = c; in parse_capture_source()
3279 struct hda_gen_spec *spec = codec->spec; in fill_input_pin_labels() local
3280 const struct auto_pin_cfg *cfg = &spec->autocfg; in fill_input_pin_labels()
3294 if (spec->input_labels[j] && in fill_input_pin_labels()
3295 !strcmp(spec->input_labels[j], label)) { in fill_input_pin_labels()
3296 idx = spec->input_label_idxs[j] + 1; in fill_input_pin_labels()
3301 spec->input_labels[i] = label; in fill_input_pin_labels()
3302 spec->input_label_idxs[i] = idx; in fill_input_pin_labels()
3312 struct hda_gen_spec *spec = codec->spec; in create_input_ctls() local
3313 const struct auto_pin_cfg *cfg = &spec->autocfg; in create_input_ctls()
3314 hda_nid_t mixer = spec->mixer_nid; in create_input_ctls()
3337 if (pin != spec->hp_mic_pin && in create_input_ctls()
3344 spec->input_labels[i], in create_input_ctls()
3345 spec->input_label_idxs[i], in create_input_ctls()
3353 spec->input_labels[i], -mixer); in create_input_ctls()
3357 if (spec->add_jack_modes) { in create_input_ctls()
3365 if (mixer && spec->add_stereo_mix_input == HDA_HINT_STEREO_MIX_ENABLE) { in create_input_ctls()
3371 spec->suppress_auto_mic = 1; in create_input_ctls()
3385 struct hda_gen_spec *spec = codec->spec; in get_input_path() local
3390 if (spec->dyn_adc_switch) in get_input_path()
3391 adc_idx = spec->dyn_adc_idx[imux_idx]; in get_input_path()
3396 return snd_hda_get_path_from_idx(codec, spec->input_paths[imux_idx][adc_idx]); in get_input_path()
3406 struct hda_gen_spec *spec = codec->spec; in mux_enum_info() local
3407 return snd_hda_input_mux_info(&spec->input_mux, uinfo); in mux_enum_info()
3414 struct hda_gen_spec *spec = codec->spec; in mux_enum_get() local
3418 ucontrol->value.enumerated.item[0] = spec->cur_mux[adc_idx]; in mux_enum_get()
3452 struct hda_gen_spec *spec = codec->spec; in cap_put_caller() local
3457 imux = &spec->input_mux; in cap_put_caller()
3470 if (err >= 0 && spec->cap_sync_hook) in cap_put_caller()
3471 spec->cap_sync_hook(codec, kcontrol, ucontrol); in cap_put_caller()
3561 struct hda_gen_spec *spec = codec->spec; in is_inv_dmic_pin() local
3562 struct auto_pin_cfg *cfg = &spec->autocfg; in is_inv_dmic_pin()
3566 if (!spec->inv_dmic_split) in is_inv_dmic_pin()
3584 struct hda_gen_spec *spec = codec->spec; in cap_single_sw_put() local
3591 if (spec->cap_sync_hook) in cap_single_sw_put()
3592 spec->cap_sync_hook(codec, kcontrol, ucontrol); in cap_single_sw_put()
3601 struct hda_gen_spec *spec = codec->spec; in add_single_cap_ctl() local
3617 knew = add_control(spec, type, tmpname, idx, in add_single_cap_ctl()
3633 knew = add_control(spec, type, tmpname, idx, in add_single_cap_ctl()
3661 struct hda_gen_spec *spec = codec->spec; in create_bind_cap_vol_ctl() local
3665 knew = snd_hda_gen_add_kctl(spec, NULL, &cap_vol_temp); in create_bind_cap_vol_ctl()
3673 knew = snd_hda_gen_add_kctl(spec, NULL, &cap_sw_temp); in create_bind_cap_vol_ctl()
3707 struct hda_gen_spec *spec = codec->spec; in create_multi_cap_vol_ctl() local
3708 struct hda_input_mux *imux = &spec->input_mux; in create_multi_cap_vol_ctl()
3716 if (idx >= spec->autocfg.num_inputs) in create_multi_cap_vol_ctl()
3718 inv_dmic = is_inv_dmic_pin(codec, spec->imux_pins[i]); in create_multi_cap_vol_ctl()
3722 spec->input_labels[idx], in create_multi_cap_vol_ctl()
3723 spec->input_label_idxs[idx], in create_multi_cap_vol_ctl()
3736 struct hda_gen_spec *spec = codec->spec; in create_capture_mixers() local
3737 struct hda_input_mux *imux = &spec->input_mux; in create_capture_mixers()
3740 if (spec->dyn_adc_switch) in create_capture_mixers()
3743 nums = spec->num_adc_nids; in create_capture_mixers()
3745 if (!spec->auto_mic && imux->num_items > 1) { in create_capture_mixers()
3749 knew = snd_hda_gen_add_kctl(spec, name, &cap_src_temp); in create_capture_mixers()
3757 bool multi_cap_vol = spec->multi_cap_vol; in create_capture_mixers()
3784 if (is_inv_dmic_pin(codec, spec->imux_pins[i])) in create_capture_mixers()
3852 struct hda_gen_spec *spec = codec->spec; in parse_mic_boost() local
3853 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_mic_boost()
3854 struct hda_input_mux *imux = &spec->input_mux; in parse_mic_boost()
3857 if (!spec->num_adc_nids) in parse_mic_boost()
3884 "%s Boost Volume", spec->input_labels[idx]); in parse_mic_boost()
3885 if (!add_control(spec, HDA_CTL_WIDGET_VOL, boost_label, in parse_mic_boost()
3886 spec->input_label_idxs[idx], val)) in parse_mic_boost()
3934 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_add_mute_led_cdev() local
3945 if (spec->vmaster_mute.hook) in snd_hda_gen_add_mute_led_cdev()
3948 spec->vmaster_mute.hook = vmaster_update_mute_led; in snd_hda_gen_add_mute_led_cdev()
3949 spec->vmaster_mute_enum = 1; in snd_hda_gen_add_mute_led_cdev()
3966 struct hda_gen_spec *spec = codec->spec; in call_micmute_led_update() local
3969 switch (spec->micmute_led.led_mode) { in call_micmute_led_update()
3977 val = !!spec->micmute_led.capture; in call_micmute_led_update()
3981 val = !spec->micmute_led.capture; in call_micmute_led_update()
3985 if (val == spec->micmute_led.led_value) in call_micmute_led_update()
3987 spec->micmute_led.led_value = val; in call_micmute_led_update()
3989 spec->micmute_led.led_value ? LED_ON : LED_OFF); in call_micmute_led_update()
3996 struct hda_gen_spec *spec = codec->spec; in update_micmute_led() local
3999 if (spec->micmute_led.old_hook) in update_micmute_led()
4000 spec->micmute_led.old_hook(codec, kcontrol, ucontrol); in update_micmute_led()
4009 spec->micmute_led.capture |= mask; in update_micmute_led()
4011 spec->micmute_led.capture &= ~mask; in update_micmute_led()
4030 struct hda_gen_spec *spec = codec->spec; in micmute_led_mode_get() local
4032 ucontrol->value.enumerated.item[0] = spec->micmute_led.led_mode; in micmute_led_mode_get()
4040 struct hda_gen_spec *spec = codec->spec; in micmute_led_mode_put() local
4046 if (mode == spec->micmute_led.led_mode) in micmute_led_mode_put()
4048 spec->micmute_led.led_mode = mode; in micmute_led_mode_put()
4064 struct hda_gen_spec *spec = codec->spec; in add_micmute_led_hook() local
4066 spec->micmute_led.led_mode = MICMUTE_LED_FOLLOW_MUTE; in add_micmute_led_hook()
4067 spec->micmute_led.capture = 0; in add_micmute_led_hook()
4068 spec->micmute_led.led_value = 0; in add_micmute_led_hook()
4069 spec->micmute_led.old_hook = spec->cap_sync_hook; in add_micmute_led_hook()
4070 spec->cap_sync_hook = update_micmute_led; in add_micmute_led_hook()
4071 if (!snd_hda_gen_add_kctl(spec, NULL, &micmute_led_mode_ctl)) in add_micmute_led_hook()
4114 struct hda_gen_spec *spec = codec->spec; in parse_digital() local
4121 for (i = 0; i < spec->autocfg.dig_outs; i++) { in parse_digital()
4122 pin = spec->autocfg.dig_out_pins[i]; in parse_digital()
4132 spec->digout_paths[i] = snd_hda_get_path_idx(codec, path); in parse_digital()
4135 spec->multiout.dig_out_nid = dig_nid; in parse_digital()
4136 spec->dig_out_type = spec->autocfg.dig_out_type[0]; in parse_digital()
4138 spec->multiout.follower_dig_outs = spec->follower_dig_outs; in parse_digital()
4139 if (nums >= ARRAY_SIZE(spec->follower_dig_outs) - 1) in parse_digital()
4141 spec->follower_dig_outs[nums - 1] = dig_nid; in parse_digital()
4146 if (spec->autocfg.dig_in_pin) { in parse_digital()
4147 pin = spec->autocfg.dig_in_pin; in parse_digital()
4159 spec->dig_in_nid = dig_nid; in parse_digital()
4160 spec->digin_path = snd_hda_get_path_idx(codec, path); in parse_digital()
4179 struct hda_gen_spec *spec = codec->spec; in mux_select() local
4183 imux = &spec->input_mux; in mux_select()
4189 if (spec->cur_mux[adc_idx] == idx) in mux_select()
4192 old_path = get_input_path(codec, adc_idx, spec->cur_mux[adc_idx]); in mux_select()
4198 spec->cur_mux[adc_idx] = idx; in mux_select()
4200 if (spec->hp_mic) in mux_select()
4203 if (spec->dyn_adc_switch) in mux_select()
4212 if (spec->cap_sync_hook) in mux_select()
4213 spec->cap_sync_hook(codec, NULL, NULL); in mux_select()
4226 struct hda_gen_spec *spec = codec->spec; in set_path_power() local
4231 snd_array_for_each(&spec->paths, n, path) { in set_path_power()
4327 struct hda_gen_spec *spec = codec->spec; in add_all_pin_power_ctls() local
4328 struct auto_pin_cfg *cfg = &spec->autocfg; in add_all_pin_power_ctls()
4356 struct hda_gen_spec *spec = codec->spec; in sync_all_pin_power_ctls() local
4357 struct auto_pin_cfg *cfg = &spec->autocfg; in sync_all_pin_power_ctls()
4375 struct hda_gen_spec *spec = codec->spec; in add_fake_paths() local
4384 path = snd_array_new(&spec->paths); in add_fake_paths()
4399 struct hda_gen_spec *spec = codec->spec; in add_fake_beep_paths() local
4400 struct auto_pin_cfg *cfg = &spec->autocfg; in add_fake_beep_paths()
4401 hda_nid_t nid = spec->beep_nid; in add_fake_beep_paths()
4436 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_fix_pin_power() local
4439 path = snd_array_new(&spec->paths); in snd_hda_gen_fix_pin_power()
4479 struct hda_gen_spec *spec = codec->spec; in do_automute() local
4492 if (spec->auto_mute_via_amp) { in do_automute()
4503 spec->mute_bits |= (1ULL << mute_nid); in do_automute()
4505 spec->mute_bits &= ~(1ULL << mute_nid); in do_automute()
4511 if (spec->keep_vref_in_automute) in do_automute()
4543 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_update_outputs() local
4551 if (spec->autocfg.line_out_type == AUTO_PIN_HP_OUT) in snd_hda_gen_update_outputs()
4552 paths = spec->out_paths; in snd_hda_gen_update_outputs()
4554 paths = spec->hp_paths; in snd_hda_gen_update_outputs()
4555 do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins), in snd_hda_gen_update_outputs()
4556 spec->autocfg.hp_pins, paths, spec->master_mute); in snd_hda_gen_update_outputs()
4558 if (!spec->automute_speaker) in snd_hda_gen_update_outputs()
4561 on = spec->hp_jack_present | spec->line_jack_present; in snd_hda_gen_update_outputs()
4562 on |= spec->master_mute; in snd_hda_gen_update_outputs()
4563 spec->speaker_muted = on; in snd_hda_gen_update_outputs()
4564 if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) in snd_hda_gen_update_outputs()
4565 paths = spec->out_paths; in snd_hda_gen_update_outputs()
4567 paths = spec->speaker_paths; in snd_hda_gen_update_outputs()
4568 do_automute(codec, ARRAY_SIZE(spec->autocfg.speaker_pins), in snd_hda_gen_update_outputs()
4569 spec->autocfg.speaker_pins, paths, on); in snd_hda_gen_update_outputs()
4573 if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0] || in snd_hda_gen_update_outputs()
4574 spec->autocfg.line_out_pins[0] == spec->autocfg.speaker_pins[0]) in snd_hda_gen_update_outputs()
4576 if (!spec->automute_lo) in snd_hda_gen_update_outputs()
4579 on = spec->hp_jack_present; in snd_hda_gen_update_outputs()
4580 on |= spec->master_mute; in snd_hda_gen_update_outputs()
4581 spec->line_out_muted = on; in snd_hda_gen_update_outputs()
4582 paths = spec->out_paths; in snd_hda_gen_update_outputs()
4583 do_automute(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), in snd_hda_gen_update_outputs()
4584 spec->autocfg.line_out_pins, paths, on); in snd_hda_gen_update_outputs()
4590 struct hda_gen_spec *spec = codec->spec; in call_update_outputs() local
4591 if (spec->automute_hook) in call_update_outputs()
4592 spec->automute_hook(codec); in call_update_outputs()
4597 if (spec->auto_mute_via_amp && !codec->bus->shutdown) in call_update_outputs()
4598 snd_ctl_sync_vmaster(spec->vmaster_mute.sw_kctl, false); in call_update_outputs()
4609 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_hp_automute() local
4610 hda_nid_t *pins = spec->autocfg.hp_pins; in snd_hda_gen_hp_automute()
4611 int num_pins = ARRAY_SIZE(spec->autocfg.hp_pins); in snd_hda_gen_hp_automute()
4614 if (spec->indep_hp_enabled) { in snd_hda_gen_hp_automute()
4619 spec->hp_jack_present = detect_jacks(codec, num_pins, pins); in snd_hda_gen_hp_automute()
4620 if (!spec->detect_hp || (!spec->automute_speaker && !spec->automute_lo)) in snd_hda_gen_hp_automute()
4634 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_line_automute() local
4636 if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) in snd_hda_gen_line_automute()
4639 if (spec->autocfg.line_out_pins[0] == spec->autocfg.hp_pins[0]) in snd_hda_gen_line_automute()
4642 spec->line_jack_present = in snd_hda_gen_line_automute()
4643 detect_jacks(codec, ARRAY_SIZE(spec->autocfg.line_out_pins), in snd_hda_gen_line_automute()
4644 spec->autocfg.line_out_pins); in snd_hda_gen_line_automute()
4645 if (!spec->automute_speaker || !spec->detect_lo) in snd_hda_gen_line_automute()
4659 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_mic_autoswitch() local
4662 if (!spec->auto_mic) in snd_hda_gen_mic_autoswitch()
4665 for (i = spec->am_num_entries - 1; i > 0; i--) { in snd_hda_gen_mic_autoswitch()
4666 hda_nid_t pin = spec->am_entry[i].pin; in snd_hda_gen_mic_autoswitch()
4671 mux_select(codec, 0, spec->am_entry[i].idx); in snd_hda_gen_mic_autoswitch()
4675 mux_select(codec, 0, spec->am_entry[0].idx); in snd_hda_gen_mic_autoswitch()
4683 struct hda_gen_spec *spec = codec->spec; in call_hp_automute() local
4684 if (spec->hp_automute_hook) in call_hp_automute()
4685 spec->hp_automute_hook(codec, jack); in call_hp_automute()
4693 struct hda_gen_spec *spec = codec->spec; in call_line_automute() local
4694 if (spec->line_automute_hook) in call_line_automute()
4695 spec->line_automute_hook(codec, jack); in call_line_automute()
4703 struct hda_gen_spec *spec = codec->spec; in call_mic_autoswitch() local
4704 if (spec->mic_autoswitch_hook) in call_mic_autoswitch()
4705 spec->mic_autoswitch_hook(codec, jack); in call_mic_autoswitch()
4725 struct hda_gen_spec *spec = codec->spec; in automute_mode_info() local
4730 if (spec->automute_speaker_possible && spec->automute_lo_possible) in automute_mode_info()
4739 struct hda_gen_spec *spec = codec->spec; in automute_mode_get() local
4741 if (spec->automute_speaker) in automute_mode_get()
4743 if (spec->automute_lo) in automute_mode_get()
4754 struct hda_gen_spec *spec = codec->spec; in automute_mode_put() local
4758 if (!spec->automute_speaker && !spec->automute_lo) in automute_mode_put()
4760 spec->automute_speaker = 0; in automute_mode_put()
4761 spec->automute_lo = 0; in automute_mode_put()
4764 if (spec->automute_speaker_possible) { in automute_mode_put()
4765 if (!spec->automute_lo && spec->automute_speaker) in automute_mode_put()
4767 spec->automute_speaker = 1; in automute_mode_put()
4768 spec->automute_lo = 0; in automute_mode_put()
4769 } else if (spec->automute_lo_possible) { in automute_mode_put()
4770 if (spec->automute_lo) in automute_mode_put()
4772 spec->automute_lo = 1; in automute_mode_put()
4777 if (!spec->automute_lo_possible || !spec->automute_speaker_possible) in automute_mode_put()
4779 if (spec->automute_speaker && spec->automute_lo) in automute_mode_put()
4781 spec->automute_speaker = 1; in automute_mode_put()
4782 spec->automute_lo = 1; in automute_mode_put()
4801 struct hda_gen_spec *spec = codec->spec; in add_automute_mode_enum() local
4803 if (!snd_hda_gen_add_kctl(spec, NULL, &automute_mode_enum)) in add_automute_mode_enum()
4814 struct hda_gen_spec *spec = codec->spec; in check_auto_mute_availability() local
4815 struct auto_pin_cfg *cfg = &spec->autocfg; in check_auto_mute_availability()
4819 if (spec->suppress_auto_mute) in check_auto_mute_availability()
4852 spec->detect_hp = 1; in check_auto_mute_availability()
4864 spec->detect_lo = 1; in check_auto_mute_availability()
4866 spec->automute_lo_possible = spec->detect_hp; in check_auto_mute_availability()
4869 spec->automute_speaker_possible = cfg->speaker_outs && in check_auto_mute_availability()
4870 (spec->detect_hp || spec->detect_lo); in check_auto_mute_availability()
4872 spec->automute_lo = spec->automute_lo_possible; in check_auto_mute_availability()
4873 spec->automute_speaker = spec->automute_speaker_possible; in check_auto_mute_availability()
4875 if (spec->automute_speaker_possible || spec->automute_lo_possible) { in check_auto_mute_availability()
4887 struct hda_gen_spec *spec = codec->spec; in auto_mic_check_imux() local
4891 imux = &spec->input_mux; in auto_mic_check_imux()
4892 for (i = 0; i < spec->am_num_entries; i++) { in auto_mic_check_imux()
4893 spec->am_entry[i].idx = in auto_mic_check_imux()
4894 find_idx_in_nid_list(spec->am_entry[i].pin, in auto_mic_check_imux()
4895 spec->imux_pins, imux->num_items); in auto_mic_check_imux()
4896 if (spec->am_entry[i].idx < 0) in auto_mic_check_imux()
4901 for (i = 1; i < spec->am_num_entries; i++) in auto_mic_check_imux()
4903 spec->am_entry[i].pin, in auto_mic_check_imux()
4921 struct hda_gen_spec *spec = codec->spec; in check_auto_mic_availability() local
4922 struct auto_pin_cfg *cfg = &spec->autocfg; in check_auto_mic_availability()
4926 if (spec->suppress_auto_mic) in check_auto_mic_availability()
4948 if (!spec->line_in_auto_switch && in check_auto_mic_availability()
4958 spec->am_entry[num_pins].pin = nid; in check_auto_mic_availability()
4959 spec->am_entry[num_pins].attr = attr; in check_auto_mic_availability()
4966 spec->am_num_entries = num_pins; in check_auto_mic_availability()
4970 sort(spec->am_entry, num_pins, sizeof(spec->am_entry[0]), in check_auto_mic_availability()
4976 spec->auto_mic = 1; in check_auto_mic_availability()
4977 spec->num_adc_nids = 1; in check_auto_mic_availability()
4978 spec->cur_mux[0] = spec->am_entry[0].idx; in check_auto_mic_availability()
4980 spec->am_entry[0].pin, in check_auto_mic_availability()
4981 spec->am_entry[1].pin, in check_auto_mic_availability()
4982 spec->am_entry[2].pin); in check_auto_mic_availability()
4998 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_path_power_filter() local
5000 if (!spec->power_down_unused && !codec->power_save_node) in snd_hda_gen_path_power_filter()
5058 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_parse_auto_config() local
5063 if (spec->mixer_nid && !spec->mixer_merge_nid) in snd_hda_gen_parse_auto_config()
5064 spec->mixer_merge_nid = spec->mixer_nid; in snd_hda_gen_parse_auto_config()
5066 if (cfg != &spec->autocfg) { in snd_hda_gen_parse_auto_config()
5067 spec->autocfg = *cfg; in snd_hda_gen_parse_auto_config()
5068 cfg = &spec->autocfg; in snd_hda_gen_parse_auto_config()
5071 if (!spec->main_out_badness) in snd_hda_gen_parse_auto_config()
5072 spec->main_out_badness = &hda_main_out_badness; in snd_hda_gen_parse_auto_config()
5073 if (!spec->extra_out_badness) in snd_hda_gen_parse_auto_config()
5074 spec->extra_out_badness = &hda_extra_out_badness; in snd_hda_gen_parse_auto_config()
5080 spec->multiout.max_channels = 2; in snd_hda_gen_parse_auto_config()
5081 spec->no_analog = 1; in snd_hda_gen_parse_auto_config()
5088 if (!spec->no_primary_hp && in snd_hda_gen_parse_auto_config()
5133 spec->const_channel_count = spec->ext_channel_count; in snd_hda_gen_parse_auto_config()
5136 spec->const_channel_count = max(spec->const_channel_count, in snd_hda_gen_parse_auto_config()
5139 spec->const_channel_count = max(spec->const_channel_count, in snd_hda_gen_parse_auto_config()
5141 spec->multiout.max_channels = max(spec->ext_channel_count, in snd_hda_gen_parse_auto_config()
5142 spec->const_channel_count); in snd_hda_gen_parse_auto_config()
5157 if (!spec->auto_mic && spec->mixer_nid && in snd_hda_gen_parse_auto_config()
5158 spec->add_stereo_mix_input == HDA_HINT_STEREO_MIX_AUTO && in snd_hda_gen_parse_auto_config()
5159 spec->input_mux.num_items > 1) { in snd_hda_gen_parse_auto_config()
5160 err = parse_capture_source(codec, spec->mixer_nid, in snd_hda_gen_parse_auto_config()
5161 CFG_IDX_MIX, spec->num_all_adcs, in snd_hda_gen_parse_auto_config()
5179 if (spec->hp_mic_pin && in snd_hda_gen_parse_auto_config()
5180 (spec->auto_mic || spec->input_mux.num_items == 1 || in snd_hda_gen_parse_auto_config()
5181 spec->add_jack_modes)) { in snd_hda_gen_parse_auto_config()
5182 err = create_hp_mic_jack_mode(codec, spec->hp_mic_pin); in snd_hda_gen_parse_auto_config()
5187 if (spec->add_jack_modes) { in snd_hda_gen_parse_auto_config()
5206 if (spec->mixer_nid) in snd_hda_gen_parse_auto_config()
5207 mute_all_mixer_nid(codec, spec->mixer_nid); in snd_hda_gen_parse_auto_config()
5212 if (spec->power_down_unused || codec->power_save_node) { in snd_hda_gen_parse_auto_config()
5219 if (!spec->no_analog && spec->beep_nid) { in snd_hda_gen_parse_auto_config()
5220 err = snd_hda_attach_beep_device(codec, spec->beep_nid); in snd_hda_gen_parse_auto_config()
5259 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_build_controls() local
5262 if (spec->kctls.used) { in snd_hda_gen_build_controls()
5263 err = snd_hda_add_new_ctls(codec, spec->kctls.list); in snd_hda_gen_build_controls()
5268 if (spec->multiout.dig_out_nid) { in snd_hda_gen_build_controls()
5270 spec->multiout.dig_out_nid, in snd_hda_gen_build_controls()
5271 spec->multiout.dig_out_nid, in snd_hda_gen_build_controls()
5272 spec->pcm_rec[1]->pcm_type); in snd_hda_gen_build_controls()
5275 if (!spec->no_analog) { in snd_hda_gen_build_controls()
5277 &spec->multiout); in snd_hda_gen_build_controls()
5280 spec->multiout.share_spdif = 1; in snd_hda_gen_build_controls()
5283 if (spec->dig_in_nid) { in snd_hda_gen_build_controls()
5284 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid); in snd_hda_gen_build_controls()
5290 if (!spec->no_analog && !spec->suppress_vmaster && in snd_hda_gen_build_controls()
5293 spec->vmaster_tlv, follower_pfxs, in snd_hda_gen_build_controls()
5298 if (!spec->no_analog && !spec->suppress_vmaster && in snd_hda_gen_build_controls()
5303 true, &spec->vmaster_mute.sw_kctl); in snd_hda_gen_build_controls()
5306 if (spec->vmaster_mute.hook) { in snd_hda_gen_build_controls()
5307 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, in snd_hda_gen_build_controls()
5308 spec->vmaster_mute_enum); in snd_hda_gen_build_controls()
5309 snd_hda_sync_vmaster_hook(&spec->vmaster_mute); in snd_hda_gen_build_controls()
5313 free_kctls(spec); /* no longer needed */ in snd_hda_gen_build_controls()
5315 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); in snd_hda_gen_build_controls()
5333 struct hda_gen_spec *spec = codec->spec; in call_pcm_playback_hook() local
5334 if (spec->pcm_playback_hook) in call_pcm_playback_hook()
5335 spec->pcm_playback_hook(hinfo, codec, substream, action); in call_pcm_playback_hook()
5343 struct hda_gen_spec *spec = codec->spec; in call_pcm_capture_hook() local
5344 if (spec->pcm_capture_hook) in call_pcm_capture_hook()
5345 spec->pcm_capture_hook(hinfo, codec, substream, action); in call_pcm_capture_hook()
5355 struct hda_gen_spec *spec = codec->spec; in playback_pcm_open() local
5358 mutex_lock(&spec->pcm_mutex); in playback_pcm_open()
5360 &spec->multiout, substream, in playback_pcm_open()
5363 spec->active_streams |= 1 << STREAM_MULTI_OUT; in playback_pcm_open()
5367 mutex_unlock(&spec->pcm_mutex); in playback_pcm_open()
5377 struct hda_gen_spec *spec = codec->spec; in playback_pcm_prepare() local
5380 err = snd_hda_multi_out_analog_prepare(codec, &spec->multiout, in playback_pcm_prepare()
5392 struct hda_gen_spec *spec = codec->spec; in playback_pcm_cleanup() local
5395 err = snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); in playback_pcm_cleanup()
5406 struct hda_gen_spec *spec = codec->spec; in playback_pcm_close() local
5407 mutex_lock(&spec->pcm_mutex); in playback_pcm_close()
5408 spec->active_streams &= ~(1 << STREAM_MULTI_OUT); in playback_pcm_close()
5411 mutex_unlock(&spec->pcm_mutex); in playback_pcm_close()
5457 struct hda_gen_spec *spec = codec->spec; in alt_playback_pcm_open() local
5460 mutex_lock(&spec->pcm_mutex); in alt_playback_pcm_open()
5461 if (spec->indep_hp && !spec->indep_hp_enabled) in alt_playback_pcm_open()
5464 spec->active_streams |= 1 << STREAM_INDEP_HP; in alt_playback_pcm_open()
5467 mutex_unlock(&spec->pcm_mutex); in alt_playback_pcm_open()
5475 struct hda_gen_spec *spec = codec->spec; in alt_playback_pcm_close() local
5476 mutex_lock(&spec->pcm_mutex); in alt_playback_pcm_close()
5477 spec->active_streams &= ~(1 << STREAM_INDEP_HP); in alt_playback_pcm_close()
5480 mutex_unlock(&spec->pcm_mutex); in alt_playback_pcm_close()
5513 struct hda_gen_spec *spec = codec->spec; in dig_playback_pcm_open() local
5514 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in dig_playback_pcm_open()
5523 struct hda_gen_spec *spec = codec->spec; in dig_playback_pcm_prepare() local
5524 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, in dig_playback_pcm_prepare()
5532 struct hda_gen_spec *spec = codec->spec; in dig_playback_pcm_cleanup() local
5533 return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); in dig_playback_pcm_cleanup()
5540 struct hda_gen_spec *spec = codec->spec; in dig_playback_pcm_close() local
5541 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in dig_playback_pcm_close()
5556 struct hda_gen_spec *spec = codec->spec; in alt_capture_pcm_prepare() local
5558 snd_hda_codec_setup_stream(codec, spec->adc_nids[substream->number + 1], in alt_capture_pcm_prepare()
5569 struct hda_gen_spec *spec = codec->spec; in alt_capture_pcm_cleanup() local
5572 spec->adc_nids[substream->number + 1]); in alt_capture_pcm_cleanup()
5664 struct hda_gen_spec *spec = codec->spec; in dyn_adc_pcm_resetup() local
5665 hda_nid_t new_adc = spec->adc_nids[spec->dyn_adc_idx[cur]]; in dyn_adc_pcm_resetup()
5667 if (spec->cur_adc && spec->cur_adc != new_adc) { in dyn_adc_pcm_resetup()
5669 __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); in dyn_adc_pcm_resetup()
5670 spec->cur_adc = new_adc; in dyn_adc_pcm_resetup()
5672 spec->cur_adc_stream_tag, 0, in dyn_adc_pcm_resetup()
5673 spec->cur_adc_format); in dyn_adc_pcm_resetup()
5686 struct hda_gen_spec *spec = codec->spec; in dyn_adc_capture_pcm_prepare() local
5687 spec->cur_adc = spec->adc_nids[spec->dyn_adc_idx[spec->cur_mux[0]]]; in dyn_adc_capture_pcm_prepare()
5688 spec->cur_adc_stream_tag = stream_tag; in dyn_adc_capture_pcm_prepare()
5689 spec->cur_adc_format = format; in dyn_adc_capture_pcm_prepare()
5690 snd_hda_codec_setup_stream(codec, spec->cur_adc, stream_tag, 0, format); in dyn_adc_capture_pcm_prepare()
5699 struct hda_gen_spec *spec = codec->spec; in dyn_adc_capture_pcm_cleanup() local
5700 snd_hda_codec_cleanup_stream(codec, spec->cur_adc); in dyn_adc_capture_pcm_cleanup()
5701 spec->cur_adc = 0; in dyn_adc_capture_pcm_cleanup()
5771 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_build_pcms() local
5775 if (spec->no_analog) in snd_hda_gen_build_pcms()
5778 fill_pcm_stream_name(spec->stream_name_analog, in snd_hda_gen_build_pcms()
5779 sizeof(spec->stream_name_analog), in snd_hda_gen_build_pcms()
5781 info = snd_hda_codec_pcm_new(codec, "%s", spec->stream_name_analog); in snd_hda_gen_build_pcms()
5784 spec->pcm_rec[0] = info; in snd_hda_gen_build_pcms()
5786 if (spec->multiout.num_dacs > 0) { in snd_hda_gen_build_pcms()
5789 spec->stream_analog_playback, in snd_hda_gen_build_pcms()
5790 spec->multiout.dac_nids[0]); in snd_hda_gen_build_pcms()
5792 spec->multiout.max_channels; in snd_hda_gen_build_pcms()
5793 if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT && in snd_hda_gen_build_pcms()
5794 spec->autocfg.line_outs == 2) in snd_hda_gen_build_pcms()
5798 if (spec->num_adc_nids) { in snd_hda_gen_build_pcms()
5800 (spec->dyn_adc_switch ? in snd_hda_gen_build_pcms()
5802 spec->stream_analog_capture, in snd_hda_gen_build_pcms()
5803 spec->adc_nids[0]); in snd_hda_gen_build_pcms()
5808 if (spec->multiout.dig_out_nid || spec->dig_in_nid) { in snd_hda_gen_build_pcms()
5809 fill_pcm_stream_name(spec->stream_name_digital, in snd_hda_gen_build_pcms()
5810 sizeof(spec->stream_name_digital), in snd_hda_gen_build_pcms()
5813 spec->stream_name_digital); in snd_hda_gen_build_pcms()
5816 codec->follower_dig_outs = spec->multiout.follower_dig_outs; in snd_hda_gen_build_pcms()
5817 spec->pcm_rec[1] = info; in snd_hda_gen_build_pcms()
5818 if (spec->dig_out_type) in snd_hda_gen_build_pcms()
5819 info->pcm_type = spec->dig_out_type; in snd_hda_gen_build_pcms()
5822 if (spec->multiout.dig_out_nid) in snd_hda_gen_build_pcms()
5825 spec->stream_digital_playback, in snd_hda_gen_build_pcms()
5826 spec->multiout.dig_out_nid); in snd_hda_gen_build_pcms()
5827 if (spec->dig_in_nid) in snd_hda_gen_build_pcms()
5830 spec->stream_digital_capture, in snd_hda_gen_build_pcms()
5831 spec->dig_in_nid); in snd_hda_gen_build_pcms()
5834 if (spec->no_analog) in snd_hda_gen_build_pcms()
5840 have_multi_adcs = (spec->num_adc_nids > 1) && in snd_hda_gen_build_pcms()
5841 !spec->dyn_adc_switch && !spec->auto_mic; in snd_hda_gen_build_pcms()
5843 if (spec->alt_dac_nid || have_multi_adcs) { in snd_hda_gen_build_pcms()
5844 fill_pcm_stream_name(spec->stream_name_alt_analog, in snd_hda_gen_build_pcms()
5845 sizeof(spec->stream_name_alt_analog), in snd_hda_gen_build_pcms()
5848 spec->stream_name_alt_analog); in snd_hda_gen_build_pcms()
5851 spec->pcm_rec[2] = info; in snd_hda_gen_build_pcms()
5852 if (spec->alt_dac_nid) in snd_hda_gen_build_pcms()
5855 spec->stream_analog_alt_playback, in snd_hda_gen_build_pcms()
5856 spec->alt_dac_nid); in snd_hda_gen_build_pcms()
5863 spec->stream_analog_alt_capture, in snd_hda_gen_build_pcms()
5864 spec->adc_nids[1]); in snd_hda_gen_build_pcms()
5866 spec->num_adc_nids - 1; in snd_hda_gen_build_pcms()
5894 aamix_default(codec->spec)); in set_output_and_unmute()
5901 struct hda_gen_spec *spec = codec->spec; in init_multi_out() local
5904 for (i = 0; i < spec->autocfg.line_outs; i++) in init_multi_out()
5905 set_output_and_unmute(codec, spec->out_paths[i]); in init_multi_out()
5920 struct hda_gen_spec *spec = codec->spec; in init_extra_out() local
5922 if (spec->autocfg.line_out_type != AUTO_PIN_HP_OUT) in init_extra_out()
5923 __init_extra_out(codec, spec->autocfg.hp_outs, spec->hp_paths); in init_extra_out()
5924 if (spec->autocfg.line_out_type != AUTO_PIN_SPEAKER_OUT) in init_extra_out()
5925 __init_extra_out(codec, spec->autocfg.speaker_outs, in init_extra_out()
5926 spec->speaker_paths); in init_extra_out()
5932 struct hda_gen_spec *spec = codec->spec; in init_multi_io() local
5935 for (i = 0; i < spec->multi_ios; i++) { in init_multi_io()
5936 hda_nid_t pin = spec->multi_io[i].pin; in init_multi_io()
5941 if (!spec->multi_io[i].ctl_in) in init_multi_io()
5942 spec->multi_io[i].ctl_in = in init_multi_io()
5945 aamix_default(spec)); in init_multi_io()
5951 struct hda_gen_spec *spec = codec->spec; in init_aamix_paths() local
5953 if (!spec->have_aamix_ctl) in init_aamix_paths()
5955 if (!has_aamix_out_paths(spec)) in init_aamix_paths()
5957 update_aamix_paths(codec, spec->aamix_mode, spec->out_paths[0], in init_aamix_paths()
5958 spec->aamix_out_paths[0], in init_aamix_paths()
5959 spec->autocfg.line_out_type); in init_aamix_paths()
5960 update_aamix_paths(codec, spec->aamix_mode, spec->hp_paths[0], in init_aamix_paths()
5961 spec->aamix_out_paths[1], in init_aamix_paths()
5963 update_aamix_paths(codec, spec->aamix_mode, spec->speaker_paths[0], in init_aamix_paths()
5964 spec->aamix_out_paths[2], in init_aamix_paths()
5971 struct hda_gen_spec *spec = codec->spec; in init_analog_input() local
5972 struct auto_pin_cfg *cfg = &spec->autocfg; in init_analog_input()
5981 if (spec->mixer_nid) { in init_analog_input()
5982 resume_path_from_idx(codec, spec->loopback_paths[i]); in init_analog_input()
5983 resume_path_from_idx(codec, spec->loopback_merge_path); in init_analog_input()
5991 struct hda_gen_spec *spec = codec->spec; in init_input_src() local
5992 struct hda_input_mux *imux = &spec->input_mux; in init_input_src()
5996 if (spec->dyn_adc_switch) in init_input_src()
5999 nums = spec->num_adc_nids; in init_input_src()
6006 if (i == spec->cur_mux[c]) in init_input_src()
6011 if (spec->hp_mic) in init_input_src()
6015 if (spec->cap_sync_hook) in init_input_src()
6016 spec->cap_sync_hook(codec, NULL, NULL); in init_input_src()
6022 struct hda_gen_spec *spec = codec->spec; in init_digital() local
6026 for (i = 0; i < spec->autocfg.dig_outs; i++) in init_digital()
6027 set_output_and_unmute(codec, spec->digout_paths[i]); in init_digital()
6028 pin = spec->autocfg.dig_in_pin; in init_digital()
6031 resume_path_from_idx(codec, spec->digin_path); in init_digital()
6053 * snd_hda_gen_init - initialize the generic spec
6060 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_init() local
6062 if (spec->init_hook) in snd_hda_gen_init()
6063 spec->init_hook(codec); in snd_hda_gen_init()
6065 if (!spec->skip_verbs) in snd_hda_gen_init()
6085 if (spec->vmaster_mute.sw_kctl && spec->vmaster_mute.hook) in snd_hda_gen_init()
6086 snd_hda_sync_vmaster_hook(&spec->vmaster_mute); in snd_hda_gen_init()
6094 * snd_hda_gen_free - free the generic spec
6102 snd_hda_gen_spec_free(codec->spec); in snd_hda_gen_free()
6103 kfree(codec->spec); in snd_hda_gen_free()
6104 codec->spec = NULL; in snd_hda_gen_free()
6136 struct hda_gen_spec *spec = codec->spec; in snd_hda_gen_check_power_status() local
6137 return snd_hda_check_amp_list_power(codec, &spec->loopback, nid); in snd_hda_gen_check_power_status()
6165 struct hda_gen_spec *spec; in snd_hda_parse_generic_codec() local
6168 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in snd_hda_parse_generic_codec()
6169 if (!spec) in snd_hda_parse_generic_codec()
6171 snd_hda_gen_spec_init(spec); in snd_hda_parse_generic_codec()
6172 codec->spec = spec; in snd_hda_parse_generic_codec()
6174 err = snd_hda_parse_pin_defcfg(codec, &spec->autocfg, NULL, 0); in snd_hda_parse_generic_codec()
6178 err = snd_hda_gen_parse_auto_config(codec, &spec->autocfg); in snd_hda_parse_generic_codec()