From patchwork Thu May 29 10:02:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 4263841 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 DA6659F333 for ; Thu, 29 May 2014 10:20:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E64C72034E for ; Thu, 29 May 2014 10:20:05 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3B62D2034A for ; Thu, 29 May 2014 10:20:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 81E702610C1; Thu, 29 May 2014 12:20:02 +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 433F72608C7; Thu, 29 May 2014 12:19:52 +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 42D65260851; Thu, 29 May 2014 12:19:51 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id B6C14260851 for ; Thu, 29 May 2014 12:19:42 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 29 May 2014 03:19:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,933,1392192000"; d="scan'208";a="546667585" 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:19:37 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 29 May 2014 15:32:46 +0530 Message-Id: <1401357767-17907-1-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.0.4 Cc: Vinod Koul , Kp Jeeja , broonie@kernel.org, "Subhransu S. Prusty" , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 1/2] ASoC: export dapm_kcontrol_set/get_value functions 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 The DSPs like Intel ones use the DPCM to represent the DSP toplogy. So when DAPM triggers the widget, the DSP needs to know the kcontrol values and pass on to DSP firmware, so export these for driver use Signed-off-by: Vinod Koul --- include/sound/soc-dapm.h | 3 +++ sound/soc/soc-dapm.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 75020f5..abda467 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -368,6 +368,9 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); int dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); +bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol, + unsigned int value); +unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); /* dapm controls */ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 98c1dc6..d831e73 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -327,14 +327,15 @@ static struct list_head *dapm_kcontrol_get_path_list( list_for_each_entry(path, dapm_kcontrol_get_path_list(kcontrol), \ list_kcontrol) -static unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol) +unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol) { struct dapm_kcontrol_data *data = snd_kcontrol_chip(kcontrol); return data->value; } +EXPORT_SYMBOL_GPL(dapm_kcontrol_get_value); -static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol, +bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol, unsigned int value) { struct dapm_kcontrol_data *data = snd_kcontrol_chip(kcontrol); @@ -349,6 +350,7 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol, return true; } +EXPORT_SYMBOL_GPL(dapm_kcontrol_set_value); /** * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol