Lines Matching +full:codec +full:- +full:1

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Universal Interface for Intel High Definition Audio Codec
17 * snd_hda_ctl_add() takes the lower-bit subdev value as a valid NID.
22 #define HDA_SUBDEV_NID_FLAG (1U << 31)
23 #define HDA_SUBDEV_AMP_FLAG (1U << 30)
30 #define HDA_AMP_VAL_MIN_MUTE (1<<29)
33 /* mono volume with index (index=0,1,...) (channel=1,2) */
58 /* mono mute switch with index (index=0,1,...) (channel=1,2) */
76 /* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */
85 /* no digital beep - just the standard one */
119 #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \ argument
120 snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx)
121 int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
123 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
125 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
127 int snd_hda_codec_amp_init_stereo(struct hda_codec *codec, hda_nid_t nid,
129 void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
131 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
133 int __snd_hda_add_vmaster(struct hda_codec *codec, char *name,
137 #define snd_hda_add_vmaster(codec, name, tlv, followers, suffix, access) \ argument
138 __snd_hda_add_vmaster(codec, name, tlv, followers, suffix, true, access, NULL)
139 int snd_hda_codec_reset(struct hda_codec *codec);
140 void snd_hda_codec_disconnect_pcms(struct hda_codec *codec);
142 #define snd_hda_regmap_sync(codec) snd_hdac_regmap_sync(&(codec)->core) argument
151 struct hda_codec *codec; member
154 int snd_hda_add_vmaster_hook(struct hda_codec *codec,
166 int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
169 #define snd_hda_create_spdif_out_ctls(codec, anid, cnid) \ argument
170 snd_hda_create_dig_out_ctls(codec, anid, cnid, HDA_PCM_TYPE_SPDIF)
171 int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid);
188 int snd_hda_input_mux_put(struct hda_codec *codec,
192 int snd_hda_add_imux_item(struct hda_codec *codec,
197 * Multi-channel / digital-out PCM helper
206 int num_dacs; /* # of DACs, must be more than 1 */
226 int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
228 int snd_hda_multi_out_dig_open(struct hda_codec *codec,
230 int snd_hda_multi_out_dig_close(struct hda_codec *codec,
232 int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
237 int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
239 int snd_hda_multi_out_analog_open(struct hda_codec *codec,
243 int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
248 int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
255 int snd_hda_codec_proc_new(struct hda_codec *codec);
257 static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; } in snd_hda_codec_proc_new() argument
266 int snd_hda_add_new_ctls(struct hda_codec *codec,
270 * Fix-up pin default configurations and add default verbs
285 bool chained:1; /* call the chained fixup(s) after this */
286 bool chained_before:1; /* call the chained fixup(s) before this */
291 void (*func)(struct hda_codec *codec,
300 * for codec SSID matching, use the new HDA_CODEC_QUIRK() instead
306 bool match_codec_ssid; /* match only with codec SSID */
324 unsigned int codec; /* Codec vendor/device ID */ member
336 { .codec = _codec,\
345 { .codec = _codec,\
353 #define HDA_FIXUP_ID_NOT_SET -1
354 #define HDA_FIXUP_ID_NO_FIXUP -2
374 int snd_hda_add_verbs(struct hda_codec *codec, const struct hda_verb *list);
375 void snd_hda_apply_verbs(struct hda_codec *codec);
376 void snd_hda_apply_pincfgs(struct hda_codec *codec,
378 void snd_hda_apply_fixup(struct hda_codec *codec, int action);
379 void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
380 void snd_hda_pick_fixup(struct hda_codec *codec,
384 void snd_hda_pick_pin_fixup(struct hda_codec *codec,
389 /* helper macros to retrieve pin default-config values */
420 unsigned int snd_hda_get_default_vref(struct hda_codec *codec, hda_nid_t pin);
421 unsigned int snd_hda_correct_pin_ctl(struct hda_codec *codec,
423 int _snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin,
427 * _snd_hda_set_pin_ctl - Set a pin-control value safely
428 * @codec: the codec instance
430 * @val: the pin-control value (AC_PINCTL_* bits)
432 * This function sets the pin-control value to the given pin, but
433 * filters out the invalid pin-control bits when the pin has no such
435 * HP-drive capability, the HP bit is omitted.
442 snd_hda_set_pin_ctl(struct hda_codec *codec, hda_nid_t pin, unsigned int val) in snd_hda_set_pin_ctl() argument
444 return _snd_hda_set_pin_ctl(codec, pin, val, false); in snd_hda_set_pin_ctl()
448 * snd_hda_set_pin_ctl_cache - Set a pin-control value safely
449 * @codec: the codec instance
451 * @val: the pin-control value (AC_PINCTL_* bits)
456 snd_hda_set_pin_ctl_cache(struct hda_codec *codec, hda_nid_t pin, in snd_hda_set_pin_ctl_cache() argument
459 return _snd_hda_set_pin_ctl(codec, pin, val, true); in snd_hda_set_pin_ctl_cache()
462 int snd_hda_codec_get_pin_target(struct hda_codec *codec, hda_nid_t nid);
463 int snd_hda_codec_set_pin_target(struct hda_codec *codec, hda_nid_t nid,
466 #define for_each_hda_codec_node(nid, codec) \ argument
467 for ((nid) = (codec)->core.start_nid; (nid) < (codec)->core.end_nid; (nid)++)
469 /* Set the codec power_state flag to indicate to allow unsol event handling;
473 static inline void snd_hda_codec_allow_unsol_events(struct hda_codec *codec) in snd_hda_codec_allow_unsol_events() argument
475 codec->core.dev.power.power_state = PMSG_ON; in snd_hda_codec_allow_unsol_events()
481 static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) in get_wcaps() argument
483 if (nid < codec->core.start_nid || in get_wcaps()
484 nid >= codec->core.start_nid + codec->core.num_nodes) in get_wcaps()
486 return codec->wcaps[nid - codec->core.start_nid]; in get_wcaps()
493 return -1; /* invalid type */ in get_wcaps_type()
502 chans = ((chans << 1) | 1) + 1; in get_wcaps_channels()
507 static inline void snd_hda_override_wcaps(struct hda_codec *codec, in snd_hda_override_wcaps() argument
510 if (nid >= codec->core.start_nid && in snd_hda_override_wcaps()
511 nid < codec->core.start_nid + codec->core.num_nodes) in snd_hda_override_wcaps()
512 codec->wcaps[nid - codec->core.start_nid] = val; in snd_hda_override_wcaps()
515 u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction);
516 int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
519 * snd_hda_query_pin_caps - Query PIN capabilities
520 * @codec: the HD-auio codec
530 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid) in snd_hda_query_pin_caps() argument
532 return snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); in snd_hda_query_pin_caps()
537 * snd_hda_override_pin_caps - Override the pin capabilities
538 * @codec: the CODEC
547 snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, in snd_hda_override_pin_caps() argument
550 return snd_hdac_override_parm(&codec->core, nid, AC_PAR_PIN_CAP, caps); in snd_hda_override_pin_caps()
553 bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid,
556 #define nid_has_mute(codec, nid, dir) \ argument
557 snd_hda_check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))
558 #define nid_has_volume(codec, nid, dir) \ argument
559 snd_hda_check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS)
563 #define HDA_NID_ITEM_AMP (1<<0)
572 int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
574 void snd_hda_ctls_clear(struct hda_codec *codec);
580 int snd_hda_create_hwdep(struct hda_codec *codec);
582 static inline int snd_hda_create_hwdep(struct hda_codec *codec) { return 0; } in snd_hda_create_hwdep() argument
585 void snd_hda_sysfs_init(struct hda_codec *codec);
586 void snd_hda_sysfs_clear(struct hda_codec *codec);
591 const char *snd_hda_get_hint(struct hda_codec *codec, const char *key);
592 int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key);
593 int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp);
596 const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) in snd_hda_get_hint() argument
602 int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) in snd_hda_get_bool_hint() argument
604 return -ENOENT; in snd_hda_get_bool_hint()
608 int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) in snd_hda_get_int_hint() argument
610 return -ENOENT; in snd_hda_get_int_hint()
615 * power-management
618 void snd_hda_schedule_power_save(struct hda_codec *codec);
631 int snd_hda_check_amp_list_power(struct hda_codec *codec,
637 snd_hda_check_power_state(struct hda_codec *codec, hda_nid_t nid, in snd_hda_check_power_state() argument
640 return snd_hdac_check_power_state(&codec->core, nid, target_state); in snd_hda_check_power_state()
643 static inline unsigned int snd_hda_sync_power_state(struct hda_codec *codec, in snd_hda_sync_power_state() argument
647 return snd_hdac_sync_power_state(&codec->core, nid, target_state); in snd_hda_sync_power_state()
649 unsigned int snd_hda_codec_eapd_power_filter(struct hda_codec *codec,
653 void snd_hda_codec_shutdown(struct hda_codec *codec);
655 static inline int snd_hda_codec_init(struct hda_codec *codec) in snd_hda_codec_init() argument
657 struct hda_codec_driver *driver = hda_codec_to_driver(codec); in snd_hda_codec_init()
659 if (driver->ops->init) in snd_hda_codec_init()
660 return driver->ops->init(codec); in snd_hda_codec_init()
669 #define get_amp_nid(kc) get_amp_nid_((kc)->private_value)
670 #define get_amp_channels(kc) (((kc)->private_value >> 16) & 0x3)
672 #define get_amp_direction(kc) get_amp_direction_((kc)->private_value)
674 #define get_amp_index(kc) get_amp_index_((kc)->private_value)
675 #define get_amp_offset(kc) (((kc)->private_value >> 23) & 0x3f)
676 #define get_amp_min_mute(kc) (((kc)->private_value >> 29) & 0x1)
695 int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid);
696 int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
712 void snd_hda_codec_display_power(struct hda_codec *codec, bool enable);
716 #define codec_err(codec, fmt, args...) \ argument
717 dev_err(hda_codec_dev(codec), fmt, ##args)
718 #define codec_warn(codec, fmt, args...) \ argument
719 dev_warn(hda_codec_dev(codec), fmt, ##args)
720 #define codec_info(codec, fmt, args...) \ argument
721 dev_info(hda_codec_dev(codec), fmt, ##args)
722 #define codec_dbg(codec, fmt, args...) \ argument
723 dev_dbg(hda_codec_dev(codec), fmt, ##args)