From patchwork Mon May 26 12:08:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 4242001 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C4546BF90B for ; Mon, 26 May 2014 12:25:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0224E20219 for ; Mon, 26 May 2014 12:25:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D97072020A for ; Mon, 26 May 2014 12:25:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C84042651AC; Mon, 26 May 2014 14:25:54 +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.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 289A62650F2; Mon, 26 May 2014 14:25:43 +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 28C992650FF; Mon, 26 May 2014 14:25:38 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by alsa0.perex.cz (Postfix) with ESMTP id 9E26F2650F2 for ; Mon, 26 May 2014 14:25:29 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 26 May 2014 05:21:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,912,1392192000"; d="scan'208";a="537687796" Received: from vkoul-udesk3.iind.intel.com (HELO localhost.localdomain) ([10.223.96.65]) by fmsmga001.fm.intel.com with ESMTP; 26 May 2014 05:25:26 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Mon, 26 May 2014 17:38:56 +0530 Message-Id: <1401106136-3745-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1401106136-3745-1-git-send-email-vinod.koul@intel.com> References: <1401106136-3745-1-git-send-email-vinod.koul@intel.com> Cc: Vinod Koul , Kp Jeeja , broonie@kernel.org, "Subhransu S. Prusty" , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 2/2] ASoC: dapm: Add a helper to get the platform for DAPM kcontrol 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: Subhransu S. Prusty commit eee5d7f9 introduced helper for getting codec for DAPM kcontrol, for DSPs we need similar stuff for platforms as well Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul --- include/sound/soc-dapm.h | 2 ++ sound/soc/soc-dapm.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 9e826e9..9f47dee 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -460,6 +460,8 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget_list **list); struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol); +struct snd_soc_platform *snd_soc_dapm_kcontrol_platform( + struct snd_kcontrol *kcontrol); /* dapm widget types */ enum snd_soc_dapm_type { diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index b7dfa1a..f37ca16 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -373,6 +373,17 @@ struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol) } EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_codec); +/** + * snd_soc_dapm_kcontrol_platform() - Returns the platform associated to a kcontrol + * @kcontrol: The kcontrol + */ +struct snd_soc_platform *snd_soc_dapm_kcontrol_platform( + struct snd_kcontrol *kcontrol) +{ + return dapm_kcontrol_get_wlist(kcontrol)->widgets[0]->platform; +} +EXPORT_SYMBOL_GPL(snd_soc_dapm_kcontrol_platform); + static void dapm_reset(struct snd_soc_card *card) { struct snd_soc_dapm_widget *w;