From patchwork Sat Aug 27 11:28:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 9304353 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 40EF4601C0 for ; Mon, 29 Aug 2016 18:58:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31AEE288B6 for ; Mon, 29 Aug 2016 18:58:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 268CF2894A; Mon, 29 Aug 2016 18:58:19 +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=-1.9 required=2.0 tests=BAYES_00, 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 8AECC288B6 for ; Mon, 29 Aug 2016 18:58:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B2E522672AA; Mon, 29 Aug 2016 20:58:12 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 211CC266E9D; Mon, 29 Aug 2016 20:12:30 +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 A7E0F266E9D; Mon, 29 Aug 2016 20:12:28 +0200 (CEST) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by alsa0.perex.cz (Postfix) with ESMTP id 6E92F267341 for ; Mon, 29 Aug 2016 18:54:01 +0200 (CEST) Received: by wens.csie.org (Postfix, from userid 1000) id E31DD5FAAF; Sat, 27 Aug 2016 19:28:02 +0800 (CST) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Sat, 27 Aug 2016 19:28:01 +0800 Message-Id: <20160827112801.31010-5-wens@csie.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160827112801.31010-1-wens@csie.org> References: <20160827112801.31010-1-wens@csie.org> Cc: Chen-Yu Tsai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 4/4] ASoC: dapm: Give error when adding hardware backed controls for PGA 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 Commit 19a2557b76d6 ("ASoC: dapm: Add kcontrol support for PGAs") added kcontrol support for PGA widgets, but did not add necessary changes to snd_soc_dapm_put_volsw or soc_dapm_mixer_update_power to have hardware register updates actually happen. As this is a little used feature, this patch just adds an error message when someone tries to use hardware backed controls with PGA or output driver widgets. Fixes: 19a2557b76d6 ("ASoC: dapm: Add kcontrol support for PGAs") Signed-off-by: Chen-Yu Tsai --- sound/soc/soc-dapm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ed6b707cc7ce..f681a251d766 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -984,6 +984,14 @@ static int dapm_new_pga(struct snd_soc_dapm_widget *w) int i, ret; for (i = 0; i < w->num_kcontrols; i++) { + const struct soc_mixer_control *mc = + (struct soc_mixer_control *)w->kcontrol_news[i].private_value; + + if (mc->reg != SND_SOC_NOPM) + dev_err(w->dapm->dev, + "ASoC: hardware backed PGA controls not supported: '%s'\n", + w->name); + ret = dapm_create_or_share_kcontrol(w, i); if (ret < 0) return ret;