From patchwork Wed Jul 1 09:41:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6702551 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 0AD6B9F2F0 for ; Wed, 1 Jul 2015 09:50:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F8DA20685 for ; Wed, 1 Jul 2015 09:50:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id ED22820670 for ; Wed, 1 Jul 2015 09:50:35 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 046572610A6; Wed, 1 Jul 2015 11:50:35 +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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id D8595261583; Wed, 1 Jul 2015 11:46:14 +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 59DD82619BF; Wed, 1 Jul 2015 11:46:11 +0200 (CEST) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by alsa0.perex.cz (Postfix) with ESMTP id 170212606CB for ; Wed, 1 Jul 2015 11:43:05 +0200 (CEST) Received: by wgqq4 with SMTP id q4so31693627wgq.1 for ; Wed, 01 Jul 2015 02:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SD8pWZJJ0g23/lHLMVxc4ZdZ0Ez5wfhqF1MhvpGHNVE=; b=tIJthrl20HkQ7XEOANAhCLiE6v+rmeop1237TItO7byNY33OSI7kNUX2Ot0AA0dxsi j5OOtW6KpFrAVLbEg65ux3exT048iw8eT/Znm/T1Us76Ow6S2+mgFHrwpVXN4dN2Ettu o6qU/xBCnvce2C9ayXLCZsgNMEPug3AEkQKByU+WPdCcR6HS6hvVvZFu2Ug3/nUgdnFF B6v6XpB7WvIZa2OA7QTni0cD1MfoB8R/ytVuXtoEiIpkaWwTK8EahxYLqkpbPYFdwkYN +XkT7f0D8ud95l24rQL8KLF4jnyt81qucnqB+iuDdIV7n2ClakR1ecZZlVh9Stai/pus 98dA== X-Received: by 10.180.198.198 with SMTP id je6mr43444902wic.82.1435743784900; Wed, 01 Jul 2015 02:43:04 -0700 (PDT) Received: from cizrna.lan ([109.72.12.160]) by mx.google.com with ESMTPSA id x10sm1992663wjr.25.2015.07.01.02.43.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jul 2015 02:43:03 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Date: Wed, 1 Jul 2015 11:41:06 +0200 Message-Id: <1435743667-11987-12-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1435743667-11987-1-git-send-email-tomeu.vizoso@collabora.com> References: <1435743667-11987-1-git-send-email-tomeu.vizoso@collabora.com> Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, Tomeu Vizoso , linux-gpio@vger.kernel.org, Takashi Iwai , Liam Girdwood , Stephen Warren , "Rafael J. Wysocki" , alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, linux-acpi@vger.kernel.org, Mark Brown , linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org, Thierry Reding , Alexandre Courbot Subject: [alsa-devel] [PATCH v2 11/12] ASoC: tegra: register dependency parser for firmware nodes 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 So others can find out what dependencies a nvidia,tegra-audio-max98090 device has, as specified in bindings/sound/nvidia,tegra-audio-max98090.txt. Signed-off-by: Tomeu Vizoso --- Changes in v2: None sound/soc/tegra/tegra_max98090.c | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c index 902da36..0f7cbf3 100644 --- a/sound/soc/tegra/tegra_max98090.c +++ b/sound/soc/tegra/tegra_max98090.c @@ -316,7 +316,47 @@ static struct platform_driver tegra_max98090_driver = { .probe = tegra_max98090_probe, .remove = tegra_max98090_remove, }; -module_platform_driver(tegra_max98090_driver); + +static void add_dependency(struct fwnode_handle *fwnode, + const char *property, + struct list_head *deps) +{ + struct device_node *np; + + np = of_parse_phandle(to_of_node(fwnode), property, 0); + if (!np) + return; + + fwnode_add_dependency(&np->fwnode, deps); +} + +static void tegra_max98090_get_dependencies(struct fwnode_handle *fwnode, + struct list_head *deps) +{ + add_dependency(fwnode, "nvidia,i2s-controller", deps); + add_dependency(fwnode, "nvidia,audio-codec", deps); +} + +static int __init tegra_max98090_init(void) +{ + int err; + + err = platform_driver_register(&tegra_max98090_driver); + if (err < 0) + return err; + + fwnode_add_dependency_parser(tegra_max98090_get_dependencies); + + return 0; +} +module_init(tegra_max98090_init); + +static void __exit tegra_max98090_exit(void) +{ + fwnode_remove_dependency_parser(tegra_max98090_get_dependencies); + platform_driver_unregister(&tegra_max98090_driver); +} +module_exit(tegra_max98090_exit); MODULE_AUTHOR("Stephen Warren "); MODULE_DESCRIPTION("Tegra max98090 machine ASoC driver");