Lines Matching refs:spec
159 struct cs_spec *spec = codec->spec; in cs_vendor_coef_get() local
160 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
162 return snd_hda_codec_read(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
169 struct cs_spec *spec = codec->spec; in cs_vendor_coef_set() local
170 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
172 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
187 struct cs_spec *spec = codec->spec; in cs_playback_pcm_open() local
188 return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream, in cs_playback_pcm_open()
198 struct cs_spec *spec = codec->spec; in cs_playback_pcm_prepare() local
199 return snd_hda_multi_out_analog_prepare(codec, &spec->multiout, in cs_playback_pcm_prepare()
207 struct cs_spec *spec = codec->spec; in cs_playback_pcm_cleanup() local
208 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); in cs_playback_pcm_cleanup()
218 struct cs_spec *spec = codec->spec; in cs_dig_playback_pcm_open() local
219 return snd_hda_multi_out_dig_open(codec, &spec->multiout); in cs_dig_playback_pcm_open()
226 struct cs_spec *spec = codec->spec; in cs_dig_playback_pcm_close() local
227 return snd_hda_multi_out_dig_close(codec, &spec->multiout); in cs_dig_playback_pcm_close()
236 struct cs_spec *spec = codec->spec; in cs_dig_playback_pcm_prepare() local
237 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout, stream_tag, in cs_dig_playback_pcm_prepare()
245 struct cs_spec *spec = codec->spec; in cs_dig_playback_pcm_cleanup() local
246 return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout); in cs_dig_playback_pcm_cleanup()
251 struct cs_spec *spec = codec->spec; in cs_update_input_select() local
252 if (spec->cur_adc) in cs_update_input_select()
253 snd_hda_codec_write(codec, spec->cur_adc, 0, in cs_update_input_select()
255 spec->adc_idx[spec->cur_input]); in cs_update_input_select()
267 struct cs_spec *spec = codec->spec; in cs_capture_pcm_prepare() local
268 spec->cur_adc = spec->adc_nid[spec->cur_input]; in cs_capture_pcm_prepare()
269 spec->cur_adc_stream_tag = stream_tag; in cs_capture_pcm_prepare()
270 spec->cur_adc_format = format; in cs_capture_pcm_prepare()
272 snd_hda_codec_setup_stream(codec, spec->cur_adc, stream_tag, 0, format); in cs_capture_pcm_prepare()
280 struct cs_spec *spec = codec->spec; in cs_capture_pcm_cleanup() local
281 snd_hda_codec_cleanup_stream(codec, spec->cur_adc); in cs_capture_pcm_cleanup()
282 spec->cur_adc = 0; in cs_capture_pcm_cleanup()
329 struct cs_spec *spec = codec->spec; in cs_build_pcms() local
330 struct hda_pcm *info = spec->pcm_rec; in cs_build_pcms()
337 info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->dac_nid[0]; in cs_build_pcms()
339 spec->multiout.max_channels; in cs_build_pcms()
342 spec->adc_nid[spec->cur_input]; in cs_build_pcms()
345 if (!spec->multiout.dig_out_nid && !spec->dig_in) in cs_build_pcms()
350 info->pcm_type = spec->autocfg.dig_out_type[0]; in cs_build_pcms()
353 if (spec->multiout.dig_out_nid) { in cs_build_pcms()
357 spec->multiout.dig_out_nid; in cs_build_pcms()
359 if (spec->dig_in) { in cs_build_pcms()
362 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->dig_in; in cs_build_pcms()
385 struct cs_spec *spec = codec->spec; in is_ext_mic() local
386 struct auto_pin_cfg *cfg = &spec->autocfg; in is_ext_mic()
425 struct cs_spec *spec = codec->spec; in parse_output() local
426 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_output()
434 spec->dac_nid[i] = dac; in parse_output()
436 spec->multiout.num_dacs = i; in parse_output()
437 spec->multiout.dac_nids = spec->dac_nid; in parse_output()
438 spec->multiout.max_channels = i * 2; in parse_output()
447 spec->multiout.hp_nid = dac; in parse_output()
449 spec->multiout.extra_out_nid[extra_nids++] = dac; in parse_output()
455 spec->multiout.extra_out_nid[extra_nids++] = dac; in parse_output()
471 struct cs_spec *spec = codec->spec; in parse_input() local
472 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_input()
477 spec->input_idx[spec->num_inputs] = i; in parse_input()
478 spec->capsrc_idx[i] = spec->num_inputs++; in parse_input()
479 spec->cur_input = i; in parse_input()
480 spec->adc_nid[i] = get_adc(codec, pin, &spec->adc_idx[i]); in parse_input()
482 if (!spec->num_inputs) in parse_input()
486 if (spec->num_inputs == 2 && in parse_input()
491 spec->mic_detect = 1; in parse_input()
492 spec->automic_idx = 0; in parse_input()
496 spec->mic_detect = 1; in parse_input()
497 spec->automic_idx = 1; in parse_input()
507 struct cs_spec *spec = codec->spec; in parse_digital_output() local
508 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_digital_output()
515 spec->multiout.dig_out_nid = nid; in parse_digital_output()
516 spec->multiout.share_spdif = 1; in parse_digital_output()
519 spec->slave_dig_outs[0] = nid; in parse_digital_output()
520 codec->slave_dig_outs = spec->slave_dig_outs; in parse_digital_output()
527 struct cs_spec *spec = codec->spec; in parse_digital_input() local
528 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_digital_input()
532 spec->dig_in = get_adc(codec, cfg->dig_in_pin, &idx); in parse_digital_input()
583 struct cs_spec *spec = codec->spec; in add_vmaster() local
587 spec->vmaster_sw = in add_vmaster()
589 err = snd_hda_ctl_add(codec, dac, spec->vmaster_sw); in add_vmaster()
594 spec->vmaster_vol = in add_vmaster()
596 err = snd_hda_ctl_add(codec, dac, spec->vmaster_vol); in add_vmaster()
605 struct cs_spec *spec = codec->spec; in add_output() local
617 if (!spec->vmaster_sw) { in add_output()
647 err = snd_ctl_add_slave(spec->vmaster_sw, kctl); in add_output()
655 err = snd_ctl_add_slave(spec->vmaster_vol, kctl); in add_output()
664 struct cs_spec *spec = codec->spec; in build_output() local
665 struct auto_pin_cfg *cfg = &spec->autocfg; in build_output()
700 struct cs_spec *spec = codec->spec; in change_cur_input() local
702 if (spec->cur_input == idx && !force) in change_cur_input()
704 if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { in change_cur_input()
706 __snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1); in change_cur_input()
707 spec->cur_adc = spec->adc_nid[idx]; in change_cur_input()
708 snd_hda_codec_setup_stream(codec, spec->cur_adc, in change_cur_input()
709 spec->cur_adc_stream_tag, 0, in change_cur_input()
710 spec->cur_adc_format); in change_cur_input()
712 spec->cur_input = idx; in change_cur_input()
721 struct cs_spec *spec = codec->spec; in cs_capture_source_info() local
722 struct auto_pin_cfg *cfg = &spec->autocfg; in cs_capture_source_info()
727 uinfo->value.enumerated.items = spec->num_inputs; in cs_capture_source_info()
728 if (uinfo->value.enumerated.item >= spec->num_inputs) in cs_capture_source_info()
729 uinfo->value.enumerated.item = spec->num_inputs - 1; in cs_capture_source_info()
730 idx = spec->input_idx[uinfo->value.enumerated.item]; in cs_capture_source_info()
741 struct cs_spec *spec = codec->spec; in cs_capture_source_get() local
742 ucontrol->value.enumerated.item[0] = spec->capsrc_idx[spec->cur_input]; in cs_capture_source_get()
750 struct cs_spec *spec = codec->spec; in cs_capture_source_put() local
753 if (idx >= spec->num_inputs) in cs_capture_source_put()
755 idx = spec->input_idx[idx]; in cs_capture_source_put()
771 struct cs_spec *spec = codec->spec; in make_bind_capture() local
775 bind = kzalloc(sizeof(*bind) + sizeof(long) * (spec->num_inputs + 1), in make_bind_capture()
782 if (!spec->adc_nid[i]) in make_bind_capture()
785 HDA_COMPOSE_AMP_VAL(spec->adc_nid[i], 3, in make_bind_capture()
786 spec->adc_idx[i], HDA_INPUT); in make_bind_capture()
814 struct cs_spec *spec = codec->spec; in build_input() local
817 if (!spec->num_inputs) in build_input()
821 spec->capture_bind[0] = make_bind_capture(codec, &snd_hda_bind_sw); in build_input()
822 spec->capture_bind[1] = make_bind_capture(codec, &snd_hda_bind_vol); in build_input()
826 if (!spec->capture_bind[i]) in build_input()
831 kctl->private_value = (long)spec->capture_bind[i]; in build_input()
836 if (!spec->adc_nid[n]) in build_input()
838 err = snd_hda_add_nid(codec, kctl, 0, spec->adc_nid[n]); in build_input()
844 if (spec->num_inputs > 1 && !spec->mic_detect) { in build_input()
851 for (i = 0; i < spec->num_inputs; i++) { in build_input()
852 err = add_input_volume_control(codec, &spec->autocfg, i); in build_input()
865 struct cs_spec *spec = codec->spec; in build_digital_output() local
868 if (!spec->multiout.dig_out_nid) in build_digital_output()
871 err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid, in build_digital_output()
872 spec->multiout.dig_out_nid); in build_digital_output()
875 err = snd_hda_create_spdif_share_sw(codec, &spec->multiout); in build_digital_output()
883 struct cs_spec *spec = codec->spec; in build_digital_input() local
884 if (spec->dig_in) in build_digital_input()
885 return snd_hda_create_spdif_in_ctls(codec, spec->dig_in); in build_digital_input()
897 struct cs_spec *spec = codec->spec; in cs_automute() local
898 struct auto_pin_cfg *cfg = &spec->autocfg; in cs_automute()
933 if (spdif_present && (spec->vendor_nid == CS4210_VENDOR_NID)) in cs_automute()
940 if (spec->gpio_eapd_hp) { in cs_automute()
942 spec->gpio_eapd_hp : spec->gpio_eapd_speaker; in cs_automute()
948 if (spec->vendor_nid == CS4210_VENDOR_NID) { in cs_automute()
954 (spdif_present && spec->sense_b) ? 0 : PIN_HP); in cs_automute()
976 struct cs_spec *spec = codec->spec; in cs_automic() local
977 struct auto_pin_cfg *cfg = &spec->autocfg; in cs_automic()
981 nid = cfg->inputs[spec->automic_idx].pin; in cs_automic()
985 if (spec->vendor_nid == CS420X_VENDOR_NID) { in cs_automic()
987 change_cur_input(codec, spec->automic_idx, 0); in cs_automic()
989 change_cur_input(codec, !spec->automic_idx, 0); in cs_automic()
992 if (spec->cur_input != spec->automic_idx) { in cs_automic()
993 spec->last_input = spec->cur_input; in cs_automic()
994 spec->cur_input = spec->automic_idx; in cs_automic()
997 spec->cur_input = spec->last_input; in cs_automic()
1008 struct cs_spec *spec = codec->spec; in init_output() local
1009 struct auto_pin_cfg *cfg = &spec->autocfg; in init_output()
1013 for (i = 0; i < spec->multiout.num_dacs; i++) in init_output()
1014 snd_hda_codec_write(codec, spec->multiout.dac_nids[i], 0, in init_output()
1016 if (spec->multiout.hp_nid) in init_output()
1017 snd_hda_codec_write(codec, spec->multiout.hp_nid, 0, in init_output()
1019 for (i = 0; i < ARRAY_SIZE(spec->multiout.extra_out_nid); i++) { in init_output()
1020 if (!spec->multiout.extra_out_nid[i]) in init_output()
1022 snd_hda_codec_write(codec, spec->multiout.extra_out_nid[i], 0, in init_output()
1039 spec->hp_detect = 1; in init_output()
1049 if (spec->hp_detect || spec->spdif_detect) in init_output()
1055 struct cs_spec *spec = codec->spec; in init_input() local
1056 struct auto_pin_cfg *cfg = &spec->autocfg; in init_input()
1063 if (!spec->adc_nid[i]) in init_input()
1075 snd_hda_codec_write(codec, spec->adc_nid[i], 0, in init_input()
1077 AMP_IN_MUTE(spec->adc_idx[i])); in init_input()
1078 if (spec->mic_detect && spec->automic_idx == i) in init_input()
1082 if (spec->vendor_nid == CS420X_VENDOR_NID) { in init_input()
1083 change_cur_input(codec, spec->cur_input, 1); in init_input()
1084 if (spec->mic_detect) in init_input()
1101 if (spec->mic_detect) in init_input()
1104 spec->cur_adc = spec->adc_nid[spec->cur_input]; in init_input()
1192 struct cs_spec *spec = codec->spec; in cs_init() local
1199 if (spec->gpio_mask) { in cs_init()
1201 spec->gpio_mask); in cs_init()
1203 spec->gpio_dir); in cs_init()
1205 spec->gpio_data); in cs_init()
1218 struct cs_spec *spec = codec->spec; in cs_build_controls() local
1237 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); in cs_build_controls()
1246 struct cs_spec *spec = codec->spec; in cs_free() local
1247 kfree(spec->capture_bind[0]); in cs_free()
1248 kfree(spec->capture_bind[1]); in cs_free()
1249 kfree(codec->spec); in cs_free()
1275 struct cs_spec *spec = codec->spec; in cs_parse_auto_config() local
1278 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); in cs_parse_auto_config()
1388 struct cs_spec *spec; in patch_cs420x() local
1391 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in patch_cs420x()
1392 if (!spec) in patch_cs420x()
1394 codec->spec = spec; in patch_cs420x()
1396 spec->vendor_nid = CS420X_VENDOR_NID; in patch_cs420x()
1398 spec->board_config = in patch_cs420x()
1401 if (spec->board_config < 0) in patch_cs420x()
1402 spec->board_config = in patch_cs420x()
1405 if (spec->board_config >= 0) in patch_cs420x()
1406 fix_pincfg(codec, spec->board_config, cs_pincfgs); in patch_cs420x()
1408 switch (spec->board_config) { in patch_cs420x()
1413 spec->gpio_eapd_hp = 2; /* GPIO1 = headphones */ in patch_cs420x()
1414 spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */ in patch_cs420x()
1415 spec->gpio_mask = spec->gpio_dir = in patch_cs420x()
1416 spec->gpio_eapd_hp | spec->gpio_eapd_speaker; in patch_cs420x()
1419 spec->gpio_eapd_hp = 4; /* GPIO2 = headphones */ in patch_cs420x()
1420 spec->gpio_eapd_speaker = 8; /* GPIO3 = speakers */ in patch_cs420x()
1421 spec->gpio_mask = spec->gpio_dir = in patch_cs420x()
1422 spec->gpio_eapd_hp | spec->gpio_eapd_speaker; in patch_cs420x()
1436 codec->spec = NULL; in patch_cs420x()
1590 struct cs_spec *spec = codec->spec; in cs4210_pinmux_init() local
1596 if (spec->gpio_mask) in cs4210_pinmux_init()
1601 if (spec->sense_b) in cs4210_pinmux_init()
1608 if ((spec->gpio_mask || spec->sense_b) && in cs4210_pinmux_init()
1623 struct cs_spec *spec = codec->spec; in init_cs421x_digital() local
1624 struct auto_pin_cfg *cfg = &spec->autocfg; in init_cs421x_digital()
1634 spec->spdif_detect = 1; in init_cs421x_digital()
1641 struct cs_spec *spec = codec->spec; in cs421x_init() local
1643 if (spec->vendor_nid == CS4210_VENDOR_NID) { in cs421x_init()
1649 if (spec->gpio_mask) { in cs421x_init()
1651 spec->gpio_mask); in cs421x_init()
1653 spec->gpio_dir); in cs421x_init()
1655 spec->gpio_data); in cs421x_init()
1673 struct cs_spec *spec = codec->spec; in cs421x_mux_enum_info() local
1675 return snd_hda_input_mux_info(&spec->input_mux, uinfo); in cs421x_mux_enum_info()
1682 struct cs_spec *spec = codec->spec; in cs421x_mux_enum_get() local
1684 ucontrol->value.enumerated.item[0] = spec->cur_input; in cs421x_mux_enum_get()
1692 struct cs_spec *spec = codec->spec; in cs421x_mux_enum_put() local
1694 return snd_hda_input_mux_put(codec, &spec->input_mux, ucontrol, in cs421x_mux_enum_put()
1695 spec->adc_nid[0], &spec->cur_input); in cs421x_mux_enum_put()
1711 struct cs_spec *spec = codec->spec; in cs421x_add_input_volume_control() local
1712 struct auto_pin_cfg *cfg = &spec->autocfg; in cs421x_add_input_volume_control()
1713 const struct hda_input_mux *imux = &spec->input_mux; in cs421x_add_input_volume_control()
1733 struct cs_spec *spec = codec->spec; in build_cs421x_input() local
1734 struct auto_pin_cfg *cfg = &spec->autocfg; in build_cs421x_input()
1735 struct hda_input_mux *imux = &spec->input_mux; in build_cs421x_input()
1739 if (!spec->num_inputs) in build_cs421x_input()
1743 spec->capture_bind[0] = make_bind_capture(codec, &snd_hda_bind_sw); in build_cs421x_input()
1744 spec->capture_bind[1] = make_bind_capture(codec, &snd_hda_bind_vol); in build_cs421x_input()
1748 if (!spec->capture_bind[i]) in build_cs421x_input()
1753 kctl->private_value = (long)spec->capture_bind[i]; in build_cs421x_input()
1758 if (!spec->adc_nid[n]) in build_cs421x_input()
1760 err = snd_hda_add_nid(codec, kctl, 0, spec->adc_nid[n]); in build_cs421x_input()
1767 for (i = 0; i < spec->num_inputs; i++) { in build_cs421x_input()
1769 snd_hda_add_imux_item(imux, label, spec->adc_idx[i], &type_idx); in build_cs421x_input()
1781 if ((spec->num_inputs == 2 && !spec->mic_detect) || in build_cs421x_input()
1782 (spec->num_inputs == 3)) { in build_cs421x_input()
1784 err = snd_hda_ctl_add(codec, spec->adc_nid[0], in build_cs421x_input()
1797 struct cs_spec *spec = codec->spec; in build_cs421x_output() local
1798 struct auto_pin_cfg *cfg = &spec->autocfg; in build_cs421x_output()
1815 if (cfg->speaker_outs && (spec->vendor_nid == CS4210_VENDOR_NID)) { in build_cs421x_output()
1826 struct cs_spec *spec = codec->spec; in cs421x_build_controls() local
1842 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); in cs421x_build_controls()
1866 struct cs_spec *spec = codec->spec; in parse_cs421x_input() local
1867 struct auto_pin_cfg *cfg = &spec->autocfg; in parse_cs421x_input()
1872 spec->adc_nid[i] = get_adc(codec, pin, &spec->adc_idx[i]); in parse_cs421x_input()
1873 spec->cur_input = spec->last_input = i; in parse_cs421x_input()
1874 spec->num_inputs++; in parse_cs421x_input()
1878 spec->mic_detect = 1; in parse_cs421x_input()
1879 spec->automic_idx = i; in parse_cs421x_input()
1887 struct cs_spec *spec = codec->spec; in cs421x_parse_auto_config() local
1890 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, NULL); in cs421x_parse_auto_config()
1912 struct cs_spec *spec = codec->spec; in cs421x_suspend() local
1922 if (spec->vendor_nid == CS4210_VENDOR_NID) { in cs421x_suspend()
1945 struct cs_spec *spec; in patch_cs4210() local
1948 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in patch_cs4210()
1949 if (!spec) in patch_cs4210()
1951 codec->spec = spec; in patch_cs4210()
1953 spec->vendor_nid = CS4210_VENDOR_NID; in patch_cs4210()
1955 spec->board_config = in patch_cs4210()
1958 if (spec->board_config >= 0) in patch_cs4210()
1959 fix_pincfg(codec, spec->board_config, cs421x_pincfgs); in patch_cs4210()
1963 switch (spec->board_config) { in patch_cs4210()
1966 cs421x_models[spec->board_config]); in patch_cs4210()
1971 spec->sense_b = 1; in patch_cs4210()
1993 codec->spec = NULL; in patch_cs4210()
1999 struct cs_spec *spec; in patch_cs4213() local
2002 spec = kzalloc(sizeof(*spec), GFP_KERNEL); in patch_cs4213()
2003 if (!spec) in patch_cs4213()
2005 codec->spec = spec; in patch_cs4213()
2007 spec->vendor_nid = CS4213_VENDOR_NID; in patch_cs4213()
2018 codec->spec = NULL; in patch_cs4213()