aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h51
1 files changed, 9 insertions, 42 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 618ddad1723..aca8d3193b9 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -394,11 +394,12 @@ struct auto_pin_cfg_item {
394}; 394};
395 395
396struct auto_pin_cfg; 396struct auto_pin_cfg;
397const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin,
398 int check_location);
399const char *hda_get_autocfg_input_label(struct hda_codec *codec, 397const char *hda_get_autocfg_input_label(struct hda_codec *codec,
400 const struct auto_pin_cfg *cfg, 398 const struct auto_pin_cfg *cfg,
401 int input); 399 int input);
400int snd_hda_get_pin_label(struct hda_codec *codec, hda_nid_t nid,
401 const struct auto_pin_cfg *cfg,
402 char *label, int maxlen, int *indexp);
402int snd_hda_add_imux_item(struct hda_input_mux *imux, const char *label, 403int snd_hda_add_imux_item(struct hda_input_mux *imux, const char *label,
403 int index, int *type_index_ret); 404 int index, int *type_index_ret);
404 405
@@ -487,7 +488,12 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid)
487} 488}
488 489
489/* get the widget type from widget capability bits */ 490/* get the widget type from widget capability bits */
490#define get_wcaps_type(wcaps) (((wcaps) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT) 491static inline int get_wcaps_type(unsigned int wcaps)
492{
493 if (!wcaps)
494 return -1; /* invalid type */
495 return (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
496}
491 497
492static inline unsigned int get_wcaps_channels(u32 wcaps) 498static inline unsigned int get_wcaps_channels(u32 wcaps)
493{ 499{
@@ -505,21 +511,6 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
505u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); 511u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid);
506int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, 512int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid,
507 unsigned int caps); 513 unsigned int caps);
508u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid);
509int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid);
510
511static inline bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid)
512{
513 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT))
514 return false;
515 if (!codec->ignore_misc_bit &&
516 (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
517 AC_DEFCFG_MISC_NO_PRESENCE))
518 return false;
519 if (!(get_wcaps(codec, nid) & AC_WCAP_UNSOL_CAP))
520 return false;
521 return true;
522}
523 514
524/* flags for hda_nid_item */ 515/* flags for hda_nid_item */
525#define HDA_NID_ITEM_AMP (1<<0) 516#define HDA_NID_ITEM_AMP (1<<0)
@@ -688,28 +679,4 @@ static inline void snd_hda_eld_proc_free(struct hda_codec *codec,
688#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80 679#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80
689void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen); 680void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
690 681
691/*
692 * Input-jack notification support
693 */
694#ifdef CONFIG_SND_HDA_INPUT_JACK
695int snd_hda_input_jack_add(struct hda_codec *codec, hda_nid_t nid, int type,
696 const char *name);
697void snd_hda_input_jack_report(struct hda_codec *codec, hda_nid_t nid);
698void snd_hda_input_jack_free(struct hda_codec *codec);
699#else /* CONFIG_SND_HDA_INPUT_JACK */
700static inline int snd_hda_input_jack_add(struct hda_codec *codec,
701 hda_nid_t nid, int type,
702 const char *name)
703{
704 return 0;
705}
706static inline void snd_hda_input_jack_report(struct hda_codec *codec,
707 hda_nid_t nid)
708{
709}
710static inline void snd_hda_input_jack_free(struct hda_codec *codec)
711{
712}
713#endif /* CONFIG_SND_HDA_INPUT_JACK */
714
715#endif /* __SOUND_HDA_LOCAL_H */ 682#endif /* __SOUND_HDA_LOCAL_H */