From patchwork Thu Nov 5 09:59:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengdong.lin@linux.intel.com X-Patchwork-Id: 7559511 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 65D0C9F4F5 for ; Thu, 5 Nov 2015 09:47:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9033020575 for ; Thu, 5 Nov 2015 09:47:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 662FE20501 for ; Thu, 5 Nov 2015 09:47:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9B45B266085; Thu, 5 Nov 2015 10:47:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 91FA6265AE4; Thu, 5 Nov 2015 10:44:47 +0100 (CET) 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 D6278265B94; Thu, 5 Nov 2015 10:44:45 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 66922265AE4 for ; Thu, 5 Nov 2015 10:43:45 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 05 Nov 2015 01:43:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,247,1444719600"; d="scan'208";a="843679640" Received: from amanda-hsw-pc.sh.intel.com ([10.239.159.75]) by fmsmga002.fm.intel.com with ESMTP; 05 Nov 2015 01:43:43 -0800 From: mengdong.lin@linux.intel.com To: alsa-devel@alsa-project.org, broonie@kernel.org Date: Thu, 5 Nov 2015 17:59:11 +0800 Message-Id: <7dc5e61b6df2eb7ae52ded08f7928b7ae519d069.1446717205.git.mengdong.lin@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Mengdong Lin , tiwai@suse.de, mengdong.lin@intel.com, liam.r.girdwood@linux.intel.com, vinod.koul@intel.com, jeeja.kp@intel.com, subhransu.s.prusty@intel.com Subject: [alsa-devel] [PATCH v2 06/13] ASoC: Add add_dai_link ops for a soc card 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: Mengdong Lin When a new DAI link is added, the ASoC core will call this ops to notify a machine driver for extra intialization. Signed-off-by: Mengdong Lin diff --git a/include/sound/soc.h b/include/sound/soc.h index 60e5fda..9a0e0e8 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1103,6 +1103,9 @@ struct snd_soc_card { struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); + int (*add_dai_link)(struct snd_soc_card *, + struct snd_soc_dai_link *link); + long pmdown_time; /* CPU <--> Codec DAI links */ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c855e30..24e0c50 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1243,6 +1243,10 @@ static int soc_init_dai_link(struct snd_soc_card *card, void snd_soc_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { + /* Notify the machine driver for extra initialization. */ + if (card && card->add_dai_link) + card->add_dai_link(card, dai_link); + lockdep_assert_held(&client_mutex); list_add_tail(&dai_link->list, &card->dai_link_list); card->num_dai_links++;