From 8857c7d065e900a0b3829c97634c99501b606541 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 8 Feb 2019 00:27:59 +0100 Subject: i915/snd_hdac: I915 subcomponent for the snd_hdac Since we need multiple components for I915 for different purposes (Audio & Mei_hdcp), we adopt the subcomponents methodology introduced by the previous patch (mentioned below). Author: Daniel Vetter Date: Mon Jan 28 17:08:20 2019 +0530 components: multiple components for a device Reviewed-by: Takashi Iwai Signed-off-by-by: Ramalingam C (commit message) Signed-off-by: Daniel Vetter (code) cc: Greg Kroah-Hartman cc: Russell King cc: Rafael J. Wysocki cc: Jaroslav Kysela cc: Takashi Iwai cc: Rodrigo Vivi cc: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20190207232759.14553-4-daniel.vetter@ffwll.ch --- sound/hda/hdac_component.c | 4 ++-- sound/hda/hdac_i915.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'sound/hda') diff --git a/sound/hda/hdac_component.c b/sound/hda/hdac_component.c index a6d37b9d6413..5c95933e739a 100644 --- a/sound/hda/hdac_component.c +++ b/sound/hda/hdac_component.c @@ -269,7 +269,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_acomp_register_notifier); */ int snd_hdac_acomp_init(struct hdac_bus *bus, const struct drm_audio_component_audio_ops *aops, - int (*match_master)(struct device *, void *), + int (*match_master)(struct device *, int, void *), size_t extra_size) { struct component_match *match = NULL; @@ -288,7 +288,7 @@ int snd_hdac_acomp_init(struct hdac_bus *bus, bus->audio_component = acomp; devres_add(dev, acomp); - component_match_add(dev, &match, match_master, bus); + component_match_add_typed(dev, &match, match_master, bus); ret = component_master_add_with_match(dev, &hdac_component_master_ops, match); if (ret < 0) diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 617ff1aa818f..7aee090e3d27 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -82,9 +82,11 @@ void snd_hdac_i915_set_bclk(struct hdac_bus *bus) } EXPORT_SYMBOL_GPL(snd_hdac_i915_set_bclk); -static int i915_component_master_match(struct device *dev, void *data) +static int i915_component_master_match(struct device *dev, int subcomponent, + void *data) { - return !strcmp(dev->driver->name, "i915"); + return !strcmp(dev->driver->name, "i915") && + subcomponent == I915_COMPONENT_AUDIO; } /* check whether intel graphics is present */ -- cgit v1.2.3