ALSA: hda - Add missing terminating entry to SND_HDA_PIN_QUIRK macro
[sfrench/cifs-2.6.git] / sound / pci / hda / hda_local.h
index 8a018d4cbe98ccddbcb0612f0666ebf9ed222a83..62658f2f8c9f2db94fca481a86da8432858105a0 100644 (file)
@@ -419,7 +419,7 @@ struct snd_hda_pin_quirk {
          .subvendor = _subvendor,\
          .name = _name,\
          .value = _value,\
-         .pins = (const struct hda_pintbl[]) { _pins } \
+         .pins = (const struct hda_pintbl[]) { _pins, {0, 0}} \
        }
 #else
 
@@ -427,7 +427,7 @@ struct snd_hda_pin_quirk {
        { .codec = _codec,\
          .subvendor = _subvendor,\
          .value = _value,\
-         .pins = (const struct hda_pintbl[]) { _pins } \
+         .pins = (const struct hda_pintbl[]) { _pins, {0, 0}} \
        }
 
 #endif
@@ -603,6 +603,14 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
 u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid);
 int snd_hda_override_pin_caps(struct hda_codec *codec, hda_nid_t nid,
                              unsigned int caps);
+bool snd_hda_check_amp_caps(struct hda_codec *codec, hda_nid_t nid,
+                          int dir, unsigned int bits);
+
+#define nid_has_mute(codec, nid, dir) \
+       snd_hda_check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))
+#define nid_has_volume(codec, nid, dir) \
+       snd_hda_check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS)
+
 
 /* flags for hda_nid_item */
 #define HDA_NID_ITEM_AMP       (1<<0)