Lines Matching defs:cfg

1165 	struct auto_pin_cfg *cfg = &spec->autocfg;
1168 if (cfg->line_outs == 1 && !spec->multi_ios &&
1170 !cfg->hp_outs && !cfg->speaker_outs)
1182 if (ch >= cfg->line_outs)
1185 switch (cfg->line_out_type) {
1190 if (!ch && cfg->hp_outs &&
1193 if (cfg->line_outs == 1)
1195 if (cfg->line_outs == 2)
1202 if (!ch && cfg->speaker_outs &&
1217 if (cfg->speaker_outs)
1220 if (cfg->hp_outs)
1232 if (cfg->line_outs == 1 && !spec->multi_ios)
1345 struct auto_pin_cfg *cfg = &spec->autocfg;
1347 if (cfg->line_outs > idx)
1349 idx -= cfg->line_outs;
1495 struct auto_pin_cfg *cfg = &spec->autocfg;
1502 for (i = 0; i < cfg->num_inputs; i++) {
1503 if (cfg->inputs[i].type != type)
1506 cfg->inputs[i].pin))
1526 struct auto_pin_cfg *cfg = &spec->autocfg;
1542 for (i = 0; i < cfg->num_inputs; i++) {
1543 hda_nid_t nid = cfg->inputs[i].pin;
1546 if (cfg->inputs[i].type != type)
1574 spec->out_paths[cfg->line_outs + spec->multi_ios] =
1599 path = snd_hda_get_path_from_idx(codec, spec->out_paths[cfg->line_outs + i]);
1682 struct auto_pin_cfg *cfg = &spec->autocfg;
1686 if (cfg->line_out_type == AUTO_PIN_HP_OUT)
1699 for (i = 0; i < cfg->line_outs; i++) {
1706 for (i = 0; i < cfg->speaker_outs; i++) {
1740 struct auto_pin_cfg *cfg = &spec->autocfg;
1744 spec->multiout.num_dacs = cfg->line_outs;
1768 mapped = map_singles(codec, cfg->line_outs,
1769 cfg->line_out_pins,
1772 mapped |= map_singles(codec, cfg->hp_outs,
1773 cfg->hp_pins,
1776 mapped |= map_singles(codec, cfg->speaker_outs,
1777 cfg->speaker_pins,
1781 fill_mio_first && cfg->line_outs == 1 &&
1782 cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1783 err = fill_multi_ios(codec, cfg->line_out_pins[0], true);
1790 badness += try_assign_dacs(codec, cfg->line_outs, cfg->line_out_pins,
1795 cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1797 err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
1803 if (cfg->line_out_type != AUTO_PIN_HP_OUT) {
1804 err = try_assign_dacs(codec, cfg->hp_outs, cfg->hp_pins,
1812 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1813 err = try_assign_dacs(codec, cfg->speaker_outs,
1814 cfg->speaker_pins,
1823 cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
1824 err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
1833 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
1836 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
1842 cfg->hp_outs && cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
1843 if (count_multiio_pins(codec, cfg->hp_pins[0]) >= 2)
1848 for (i = 0; i < cfg->line_outs; i++) {
1854 sizeof(hda_nid_t) * (cfg->line_outs - i - 1));
1855 spec->private_dac_nids[cfg->line_outs - 1] = 0;
1875 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
1876 refill_shared_dacs(codec, cfg->hp_outs,
1879 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
1880 refill_shared_dacs(codec, cfg->speaker_outs,
1909 struct auto_pin_cfg *cfg)
1916 cfg->line_out_pins[0], cfg->line_out_pins[1],
1917 cfg->line_out_pins[2], cfg->line_out_pins[3],
1922 lo_type[cfg->line_out_type]);
1923 for (i = 0; i < cfg->line_outs; i++)
1932 spec->out_paths[cfg->line_outs + i]);
1933 if (cfg->hp_outs)
1935 cfg->hp_pins[0], cfg->hp_pins[1],
1936 cfg->hp_pins[2], cfg->hp_pins[3],
1941 for (i = 0; i < cfg->hp_outs; i++)
1943 if (cfg->speaker_outs)
1945 cfg->speaker_pins[0], cfg->speaker_pins[1],
1946 cfg->speaker_pins[2], cfg->speaker_pins[3],
1951 for (i = 0; i < cfg->speaker_outs; i++)
1957 #define debug_show_configs(codec, cfg) /* NOP */
1982 struct auto_pin_cfg *cfg = &spec->autocfg;
1994 *best_cfg = *cfg;
2004 cfg->line_out_type, fill_hardwired, fill_mio_first,
2006 debug_show_configs(codec, cfg);
2009 *best_cfg = *cfg;
2024 if (cfg->speaker_outs > 0 &&
2025 cfg->line_out_type == AUTO_PIN_HP_OUT) {
2026 cfg->hp_outs = cfg->line_outs;
2027 memcpy(cfg->hp_pins, cfg->line_out_pins,
2028 sizeof(cfg->hp_pins));
2029 cfg->line_outs = cfg->speaker_outs;
2030 memcpy(cfg->line_out_pins, cfg->speaker_pins,
2031 sizeof(cfg->speaker_pins));
2032 cfg->speaker_outs = 0;
2033 memset(cfg->speaker_pins, 0, sizeof(cfg->speaker_pins));
2034 cfg->line_out_type = AUTO_PIN_SPEAKER_OUT;
2038 if (cfg->hp_outs > 0 &&
2039 cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
2040 cfg->speaker_outs = cfg->line_outs;
2041 memcpy(cfg->speaker_pins, cfg->line_out_pins,
2042 sizeof(cfg->speaker_pins));
2043 cfg->line_outs = cfg->hp_outs;
2044 memcpy(cfg->line_out_pins, cfg->hp_pins,
2045 sizeof(cfg->hp_pins));
2046 cfg->hp_outs = 0;
2047 memset(cfg->hp_pins, 0, sizeof(cfg->hp_pins));
2048 cfg->line_out_type = AUTO_PIN_HP_OUT;
2057 *cfg = *best_cfg;
2061 cfg->line_out_type, best_wired, best_mio);
2062 debug_show_configs(codec, cfg);
2064 if (cfg->line_out_pins[0]) {
2078 if (spec->prefer_hp_amp || cfg->line_out_type == AUTO_PIN_HP_OUT)
2082 set_pin_targets(codec, cfg->line_outs, cfg->line_out_pins, val);
2083 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
2084 set_pin_targets(codec, cfg->hp_outs, cfg->hp_pins, PIN_HP);
2085 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
2087 set_pin_targets(codec, cfg->speaker_outs,
2088 cfg->speaker_pins, val);
2101 const struct auto_pin_cfg *cfg)
2106 noutputs = cfg->line_outs;
2107 if (spec->multi_ios > 0 && cfg->line_outs < 3)
2505 const struct auto_pin_cfg *cfg = &spec->autocfg;
2514 cfg->line_out_type);
2522 update_output_paths(codec, cfg->line_outs, spec->out_paths);
2523 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
2524 update_output_paths(codec, cfg->hp_outs, spec->hp_paths);
2525 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
2526 update_output_paths(codec, cfg->speaker_outs,
2606 struct auto_pin_cfg *cfg = &spec->autocfg;
2616 if (cfg->num_inputs > 1)
2618 else if (cfg->num_inputs == 1) {
2619 defcfg = snd_hda_codec_get_pincfg(codec, cfg->inputs[0].pin);
2626 if (cfg->num_inputs >= AUTO_CFG_MAX_INS)
2630 if (cfg->line_out_type == AUTO_PIN_HP_OUT && cfg->line_outs > 0)
2631 nid = cfg->line_out_pins[0];
2632 else if (cfg->hp_outs > 0)
2633 nid = cfg->hp_pins[0];
2640 cfg->inputs[cfg->num_inputs].pin = nid;
2641 cfg->inputs[cfg->num_inputs].type = AUTO_PIN_MIC;
2642 cfg->inputs[cfg->num_inputs].is_headphone_mic = 1;
2643 cfg->num_inputs++;
3293 const struct auto_pin_cfg *cfg = &spec->autocfg;
3296 for (i = 0; i < cfg->num_inputs; i++) {
3297 hda_nid_t pin = cfg->inputs[i].pin;
3304 label = hda_get_autocfg_input_label(codec, cfg, i);
3321 #define CFG_IDX_MIX 99 /* a dummy cfg->input idx for stereo mix */
3326 const struct auto_pin_cfg *cfg = &spec->autocfg;
3340 for (i = 0; i < cfg->num_inputs; i++) {
3343 pin = cfg->inputs[i].pin;
3348 if (cfg->inputs[i].type == AUTO_PIN_MIC)
3579 struct auto_pin_cfg *cfg = &spec->autocfg;
3585 for (i = 0; i < cfg->num_inputs; i++) {
3586 if (cfg->inputs[i].pin != nid)
3588 if (cfg->inputs[i].type != AUTO_PIN_MIC)
3870 struct auto_pin_cfg *cfg = &spec->autocfg;
3888 if (cfg->inputs[idx].type > AUTO_PIN_LINE_IN)
4352 struct auto_pin_cfg *cfg = &spec->autocfg;
4357 add_pin_power_ctls(codec, cfg->line_outs, cfg->line_out_pins, on);
4358 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
4359 add_pin_power_ctls(codec, cfg->hp_outs, cfg->hp_pins, on);
4360 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
4361 add_pin_power_ctls(codec, cfg->speaker_outs, cfg->speaker_pins, on);
4362 for (i = 0; i < cfg->num_inputs; i++)
4363 add_pin_power_ctls(codec, 1, &cfg->inputs[i].pin, on);
4381 struct auto_pin_cfg *cfg = &spec->autocfg;
4386 sync_pin_power_ctls(codec, cfg->line_outs, cfg->line_out_pins);
4387 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
4388 sync_pin_power_ctls(codec, cfg->hp_outs, cfg->hp_pins);
4389 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
4390 sync_pin_power_ctls(codec, cfg->speaker_outs, cfg->speaker_pins);
4391 for (i = 0; i < cfg->num_inputs; i++)
4392 sync_pin_power_ctls(codec, 1, &cfg->inputs[i].pin);
4424 struct auto_pin_cfg *cfg = &spec->autocfg;
4430 err = add_fake_paths(codec, nid, cfg->line_outs, cfg->line_out_pins);
4433 if (cfg->line_out_type != AUTO_PIN_HP_OUT) {
4434 err = add_fake_paths(codec, nid, cfg->hp_outs, cfg->hp_pins);
4438 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
4439 err = add_fake_paths(codec, nid, cfg->speaker_outs,
4440 cfg->speaker_pins);
4839 struct auto_pin_cfg *cfg = &spec->autocfg;
4846 if (cfg->hp_pins[0])
4848 if (cfg->line_out_pins[0])
4850 if (cfg->speaker_pins[0])
4855 if (!cfg->speaker_pins[0] &&
4856 cfg->line_out_type == AUTO_PIN_SPEAKER_OUT) {
4857 memcpy(cfg->speaker_pins, cfg->line_out_pins,
4858 sizeof(cfg->speaker_pins));
4859 cfg->speaker_outs = cfg->line_outs;
4862 if (!cfg->hp_pins[0] &&
4863 cfg->line_out_type == AUTO_PIN_HP_OUT) {
4864 memcpy(cfg->hp_pins, cfg->line_out_pins,
4865 sizeof(cfg->hp_pins));
4866 cfg->hp_outs = cfg->line_outs;
4869 for (i = 0; i < cfg->hp_outs; i++) {
4870 hda_nid_t nid = cfg->hp_pins[i];
4879 if (cfg->line_out_type == AUTO_PIN_LINE_OUT && cfg->line_outs) {
4880 if (cfg->speaker_outs)
4881 for (i = 0; i < cfg->line_outs; i++) {
4882 hda_nid_t nid = cfg->line_out_pins[i];
4893 spec->automute_speaker_possible = cfg->speaker_outs &&
4946 struct auto_pin_cfg *cfg = &spec->autocfg;
4955 for (i = 0; i < cfg->num_inputs; i++) {
4956 hda_nid_t nid = cfg->inputs[i].pin;
4964 if (cfg->inputs[i].type != AUTO_PIN_MIC)
4970 if (cfg->inputs[i].type > AUTO_PIN_LINE_IN)
4973 cfg->inputs[i].type != AUTO_PIN_MIC)
5074 * @cfg: Parsed pin configuration
5080 struct auto_pin_cfg *cfg)
5090 if (cfg != &spec->autocfg) {
5091 spec->autocfg = *cfg;
5092 cfg = &spec->autocfg;
5102 if (!cfg->line_outs) {
5103 if (cfg->dig_outs || cfg->dig_in_pin) {
5108 if (!cfg->num_inputs && !cfg->dig_in_pin)
5113 cfg->line_out_type == AUTO_PIN_SPEAKER_OUT &&
5114 cfg->line_outs <= cfg->hp_outs) {
5116 cfg->speaker_outs = cfg->line_outs;
5117 memcpy(cfg->speaker_pins, cfg->line_out_pins,
5118 sizeof(cfg->speaker_pins));
5119 cfg->line_outs = cfg->hp_outs;
5120 memcpy(cfg->line_out_pins, cfg->hp_pins, sizeof(cfg->hp_pins));
5121 cfg->hp_outs = 0;
5122 memset(cfg->hp_pins, 0, sizeof(cfg->hp_pins));
5123 cfg->line_out_type = AUTO_PIN_HP_OUT;
5132 err = create_multi_out_ctls(codec, cfg);
5159 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT)
5161 cfg->speaker_outs * 2);
5162 if (cfg->line_out_type != AUTO_PIN_HP_OUT)
5164 cfg->hp_outs * 2);
5212 if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
5213 err = create_out_jack_modes(codec, cfg->line_outs,
5214 cfg->line_out_pins);
5218 if (cfg->line_out_type != AUTO_PIN_HP_OUT) {
5219 err = create_out_jack_modes(codec, cfg->hp_outs,
5220 cfg->hp_pins);
5996 struct auto_pin_cfg *cfg = &spec->autocfg;
5999 for (i = 0; i < cfg->num_inputs; i++) {
6000 hda_nid_t nid = cfg->inputs[i].pin;