From patchwork Thu Sep 17 10:00:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 7205231 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E9709F336 for ; Thu, 17 Sep 2015 10:01:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3473207B6 for ; Thu, 17 Sep 2015 10:01:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 111A1207D1 for ; Thu, 17 Sep 2015 10:01:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1D8A82657C9; Thu, 17 Sep 2015 12:01:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AD012265715; Thu, 17 Sep 2015 12:00:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 86727265707; Thu, 17 Sep 2015 12:00:19 +0200 (CEST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by alsa0.perex.cz (Postfix) with ESMTP id 4975226568C for ; Thu, 17 Sep 2015 12:00:11 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so16398048wic.1 for ; Thu, 17 Sep 2015 03:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CeOaHLbjZG5lXF53fIV/V4s1jBRCzX22HUsZJymVB6w=; b=AhCTMwZUInFgVvGxVLEY2xO1dcf8vekGn7WYsNg1AVy1zl3tf9I4g9n60Vfb1u6vCp Y/3fxj97hBQFNfPx6NzJ5D+VUZdvw9S9KRjjVel2PPHWjPwn4vLCKDsEvowOEKpIb4kG tb4oDfIcCVabLTs1EhvlBdqKinAW60DZHLoyOD+8lq9e0UK3xLGZ3ZsJt76fkD4hZ6qj 9wQIq5KF/fgiilOlfbjXSNFmGRAPgDgCi6wfwo3jEROxV2JsubsCvSV0gUNzDJtFNGlN 4Vx3N/kkvzTCTsoasVMMfonRf6hshMLuD1uaIcDjQdawJ1QadHubXZ6+1pZRZ3gwEWxo sYJw== X-Received: by 10.194.123.4 with SMTP id lw4mr60000470wjb.94.1442484011023; Thu, 17 Sep 2015 03:00:11 -0700 (PDT) Received: from localhost (port-4883.pppoe.wtnet.de. [84.46.19.38]) by smtp.gmail.com with ESMTPSA id az6sm9199619wib.12.2015.09.17.03.00.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 03:00:10 -0700 (PDT) From: Thierry Reding To: Takashi Iwai Date: Thu, 17 Sep 2015 12:00:05 +0200 Message-Id: <1442484006-9614-3-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442484006-9614-1-git-send-email-thierry.reding@gmail.com> References: <1442484006-9614-1-git-send-email-thierry.reding@gmail.com> Cc: alsa-devel@alsa-project.org, Kevin Hilman , Tyler Baker , linux-kernel@vger.kernel.org, Jon Hunter , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 2/3] ALSA: hda - Advertise MODALIAS in uevent X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding By setting the MODALIAS variable in uevents, userspace helpers will be enabled to load modules via the module alias associated with a device. This information is required to automatically load HDA codec drivers instead of having to explicitly request the various modules in the HDA core code. Signed-off-by: Thierry Reding --- sound/hda/hda_bus_type.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/hda/hda_bus_type.c b/sound/hda/hda_bus_type.c index 89c2711baaaf..5adf24c9f9cc 100644 --- a/sound/hda/hda_bus_type.c +++ b/sound/hda/hda_bus_type.c @@ -63,9 +63,21 @@ static int hda_bus_match(struct device *dev, struct device_driver *drv) return 1; } +static int hda_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct hdac_device *hdev = dev_to_hdac_dev(dev); + + if (add_uevent_var(env, "MODALIAS=snd-hda-codec-id:%08x", + hdev->vendor_id)) + return -ENOMEM; + + return 0; +} + struct bus_type snd_hda_bus_type = { .name = "hdaudio", .match = hda_bus_match, + .uevent = hda_uevent, }; EXPORT_SYMBOL_GPL(snd_hda_bus_type);