Lines Matching +full:hp +full:- +full:cfg
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * HD audio interface patch for C-Media CMI9880
85 {0x43, CM9825_VERB_SET_GAD, 0x07}, /* ADC -3db */
123 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; in cm9825_unsol_hp_delayed()
127 hp_jack_plugin = snd_hda_jack_detect(spec->codec, hp_pin); in cm9825_unsol_hp_delayed()
129 codec_dbg(spec->codec, "hp_jack_plugin %d, hp_pin 0x%X\n", in cm9825_unsol_hp_delayed()
134 snd_hda_codec_write(spec->codec, 0x42, 0, in cm9825_unsol_hp_delayed()
137 codec_dbg(spec->codec, "codec_write err %d\n", err); in cm9825_unsol_hp_delayed()
139 snd_hda_sequence_write(spec->codec, spec->chip_hp_remove_verbs); in cm9825_unsol_hp_delayed()
141 snd_hda_sequence_write(spec->codec, in cm9825_unsol_hp_delayed()
142 spec->chip_hp_present_verbs); in cm9825_unsol_hp_delayed()
145 jack = snd_hda_jack_tbl_get(spec->codec, hp_pin); in cm9825_unsol_hp_delayed()
147 jack->block_report = 0; in cm9825_unsol_hp_delayed()
148 snd_hda_jack_report_sync(spec->codec); in cm9825_unsol_hp_delayed()
154 struct cmi_spec *spec = codec->spec; in hp_callback()
157 /* Delay enabling the HP amp, to let the mic-detection in hp_callback()
161 codec_dbg(spec->codec, "cb->nid 0x%X\n", cb->nid); in hp_callback()
163 tbl = snd_hda_jack_tbl_get(codec, cb->nid); in hp_callback()
165 tbl->block_report = 1; in hp_callback()
166 schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(200)); in hp_callback()
171 struct cmi_spec *spec = codec->spec; in cm9825_setup_unsol()
173 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; in cm9825_setup_unsol()
188 struct cmi_spec *spec = codec->spec; in cm9825_free()
190 cancel_delayed_work_sync(&spec->unsol_hp_work); in cm9825_free()
196 struct cmi_spec *spec = codec->spec; in cm9825_suspend()
198 cancel_delayed_work_sync(&spec->unsol_hp_work); in cm9825_suspend()
200 snd_hda_sequence_write(codec, spec->chip_d3_verbs); in cm9825_suspend()
207 struct cmi_spec *spec = codec->spec; in cm9825_resume()
213 snd_hda_codec_write(spec->codec, 0x42, 0, in cm9825_resume()
220 codec->patch_ops.init(codec); in cm9825_resume()
222 hp_pin = spec->gen.autocfg.hp_pins[0]; in cm9825_resume()
223 hp_jack_plugin = snd_hda_jack_detect(spec->codec, hp_pin); in cm9825_resume()
225 codec_dbg(spec->codec, "hp_jack_plugin %d, hp_pin 0x%X\n", in cm9825_resume()
230 snd_hda_codec_write(spec->codec, 0x42, 0, in cm9825_resume()
246 * stuff for auto-parser
259 struct auto_pin_cfg *cfg; in patch_cm9825() local
264 return -ENOMEM; in patch_cm9825()
266 INIT_DELAYED_WORK(&spec->unsol_hp_work, cm9825_unsol_hp_delayed); in patch_cm9825()
267 codec->spec = spec; in patch_cm9825()
268 spec->codec = codec; in patch_cm9825()
269 codec->patch_ops = cmi_auto_patch_ops; in patch_cm9825()
270 codec->patch_ops.init = cm9825_init; in patch_cm9825()
271 codec->patch_ops.suspend = cm9825_suspend; in patch_cm9825()
272 codec->patch_ops.resume = cm9825_resume; in patch_cm9825()
273 codec->patch_ops.free = cm9825_free; in patch_cm9825()
274 codec->patch_ops.check_power_status = snd_hda_gen_check_power_status; in patch_cm9825()
275 cfg = &spec->gen.autocfg; in patch_cm9825()
276 snd_hda_gen_spec_init(&spec->gen); in patch_cm9825()
277 spec->chip_d0_verbs = cm9825_std_d0_verbs; in patch_cm9825()
278 spec->chip_d3_verbs = cm9825_std_d3_verbs; in patch_cm9825()
279 spec->chip_hp_present_verbs = cm9825_hp_present_verbs; in patch_cm9825()
280 spec->chip_hp_remove_verbs = cm9825_hp_remove_verbs; in patch_cm9825()
282 snd_hda_sequence_write(codec, spec->chip_d0_verbs); in patch_cm9825()
284 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in patch_cm9825()
287 err = snd_hda_gen_parse_auto_config(codec, cfg); in patch_cm9825()
306 struct auto_pin_cfg *cfg; in patch_cmi9880() local
311 return -ENOMEM; in patch_cmi9880()
313 codec->spec = spec; in patch_cmi9880()
314 codec->patch_ops = cmi_auto_patch_ops; in patch_cmi9880()
315 cfg = &spec->gen.autocfg; in patch_cmi9880()
316 snd_hda_gen_spec_init(&spec->gen); in patch_cmi9880()
318 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in patch_cmi9880()
321 err = snd_hda_gen_parse_auto_config(codec, cfg); in patch_cmi9880()
335 struct auto_pin_cfg *cfg; in patch_cmi8888() local
340 return -ENOMEM; in patch_cmi8888()
342 codec->spec = spec; in patch_cmi8888()
343 codec->patch_ops = cmi_auto_patch_ops; in patch_cmi8888()
344 cfg = &spec->gen.autocfg; in patch_cmi8888()
345 snd_hda_gen_spec_init(&spec->gen); in patch_cmi8888()
350 spec->gen.out_vol_mask = (1ULL << 0x10); in patch_cmi8888()
352 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0); in patch_cmi8888()
355 err = snd_hda_gen_parse_auto_config(codec, cfg); in patch_cmi8888()
364 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &_kctl)) { in patch_cmi8888()
365 err = -ENOMEM; in patch_cmi8888()
390 MODULE_DESCRIPTION("C-Media HD-audio codec");