From patchwork Thu May 3 02:46:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AS50 KCHSU0 X-Patchwork-Id: 10376913 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 7A2926038F for ; Thu, 3 May 2018 02:47:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684FA29131 for ; Thu, 3 May 2018 02:47:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A8812913E; Thu, 3 May 2018 02:47:08 +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 A583C29131 for ; Thu, 3 May 2018 02:47:07 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0EAD52673A6; Thu, 3 May 2018 04:46:59 +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 DF78E266F50; Thu, 3 May 2018 04:46:55 +0200 (CEST) Received: from maillog.nuvoton.com (maillog.nuvoton.com [202.39.227.15]) by alsa0.perex.cz (Postfix) with ESMTP id 8EF1A266F4E for ; Thu, 3 May 2018 04:46:50 +0200 (CEST) Received: from NTHCCAS01.nuvoton.com (nthccas01.nuvoton.com [10.1.8.28]) by maillog.nuvoton.com (Postfix) with ESMTP id 0C7FA1C80905; Thu, 3 May 2018 10:46:45 +0800 (CST) Received: from NTHCML01B.nuvoton.com (10.1.8.178) by NTHCCAS01.nuvoton.com (10.1.8.28) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 3 May 2018 10:46:44 +0800 Received: from NTHCCAS01.nuvoton.com (10.1.8.28) by NTHCML01B.nuvoton.com (10.1.8.178) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 3 May 2018 10:46:44 +0800 Received: from localhost.localdomain (10.4.36.27) by NTHCCAS01.nuvoton.com (10.1.12.25) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Thu, 3 May 2018 10:46:44 +0800 From: John Hsu To: Date: Thu, 3 May 2018 10:46:41 +0800 Message-ID: <1525315602-3620-1-git-send-email-KCHSU0@nuvoton.com> X-Mailer: git-send-email 2.6.4 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, CFYU0@nuvoton.com, WTLI@nuvoton.com, John Hsu , lgirdwood@gmail.com, YHCHuang@nuvoton.com, CTLIN0@nuvoton.com, YCPENG7@nuvoton.com Subject: [alsa-devel] [PATCH 1/2] ASoC: nau8810: change input PGA mixer stage 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Organize the paths of the mixer, "Input Boost Stage", including the routes of the mixer. The control is not used correctly before. Besides, the driver changes the name of the mixer controls. Signed-off-by: John Hsu --- sound/soc/codecs/nau8810.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c index ca2ba1c..bfd74b8 100644 --- a/sound/soc/codecs/nau8810.c +++ b/sound/soc/codecs/nau8810.c @@ -373,9 +373,11 @@ static const struct snd_kcontrol_new nau8810_mono_mixer_controls[] = { }; /* PGA Mute */ -static const struct snd_kcontrol_new nau8810_inpga_mute[] = { +static const struct snd_kcontrol_new nau8810_pgaboost_mixer_controls[] = { SOC_DAPM_SINGLE("PGA Mute Switch", NAU8810_REG_PGAGAIN, - NAU8810_PGAMT_SFT, 1, 0), + NAU8810_PGAMT_SFT, 1, 1), + SOC_DAPM_SINGLE("PMIC PGA Switch", NAU8810_REG_ADCBOOST, + NAU8810_PMICBSTGAIN_SFT, 0x7, 0), }; /* Input PGA */ @@ -386,11 +388,6 @@ static const struct snd_kcontrol_new nau8810_inpga[] = { NAU8810_PMICPGA_SFT, 1, 0), }; -/* Mic Input boost vol */ -static const struct snd_kcontrol_new nau8810_mic_boost_controls = - SOC_DAPM_SINGLE("Mic Volume", NAU8810_REG_ADCBOOST, - NAU8810_PMICBSTGAIN_SFT, 0x7, 0); - /* Loopback Switch */ static const struct snd_kcontrol_new nau8810_loopback = SOC_DAPM_SINGLE("Switch", NAU8810_REG_COMP, @@ -429,8 +426,8 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = { NAU8810_PGA_EN_SFT, 0, nau8810_inpga, ARRAY_SIZE(nau8810_inpga)), SND_SOC_DAPM_MIXER("Input Boost Stage", NAU8810_REG_POWER2, - NAU8810_BST_EN_SFT, 0, nau8810_inpga_mute, - ARRAY_SIZE(nau8810_inpga_mute)), + NAU8810_BST_EN_SFT, 0, nau8810_pgaboost_mixer_controls, + ARRAY_SIZE(nau8810_pgaboost_mixer_controls)), SND_SOC_DAPM_SUPPLY("Mic Bias", NAU8810_REG_POWER1, NAU8810_MICBIAS_EN_SFT, 0, NULL, 0), @@ -469,8 +466,8 @@ static const struct snd_soc_dapm_route nau8810_dapm_routes[] = { /* Input Boost Stage */ {"ADC", NULL, "Input Boost Stage"}, {"ADC", NULL, "PLL", check_mclk_select_pll}, - {"Input Boost Stage", NULL, "Input PGA"}, - {"Input Boost Stage", NULL, "MICP"}, + {"Input Boost Stage", "PGA Mute Switch", "Input PGA"}, + {"Input Boost Stage", "PMIC PGA Switch", "MICP"}, /* Input PGA */ {"Input PGA", NULL, "Mic Bias"},