From patchwork Thu May 29 10:03:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 4263861 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A0D39F333 for ; Thu, 29 May 2014 10:21:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAC862034C for ; Thu, 29 May 2014 10:21:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 71A142034B for ; Thu, 29 May 2014 10:21:35 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6010226167D; Thu, 29 May 2014 12:21:34 +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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6D2802615F3; Thu, 29 May 2014 12:20:53 +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 30B3F2615B6; Thu, 29 May 2014 12:20:51 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id AB5DD261687 for ; Thu, 29 May 2014 12:20:29 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 29 May 2014 03:20:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,933,1392192000"; d="scan'208";a="546667911" Received: from vkoul-udesk3.iind.intel.com (HELO localhost.localdomain) ([10.223.96.65]) by fmsmga002.fm.intel.com with ESMTP; 29 May 2014 03:20:27 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 29 May 2014 15:33:37 +0530 Message-Id: <1401357817-17942-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1401357817-17942-1-git-send-email-vinod.koul@intel.com> References: <1401357817-17942-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 v2 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 - "ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrol" introduced helper for getting codec for DAPM kcontrol. For DSPs we need similar method to get the platform pointer while handling the widgets. 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 abda467..247cd5e 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -459,6 +459,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 d831e73..8a4a733 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -362,6 +362,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;