diff options
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r-- | sound/pci/hda/hda_local.h | 51 |
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 | ||
396 | struct auto_pin_cfg; | 396 | struct auto_pin_cfg; |
397 | const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin, | ||
398 | int check_location); | ||
399 | const char *hda_get_autocfg_input_label(struct hda_codec *codec, | 397 | const 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); |
400 | int 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); | ||
402 | int snd_hda_add_imux_item(struct hda_input_mux *imux, const char *label, | 403 | int 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) | 491 | static 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 | ||
492 | static inline unsigned int get_wcaps_channels(u32 wcaps) | 498 | static 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, | |||
505 | u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); | 511 | u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid); |
506 | int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, | 512 | int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid, |
507 | unsigned int caps); | 513 | unsigned int caps); |
508 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid); | ||
509 | int snd_hda_jack_detect(struct hda_codec *codec, hda_nid_t nid); | ||
510 | |||
511 | static 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 |
689 | void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen); | 680 | void 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 | ||
695 | int snd_hda_input_jack_add(struct hda_codec *codec, hda_nid_t nid, int type, | ||
696 | const char *name); | ||
697 | void snd_hda_input_jack_report(struct hda_codec *codec, hda_nid_t nid); | ||
698 | void snd_hda_input_jack_free(struct hda_codec *codec); | ||
699 | #else /* CONFIG_SND_HDA_INPUT_JACK */ | ||
700 | static 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 | } | ||
706 | static inline void snd_hda_input_jack_report(struct hda_codec *codec, | ||
707 | hda_nid_t nid) | ||
708 | { | ||
709 | } | ||
710 | static 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 */ |