Lines Matching +full:gen +full:- +full:2

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Cirrus Logic CS421x HD-audio codec
19 struct hda_gen_spec gen; member
45 /* Vendor-specific processing widget */
57 * 1 = digital immediate, analog zero-cross
58 * 2 = digtail & analog soft-ramp
59 * 3 = digital soft-ramp, analog zero-cross
63 #define CS_COEF_ADC_LI_SZC_MODE (3 << 0) /* SZC setup for line-in */
64 /* PGA mode: 0 = differential, 1 = signle-ended */
66 #define CS_COEF_ADC_LI_PGA_MODE (1 << 6) /* PGA setup for line-in */
70 * 1 = zero-cross
71 * 2 = soft-ramp
72 * 3 = soft-ramp on zero-cross
75 #define CS_COEF_DAC_LO_SZC_MODE (3 << 2) /* nid 0x03 */
79 /* 0x0008 - test reg key */
80 /* 0x0009 - 0x0014 -> 12 test regs */
81 /* 0x0015 - visibility reg */
107 struct cs_spec *spec = codec->spec; in cs_vendor_coef_get()
109 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
111 return snd_hda_codec_read(codec, spec->vendor_nid, 0, in cs_vendor_coef_get()
118 struct cs_spec *spec = codec->spec; in cs_vendor_coef_set()
120 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
122 snd_hda_codec_write(codec, spec->vendor_nid, 0, in cs_vendor_coef_set()
127 * auto-mute and auto-mic switching
128 * CS421x auto-output redirecting
134 struct cs_spec *spec = codec->spec; in cs_automute()
137 spec->gen.master_mute = !!(spec->spdif_present && spec->sense_b); in cs_automute()
141 if (spec->gpio_eapd_hp || spec->gpio_eapd_speaker) { in cs_automute()
142 if (spec->gen.automute_speaker) in cs_automute()
143 spec->gpio_data = spec->gen.hp_jack_present ? in cs_automute()
144 spec->gpio_eapd_hp : spec->gpio_eapd_speaker; in cs_automute()
146 spec->gpio_data = in cs_automute()
147 spec->gpio_eapd_hp | spec->gpio_eapd_speaker; in cs_automute()
149 AC_VERB_SET_GPIO_DATA, spec->gpio_data); in cs_automute()
168 codec->spec = spec; in cs_alloc_spec()
169 spec->vendor_nid = vendor_nid; in cs_alloc_spec()
170 codec->power_save_node = 1; in cs_alloc_spec()
171 snd_hda_gen_spec_init(&spec->gen); in cs_alloc_spec()
224 struct cs_spec *spec = codec->spec; in cs421x_fixup_sense_b()
227 spec->sense_b = 1; in cs421x_fixup_sense_b()
251 * Disable Coefficient Index Auto-Increment(DAI)=1,
275 * 2. Speaker output is not completely muted upon HP detect.
311 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in cs421x_boost_vol_info()
312 uinfo->count = 1; in cs421x_boost_vol_info()
313 uinfo->value.integer.min = 0; in cs421x_boost_vol_info()
314 uinfo->value.integer.max = 3; in cs421x_boost_vol_info()
323 ucontrol->value.integer.value[0] = in cs421x_boost_vol_get()
333 unsigned int vol = ucontrol->value.integer.value[0]; in cs421x_boost_vol_put()
362 struct cs_spec *spec = codec->spec; in cs4210_pinmux_init()
368 if (spec->gpio_mask) in cs4210_pinmux_init()
373 if (spec->sense_b) in cs4210_pinmux_init()
380 if ((spec->gpio_mask || spec->sense_b) && in cs4210_pinmux_init()
384 * GPIO or SENSE_B forced - disconnect the DMIC pin. in cs4210_pinmux_init()
396 struct cs_spec *spec = codec->spec; in cs4210_spdif_automute()
398 hda_nid_t spdif_pin = spec->gen.autocfg.dig_out_pins[0]; in cs4210_spdif_automute()
401 if (!spec->spdif_detect || in cs4210_spdif_automute()
402 spec->vendor_nid != CS4210_VENDOR_NID) in cs4210_spdif_automute()
406 if (spdif_present == spec->spdif_present) in cs4210_spdif_automute()
409 spec->spdif_present = spdif_present; in cs4210_spdif_automute()
418 struct cs_spec *spec = codec->spec; in parse_cs421x_digital()
419 struct auto_pin_cfg *cfg = &spec->gen.autocfg; in parse_cs421x_digital()
422 for (i = 0; i < cfg->dig_outs; i++) { in parse_cs421x_digital()
423 hda_nid_t nid = cfg->dig_out_pins[i]; in parse_cs421x_digital()
426 spec->spdif_detect = 1; in parse_cs421x_digital()
435 struct cs_spec *spec = codec->spec; in cs421x_init()
437 if (spec->vendor_nid == CS4210_VENDOR_NID) { in cs421x_init()
445 if (spec->gpio_mask) { in cs421x_init()
447 spec->gpio_mask); in cs421x_init()
449 spec->gpio_dir); in cs421x_init()
451 spec->gpio_data); in cs421x_init()
463 /* set the upper-limit for mixer amp to 0dB */ in fix_volume_caps()
473 struct cs_spec *spec = codec->spec; in cs421x_parse_auto_config()
479 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); in cs421x_parse_auto_config()
483 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); in cs421x_parse_auto_config()
489 if (spec->gen.autocfg.speaker_outs && in cs421x_parse_auto_config()
490 spec->vendor_nid == CS4210_VENDOR_NID) { in cs421x_parse_auto_config()
491 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, in cs421x_parse_auto_config()
493 return -ENOMEM; in cs421x_parse_auto_config()
501 * (DAC,ADC) -> D3, PDREF=1, AFG->D3
505 struct cs_spec *spec = codec->spec; in cs421x_suspend()
515 if (spec->vendor_nid == CS4210_VENDOR_NID) { in cs421x_suspend()
529 spec = cs_alloc_spec(codec, id->driver_data); in cs421x_probe()
531 return -ENOMEM; in cs421x_probe()
533 spec->gen.automute_hook = cs_automute; in cs421x_probe()
535 if (spec->vendor_nid == CS4210_VENDOR_NID) { in cs421x_probe()
542 * is auto-parsed. If GPIO or SENSE_B is forced, DMIC input in cs421x_probe()
583 MODULE_DESCRIPTION("Cirrus Logic CS421x HD-audio codec");