md/raid: only permit hot-add of compatible integrity profiles
[linux/fpc-iii.git] / sound / pci / hda / local.h
blob28cb7f98982ec7b4145c6056d2d5266f21c442bd
1 /*
2 */
4 #ifndef __HDAC_LOCAL_H
5 #define __HDAC_LOCAL_H
7 int hdac_read_parm(struct hdac_device *codec, hda_nid_t nid, int parm);
9 #define get_wcaps(codec, nid) \
10 hdac_read_parm(codec, nid, AC_PAR_AUDIO_WIDGET_CAP)
11 /* get the widget type from widget capability bits */
12 static inline int get_wcaps_type(unsigned int wcaps)
14 if (!wcaps)
15 return -1; /* invalid type */
16 return (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
19 #define get_pin_caps(codec, nid) \
20 hdac_read_parm(codec, nid, AC_PAR_PIN_CAP)
22 static inline
23 unsigned int get_pin_cfg(struct hdac_device *codec, hda_nid_t nid)
25 unsigned int val;
27 if (snd_hdac_read(codec, nid, AC_VERB_GET_CONFIG_DEFAULT, 0, &val))
28 return -1;
29 return val;
32 #define get_amp_caps(codec, nid, dir) \
33 hdac_read_parm(codec, nid, (dir) == HDA_OUTPUT ? \
34 AC_PAR_AMP_OUT_CAP : AC_PAR_AMP_IN_CAP)
36 #define get_power_caps(codec, nid) \
37 hdac_read_parm(codec, nid, AC_PAR_POWER_STATE)
39 #endif /* __HDAC_LOCAL_H */