~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to sound/pci/hda/hda_local.h

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
394
394
};
395
395
 
396
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
397
const char *hda_get_autocfg_input_label(struct hda_codec *codec,
400
398
                                        const struct auto_pin_cfg *cfg,
401
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
403
int snd_hda_add_imux_item(struct hda_input_mux *imux, const char *label,
403
404
                          int index, int *type_index_ret);
404
405
 
487
488
}
488
489
 
489
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
498
static inline unsigned int get_wcaps_channels(u32 wcaps)
493
499
{
505
511
u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid);
506
512
int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid,
507
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
515
/* flags for hda_nid_item */
525
516
#define HDA_NID_ITEM_AMP        (1<<0)
688
679
#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80
689
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
682
#endif /* __SOUND_HDA_LOCAL_H */