Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp989031imj; Thu, 7 Feb 2019 15:28:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IZnM97oa4lzAM0xkx0wrehv7h2pfIyka+vXiTHfxrVz/u7/zycD4yQ1uRvXodHsmyalGebe X-Received: by 2002:a63:fb15:: with SMTP id o21mr17222910pgh.211.1549582123922; Thu, 07 Feb 2019 15:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549582123; cv=none; d=google.com; s=arc-20160816; b=Skuu+HwRe+WwykbnjNnoyuZPXzHBi+pVja4bFD7iCHINtMUUHj7Zb5h/WgBJ5BAsqA ifaWV1EAWtygp5gpGWCkPUDGuPxcFByg3XRQCFqlykXQ9Gsqrtkh6rsyo3N9qJ46eLU0 Tru1CRxDpkUXf22GiijqHXLIUHoZW+mXDyXW6G2ILTNAzR6XrMuPXoX0EqRatJdfmdyt UCqMuZ0GjBQAm0C3aBcY1jefGYtdjo1Rb/bwnVHWiabISBjG4ILDexycnDDgiNlecJrT iwfRPDvX1wb9qrz87673lZB0JGzZUl6Qz72c/1iA93P+prz3vH8+2UkPVvwilAQTJNX4 V1Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=szaf2uJAgssLbFJ9fk1DVjNOf7TVO+Qt3SlgBscvgUg=; b=vnItHQTEBLetfz9e8wKYFqvtDoQbL5l7hURMmtusDfSllBFiqiBD6pJQVFDdtFGiTf 62gQTJFjyaiQ1+grlGoMul2FJk+kiVdNh5dYsDARyVT95wvqGI2PrSjD3X174ZBVTXpj /PgBORd+9sRVT/ouAg8061zs1iiFyJF7rcYPkdPxiGQJ6nN1F6e579Rar3Ny6valeRoa kt/240PRWsjN24uoXB6jkjDwT8QgBbmCm82Y7pLUAaEeBbDdw2WeSCoS5tmKa6DpwV83 0HJoH8Gh+A4zXc7QKH1A8yf16toUFml/q3/G/qdBlUxli3io9Jv6khA5o56VyKtQB0rC oQMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="ho/8mP4o"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z86si358175pfl.209.2019.02.07.15.28.28; Thu, 07 Feb 2019 15:28:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b="ho/8mP4o"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbfBGX2N (ORCPT + 99 others); Thu, 7 Feb 2019 18:28:13 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42413 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbfBGX2M (ORCPT ); Thu, 7 Feb 2019 18:28:12 -0500 Received: by mail-ed1-f67.google.com with SMTP id r15so1297601eds.9 for ; Thu, 07 Feb 2019 15:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=szaf2uJAgssLbFJ9fk1DVjNOf7TVO+Qt3SlgBscvgUg=; b=ho/8mP4oD9JLLci6xgsOGv2oUuUmPvlygcrW6DeXjX3C4OaeAajoMYwiJL3HrNxLP9 39WY2P0kcnKll+1Cn87DTr1b8b3o5GMrPRbsaqpqCJw6L3yoFZC4eIVgwGPoJrhekUqN Peu4i5tkC9p39G7L71X+Fh4l4NuOOydX56e/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=szaf2uJAgssLbFJ9fk1DVjNOf7TVO+Qt3SlgBscvgUg=; b=CF97TK9n3yEKIVq7nUyWfqrK3jlO0y9sNan8fRdEGy+Su1akkQD+lxtQqtAkNdhI23 5JtihGiQUybF7cFx+K52XwiG6mMrRBLRDveAMutl4UNp31Y7ZGhM/bdXbesajE1ynV0g JGte7kOeJ2ytqAy3sQlkFPFceIkYdS9ir2Kx/lZPdWIaUGD4xhii3rx7JGKu/JoViDUr EzwFiRU1bNUL5NrZBWRwJnYy6Yqbtn+LUH5bRd76wNeFXKtinMpvS0jbKMIzpDkHx59I gnnjKNrBIxCY/v6Qg7KDYwe8fIiLH1a8mRv26cmqJ1qWXW8Tv+ajap5LgfVuFQ6A5wWw E39Q== X-Gm-Message-State: AHQUAuYF4CMDwIUFZmBy0GriUU32G0hLwzTdGiVz2cKoyv467VwwZggA 4TYViC4GMFnoSOG5gnqIq1SQgw== X-Received: by 2002:aa7:d41a:: with SMTP id z26mr4962957edq.224.1549582089990; Thu, 07 Feb 2019 15:28:09 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id p7sm145079ejb.15.2019.02.07.15.28.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 15:28:09 -0800 (PST) From: Daniel Vetter To: DRI Development Cc: Intel Graphics Development , LKML , Daniel Vetter , Takashi Iwai , Ramalingam C , Greg Kroah-Hartman , Russell King , "Rafael J . Wysocki" , Jaroslav Kysela , Takashi Iwai , Rodrigo Vivi , Jani Nikula Subject: [PATCH 4/4] i915/snd_hdac: I915 subcomponent for the snd_hdac Date: Fri, 8 Feb 2019 00:27:59 +0100 Message-Id: <20190207232759.14553-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207232759.14553-1-daniel.vetter@ffwll.ch> References: <20190207232759.14553-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/i915/intel_audio.c | 4 +++- include/drm/i915_component.h | 4 ++++ include/sound/hda_component.h | 5 +++-- sound/hda/hdac_component.c | 4 ++-- sound/hda/hdac_i915.c | 6 ++++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index de26cd0a5497..5104c6bbd66f 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -984,7 +984,9 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv) { int ret; - ret = component_add(dev_priv->drm.dev, &i915_audio_component_bind_ops); + ret = component_add_typed(dev_priv->drm.dev, + &i915_audio_component_bind_ops, + I915_COMPONENT_AUDIO); if (ret < 0) { DRM_ERROR("failed to add audio component (%d)\n", ret); /* continue with reduced functionality */ diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index fca22d463e1b..72fbb037f9b3 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -26,6 +26,10 @@ #include "drm_audio_component.h" +enum i915_component_type { + I915_COMPONENT_AUDIO = 1, +}; + /* MAX_PORT is the number of port * It must be sync with I915_MAX_PORTS defined i915_drv.h */ diff --git a/include/sound/hda_component.h b/include/sound/hda_component.h index 2ec31b358950..d4804c72d959 100644 --- a/include/sound/hda_component.h +++ b/include/sound/hda_component.h @@ -20,7 +20,7 @@ int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id, bool *audio_enabled, char *buffer, int max_bytes); 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); int snd_hdac_acomp_exit(struct hdac_bus *bus); int snd_hdac_acomp_register_notifier(struct hdac_bus *bus, @@ -47,7 +47,8 @@ static inline int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t ni } static inline 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) { return -ENODEV; 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 */ -- 2.20.1