From patchwork Fri Apr 29 06:31:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12831479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38C2BC433FE for ; Fri, 29 Apr 2022 06:31:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 174F410FB93; Fri, 29 Apr 2022 06:31:30 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8073E10FB92; Fri, 29 Apr 2022 06:31:28 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B1CBF61D94; Fri, 29 Apr 2022 06:31:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21056C385AF; Fri, 29 Apr 2022 06:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651213887; bh=gGK7/gBcj48QlxuUQ6aLxtWNQgyWkYr7fybLKh0KD5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MbmY5wfpkIXYzVOY7GrWXGECIEPh4shZM0RuPaXg/0Pj3b62Ok4OxUHJfO1disdc6 v/aNccc7zhdMTWUjzv5GKqeWAEITIiynZ6Aq6cIGLE+EBCAx5+L476WZThSPpLXa6t 93I/1eyw5mATjnSM7HXiPsJTeYs7BRTIDy+YKdEK0lfz70yTYjYuZudGITkfd12rPj 4lgICGJ6SnFQQabh9SmD4Y5XX1+q+ES4gWn9BshAcmn1NlMVOiDEhdEBaY1ksWxClF c+WWMHte6ENzDZX0deLkyoqvooI1c0bqPgRHYQWbVS/NqRZTJerGzZEl3CfpyzrvSW g26ODSGzqn1EA== Received: from mchehab by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1nkK9z-001Qml-NN; Fri, 29 Apr 2022 07:31:23 +0100 From: Mauro Carvalho Chehab To: Luis Chamberlain Date: Fri, 29 Apr 2022 07:31:16 +0100 Message-Id: <5c3a968858a05c27e299eadf2a925d4aa91ac17a.1651212016.git.mchehab@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] ALSA: hda - identify when audio is provided by a video driver X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Kai Vehmanen , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, Lucas De Marchi , Takashi Iwai , dri-devel@lists.freedesktop.org, Jaroslav Kysela , David Airlie , mauro.chehab@intel.com, Mauro Carvalho Chehab , Pierre-Louis Bossart Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On some devices, the hda driver needs to hook into a video driver, in order to be able to properly access the audio hardware and/or the power management function. That's the case of several snd_hda_intel devices that depends on i915 driver. Currently, this dependency is hidden from /proc/modules and from lsmod, making harder to identify the need to unbind the audio driver before being able to unbind the i915 driver. Add a reference for it at the module dependency, in order to allow userspace to identify it, and print a message on such cases. Signed-off-by: Mauro Carvalho Chehab --- See [PATCH 0/2] at: https://lore.kernel.org/all/cover.1651212016.git.mchehab@kernel.org/ sound/hda/hdac_component.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/hda/hdac_component.c b/sound/hda/hdac_component.c index bb37e7e0bd79..103c6be8be1e 100644 --- a/sound/hda/hdac_component.c +++ b/sound/hda/hdac_component.c @@ -211,6 +211,14 @@ static int hdac_component_master_bind(struct device *dev) } complete_all(&acomp->master_bind_complete); + + if (acomp->ops->owner && acomp->ops->owner->name) { + dev_info(dev, "audio component provided by %s driver\n", + acomp->ops->owner->name); + module_add_named_dependency(acomp->ops->owner->name, + dev->driver->owner); + } + return 0; module_put: