Lines Matching +full:codec +full:- +full:0

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Universal Interface for Intel High Definition Audio Codec
15 * snd_hda_ctl_add() takes the lower-bit subdev value as a valid NID.
30 HDA_COMPOSE_AMP_VAL_OFS(nid, chs, idx, dir, 0)
31 /* mono volume with index (index=0,1,...) (channel=1,2) */
45 HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, 3, xindex, direction, 0)
48 HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, channel, xindex, direction, 0)
54 HDA_CODEC_VOLUME_MONO_IDX(xname, 0, nid, 3, xindex, direction, \
56 /* mono mute switch with index (index=0,1,...) (channel=1,2) */
69 HDA_CODEC_MUTE_MONO_IDX(xname, 0, nid, channel, xindex, direction)
74 /* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */
83 /* no digital beep - just the standard one */
89 HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, 0, nid, channel, xindex, direction)
117 #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ argument
118 snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx)
119 int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
121 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
123 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
125 int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid,
127 void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
129 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
131 int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,
135 #define snd_hda_add_vmaster(codec, name, tlv, followers, suffix) \ argument
136 __snd_hda_add_vmaster(codec, name, tlv, followers, suffix, true, NULL)
137 int snd_hda_codec_reset(struct hda_codec *codec);
138 void snd_hda_codec_register(struct hda_codec *codec);
139 void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec);
141 #define snd_hda_regmap_sync(codec) snd_hdac_regmap_sync(&(codec)->core) argument
157 struct hda_codec *codec; member
160 int snd_hda_add_vmaster_hook(struct hda_codec *codec,
166 #define HDA_AMP_MUTE 0x80
167 #define HDA_AMP_UNMUTE 0x00
168 #define HDA_AMP_VOLMASK 0x7f
173 int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
176 #define snd_hda_create_spdif_out_ctls(codec, anid, cnid) \ argument
177 snd_hda_create_dig_out_ctls(codec, anid, cnid, HDA_PCM_TYPE_SPDIF)
178 int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid);
195 int snd_hda_input_mux_put(struct hda_codec *codec,
199 int snd_hda_add_imux_item(struct hda_codec *codec,
204 * Multi-channel / digital-out PCM helper
215 hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */
233 int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
235 int snd_hda_multi_out_dig_open(struct hda_codec *codec,
237 int snd_hda_multi_out_dig_close(struct hda_codec *codec,
239 int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
244 int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
246 int snd_hda_multi_out_analog_open(struct hda_codec *codec,
250 int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
255 int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
262 int snd_hda_codec_proc_new(struct hda_codec *codec);
264 static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; } in snd_hda_codec_proc_new() argument
273 int snd_hda_add_new_ctls(struct hda_codec *codec,
277 * Fix-up pin default configurations and add default verbs
298 void (*func)(struct hda_codec *codec,
305 unsigned int codec; /* Codec vendor/device ID */ member
317 { .codec = _codec,\
321 .pins = (const struct hda_pintbl[]) { _pins, {0, 0}} \
326 { .codec = _codec,\
329 .pins = (const struct hda_pintbl[]) { _pins, {0, 0}} \
334 #define HDA_FIXUP_ID_NOT_SET -1
335 #define HDA_FIXUP_ID_NO_FIXUP -2
355 int snd_hda_add_verbs(struct hda_codec *codec, const struct hda_verb *list);
356 void snd_hda_apply_verbs(struct hda_codec *codec);
357 void snd_hda_apply_pincfgs(struct hda_codec *codec,
359 void snd_hda_apply_fixup(struct hda_codec *codec, int action);
360 void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
361 void snd_hda_pick_fixup(struct hda_codec *codec,
365 void snd_hda_pick_pin_fixup(struct hda_codec *codec,
370 /* helper macros to retrieve pin default-config values */
385 #define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8))
386 #define AMP_IN_UNMUTE(idx) (0x7000 | ((idx)<<8))
387 #define AMP_OUT_MUTE 0xb080
388 #define AMP_OUT_UNMUTE 0xb000
389 #define AMP_OUT_ZERO 0xb000
401 unsigned int snd_hda_get_default_vref(struct hda_codec *codec, hda_nid_t pin);
402 unsigned int snd_hda_correct_pin_ctl(struct hda_codec *codec,
404 int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin,
408 * _snd_hda_set_pin_ctl - Set a pin-control value safely
409 * @codec: the codec instance
411 * @val: the pin-control value (AC_PINCTL_* bits)
413 * This function sets the pin-control value to the given pin, but
414 * filters out the invalid pin-control bits when the pin has no such
416 * HP-drive capability, the HP bit is omitted.
423 snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, unsigned int val) in snd_hda_set_pin_ctl() argument
425 return _snd_hda_set_pin_ctl(codec, pin, val, false); in snd_hda_set_pin_ctl()
429 * snd_hda_set_pin_ctl_cache - Set a pin-control value safely
430 * @codec: the codec instance
432 * @val: the pin-control value (AC_PINCTL_* bits)
437 snd_hda_set_pin_ctl_cache(struct hda_codec *codec, hda_nid_t pin, in snd_hda_set_pin_ctl_cache() argument
440 return _snd_hda_set_pin_ctl(codec, pin, val, true); in snd_hda_set_pin_ctl_cache()
443 int snd_hda_codec_get_pin_target(struct hda_codec *codec, hda_nid_t nid);
444 int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid,
447 #define for_each_hda_codec_node(nid, codec) \ argument
448 for ((nid) = (codec)->core.start_nid; (nid) < (codec)->core.end_nid; (nid)++)
453 static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) in get_wcaps() argument
455 if (nid < codec->core.start_nid || in get_wcaps()
456 nid >= codec->core.start_nid + codec->core.num_nodes) in get_wcaps()
457 return 0; in get_wcaps()
458 return codec->wcaps[nid - codec->core.start_nid]; in get_wcaps()
465 return -1; /* invalid type */ in get_wcaps_type()
479 static inline void snd_hda_override_wcaps(struct hda_codec *codec, in snd_hda_override_wcaps() argument
482 if (nid >= codec->core.start_nid && in snd_hda_override_wcaps()
483 nid < codec->core.start_nid + codec->core.num_nodes) in snd_hda_override_wcaps()
484 codec->wcaps[nid - codec->core.start_nid] = val; in snd_hda_override_wcaps()
487 u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction);
488 int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
491 * snd_hda_query_pin_caps - Query PIN capabilities
492 * @codec: the HD-auio codec
502 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid) in snd_hda_query_pin_caps() argument
504 return snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); in snd_hda_query_pin_caps()
509 * snd_hda_override_pin_caps - Override the pin capabilities
510 * @codec: the CODEC
519 snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, in snd_hda_override_pin_caps() argument
522 return snd_hdac_override_parm(&codec->core, nid, AC_PAR_PIN_CAP, caps); in snd_hda_override_pin_caps()
525 bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid,
528 #define nid_has_mute(codec, nid, dir) \ argument
529 snd_hda_check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))
530 #define nid_has_volume(codec, nid, dir) \ argument
531 snd_hda_check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS)
535 #define HDA_NID_ITEM_AMP (1<<0)
544 int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
546 int snd_hda_add_nid(struct hda_codec *codec, struct snd_kcontrol *kctl,
548 void snd_hda_ctls_clear(struct hda_codec *codec);
554 int snd_hda_create_hwdep(struct hda_codec *codec);
556 static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; } in snd_hda_create_hwdep() argument
559 void snd_hda_sysfs_init(struct hda_codec *codec);
560 void snd_hda_sysfs_clear(struct hda_codec *codec);
565 const char *snd_hda_get_hint(struct hda_codec *codec, const char *key);
566 int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key);
567 int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp);
570 const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) in snd_hda_get_hint() argument
576 int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) in snd_hda_get_bool_hint() argument
578 return -ENOENT; in snd_hda_get_bool_hint()
582 int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) in snd_hda_get_int_hint() argument
584 return -ENOENT; in snd_hda_get_int_hint()
589 * power-management
592 void snd_hda_schedule_power_save(struct hda_codec *codec);
605 int snd_hda_check_amp_list_power(struct hda_codec *codec,
611 snd_hda_check_power_state(struct hda_codec *codec, hda_nid_t nid, in snd_hda_check_power_state() argument
614 return snd_hdac_check_power_state(&codec->core, nid, target_state); in snd_hda_check_power_state()
617 static inline unsigned int snd_hda_sync_power_state(struct hda_codec *codec, in snd_hda_sync_power_state() argument
621 return snd_hdac_sync_power_state(&codec->core, nid, target_state); in snd_hda_sync_power_state()
623 unsigned int snd_hda_codec_eapd_power_filter(struct hda_codec *codec,
631 #define get_amp_nid_(pv) ((pv) & 0xffff)
632 #define get_amp_nid(kc) get_amp_nid_((kc)->private_value)
633 #define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3)
634 #define get_amp_direction_(pv) (((pv) >> 18) & 0x1)
635 #define get_amp_direction(kc) get_amp_direction_((kc)->private_value)
636 #define get_amp_index_(pv) (((pv) >> 19) & 0xf)
637 #define get_amp_index(kc) get_amp_index_((kc)->private_value)
638 #define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f)
639 #define get_amp_min_mute(kc) (((kc)->private_value >> 29) & 0x1)
648 snd_hda_enum_helper_info(kcontrol, uinfo, 0, NULL)
655 int format; /* (format == 0) indicates invalid SAD */
698 int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid);
699 int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
701 int snd_hdmi_parse_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e,
703 void snd_hdmi_show_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e);
707 int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
723 #define codec_err(codec, fmt, args...) \ argument
724 dev_err(hda_codec_dev(codec), fmt, ##args)
725 #define codec_warn(codec, fmt, args...) \ argument
726 dev_warn(hda_codec_dev(codec), fmt, ##args)
727 #define codec_info(codec, fmt, args...) \ argument
728 dev_info(hda_codec_dev(codec), fmt, ##args)
729 #define codec_dbg(codec, fmt, args...) \ argument
730 dev_dbg(hda_codec_dev(codec), fmt, ##args)