summaryrefslogtreecommitdiff
path: root/sound/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-04-04 11:51:08 +0200
committerTakashi Iwai <tiwai@suse.de>2016-04-04 11:51:08 +0200
commita99e31512aa435e8391ba5f5e64abeac9c5f2f32 (patch)
tree56bb9d9ccfe76520b672249757e25f686275b204 /sound/hda
parent86c8dd7f4da3fb3f92fc5ab5144c971639d39745 (diff)
parentf03b24a851d32ca85dacab01785b24a7ee717d37 (diff)
downloadlinux-next-a99e31512aa435e8391ba5f5e64abeac9c5f2f32.tar.gz
Merge branch 'for-linus' into for-next
Conflicts: sound/hda/hdac_i915.c Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/hdac_i915.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
index d0da2508823e..6800e0c5a38f 100644
--- a/sound/hda/hdac_i915.c
+++ b/sound/hda/hdac_i915.c
@@ -287,6 +287,18 @@ int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops
}
EXPORT_SYMBOL_GPL(snd_hdac_i915_register_notifier);
+/* check whether intel graphics is present */
+static bool i915_gfx_present(void)
+{
+ static struct pci_device_id ids[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_ANY_ID),
+ .class = PCI_BASE_CLASS_DISPLAY << 16,
+ .class_mask = 0xff << 16 },
+ {}
+ };
+ return pci_dev_present(ids);
+}
+
/**
* snd_hdac_i915_init - Initialize i915 audio component
* @bus: HDA core bus
@@ -309,6 +321,9 @@ int snd_hdac_i915_init(struct hdac_bus *bus)
if (WARN_ON(hdac_acomp))
return -EBUSY;
+ if (!i915_gfx_present())
+ return -ENODEV;
+
acomp = kzalloc(sizeof(*acomp), GFP_KERNEL);
if (!acomp)
return -ENOMEM;