From patchwork Thu May 24 18:37:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjani Sridharan X-Patchwork-Id: 10425329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A9B660327 for ; Thu, 24 May 2018 18:47:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6759F2966F for ; Thu, 24 May 2018 18:47:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B96A2968D; Thu, 24 May 2018 18:47:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F1E02966F for ; Thu, 24 May 2018 18:47:34 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DC34D26765C; Thu, 24 May 2018 20:37: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 DE5F6267661; Thu, 24 May 2018 20:37:49 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id 40CC3267646 for ; Thu, 24 May 2018 20:37:44 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 May 2018 11:37:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,436,1520924400"; d="scan'208";a="58237504" Received: from vbmontoy-mobl.amr.corp.intel.com (HELO ranjani-desktop.hsd1.ca.comcast.net) ([10.254.179.187]) by fmsmga001.fm.intel.com with ESMTP; 24 May 2018 11:37:42 -0700 From: Ranjani Sridharan To: alsa-devel@alsa-project.org Date: Thu, 24 May 2018 11:37:42 -0700 Message-Id: <20180524183742.4986-1-ranjani.sridharan@linux.intel.com> X-Mailer: git-send-email 2.17.0 Cc: liam.r.girdwood@linux.intel.com, broonie@kernel.org, pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH] [RFC]ASoC: dapm: enable kcontrols for siggen and effect type widgets 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 This patch proposes to enable kcontrols for siggen and effect type dapm widgets. This will allow triggering the tone generating siggen component and also modifying the run-time attributes such as frequency, amplitude etc. Effect type widgets such as the equalizer could potentially need kcontrols to pass algorithm data from the userspace. This patch also renames the function dapm_new_pga() to dapm_new_kcontrol() so that it does not allude that it applies only to pga widgets. Signed-off-by: Ranjani Sridharan --- sound/soc/soc-dapm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 0c0cb7713eb4..4577880f69cc 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -852,6 +852,8 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w, kcname_in_long_name = true; } else { switch (w->id) { + case snd_soc_dapm_siggen: + case snd_soc_dapm_effect: case snd_soc_dapm_switch: case snd_soc_dapm_mixer: case snd_soc_dapm_pga: @@ -1010,8 +1012,8 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w) return 0; } -/* create new dapm volume control */ -static int dapm_new_pga(struct snd_soc_dapm_widget *w) +/* create new dapm kcontrol */ +static int dapm_new_kcontrol(struct snd_soc_dapm_widget *w) { int i, ret; @@ -3046,9 +3048,11 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card) case snd_soc_dapm_demux: dapm_new_mux(w); break; + case snd_soc_dapm_siggen: + case snd_soc_dapm_effect: case snd_soc_dapm_pga: case snd_soc_dapm_out_drv: - dapm_new_pga(w); + dapm_new_kcontrol(w); break; case snd_soc_dapm_dai_link: dapm_new_dai_link(w);