From patchwork Tue Jul 25 23:48:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 9864043 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 6101D600F5 for ; Tue, 25 Jul 2017 23:49:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6334928713 for ; Tue, 25 Jul 2017 23:49:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 582122871D; Tue, 25 Jul 2017 23:49:45 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no 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 7FFD028713 for ; Tue, 25 Jul 2017 23:49:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3259C267379; Wed, 26 Jul 2017 01:48:47 +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 5F00826735C; Wed, 26 Jul 2017 01:48:44 +0200 (CEST) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) by alsa0.perex.cz (Postfix) with ESMTP id 23D6F26735E for ; Wed, 26 Jul 2017 01:48:37 +0200 (CEST) Received: by mail-io0-f170.google.com with SMTP id g35so29216963ioi.3 for ; Tue, 25 Jul 2017 16:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N5H2FdV6Jp+NlacTQ4MLDuXnp39KCRKQATvkkiQsgPQ=; b=Y9bt9Nw3UOgc6kl9eR6CArBkHoRAw8xaNu29unM7yX1wX9rWaxLqRisofc0xdRs1tZ OMYpGFz43/6LvHFAD7TLMKyxLo9bQdkWE06PsQA8G16kJG/K9CwHKKO1KJn7rcNESCo+ /twR7HjPDmd+IO4498EQqD74wYHXg1Z0RqzLA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N5H2FdV6Jp+NlacTQ4MLDuXnp39KCRKQATvkkiQsgPQ=; b=JvjnThPiCaqZqkqZYfMa89yQC7KbwyCLhWBD2Pab45Mw+CjrgbF8acbzc8sT2f22Ce TZvX7WHLa3m2jetwftFx2UCP30l7XvPgvk2sAFG/cverYFOiiP9mHNzqMJtSCVSoDH7J ayTt6s06+iQItDKzqnql+6MHG5SLstjbvpclZ9+d/Zyfxg+W5hTqZmqaM+mOWgTPGPMC nYACagK3a8CkBFsKUxyOlzIdrioPPVeexm3857sP1RSnK/wc0Q5XUuv2sAwI6zf5Qv4p dAdkjI4EytA4P8enfz9vVuLBk1B7vgtTUwSH67SUHEs7hRBwGtzqnwU1W+/wjCzGPlm6 ROGQ== X-Gm-Message-State: AIVw1122K2+/gauE+p4tuOB28FgWPFqAgHEf19Qvc3iGv5zwiifFA1Yt adedi2/MyFicvYPu X-Received: by 10.107.41.5 with SMTP id p5mr19893751iop.165.1501026516962; Tue, 25 Jul 2017 16:48:36 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id m15sm5521463iti.9.2017.07.25.16.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 16:48:36 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Date: Wed, 26 Jul 2017 01:48:22 +0200 Message-Id: <20170725234822.18763-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170725234822.18763-1-srinivas.kandagatla@linaro.org> References: <20170725234822.18763-1-srinivas.kandagatla@linaro.org> Cc: linux-kernel@vger.kernel.org, Patrick Lai , Srinivas Kandagatla , Takashi Iwai Subject: [alsa-devel] [PATCH v2 3/3] ASoC: codecs: msm8916-wcd-digital: select DMIC source in CIC filter path 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: Srinivas Kandagatla This patch fixes a missing selection of DMIC in CIC filter source path. Without this patch dmic is not functional. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/msm8916-wcd-digital.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c index 825cc7d..f82a936 100644 --- a/sound/soc/codecs/msm8916-wcd-digital.c +++ b/sound/soc/codecs/msm8916-wcd-digital.c @@ -168,6 +168,9 @@ #define LPASS_CDC_TX2_VOL_CTL_CFG (0x2A8) #define LPASS_CDC_TX1_MUX_CTL (0x28C) +#define TX_MUX_CTL_ADC_DMIC_SEL_MASK BIT(0) +#define TX_MUX_CTL_ADC_DMIC_SEL_DMIC BIT(0) +#define TX_MUX_CTL_ADC_DMIC_SEL_ADC 0 #define TX_MUX_CTL_CUT_OFF_FREQ_MASK GENMASK(5, 4) #define TX_MUX_CTL_CUT_OFF_FREQ_SHIFT 4 #define TX_MUX_CTL_CF_NEG_3DB_4HZ (0x0 << 4) @@ -439,17 +442,37 @@ static int msm8916_wcd_digital_enable_dmic(struct snd_soc_dapm_widget *w, DMIC_B1_CTL_DMIC0_CLK_SEL_DIV3); switch (dmic) { case 1: + snd_soc_update_bits(codec, LPASS_CDC_TX1_MUX_CTL, + TX_MUX_CTL_ADC_DMIC_SEL_MASK, + TX_MUX_CTL_ADC_DMIC_SEL_DMIC); snd_soc_update_bits(codec, LPASS_CDC_TX1_DMIC_CTL, TXN_DMIC_CTL_CLK_SEL_MASK, TXN_DMIC_CTL_CLK_SEL_DIV3); break; case 2: + snd_soc_update_bits(codec, LPASS_CDC_TX2_MUX_CTL, + TX_MUX_CTL_ADC_DMIC_SEL_MASK, + TX_MUX_CTL_ADC_DMIC_SEL_DMIC); snd_soc_update_bits(codec, LPASS_CDC_TX2_DMIC_CTL, TXN_DMIC_CTL_CLK_SEL_MASK, TXN_DMIC_CTL_CLK_SEL_DIV3); break; } break; + case SND_SOC_DAPM_POST_PMD: + switch (dmic) { + case 1: + snd_soc_update_bits(codec, LPASS_CDC_TX1_MUX_CTL, + TX_MUX_CTL_ADC_DMIC_SEL_MASK, + 0); + break; + case 2: + snd_soc_update_bits(codec, LPASS_CDC_TX2_MUX_CTL, + TX_MUX_CTL_ADC_DMIC_SEL_MASK, + 0); + break; + } + break; } return 0; @@ -536,6 +559,8 @@ static const struct snd_soc_dapm_widget msm8916_wcd_digital_dapm_widgets[] = { /* Connectivity Clock */ SND_SOC_DAPM_SUPPLY_S("CDC_CONN", -2, LPASS_CDC_CLK_OTHR_CTL, 2, 0, NULL, 0), + SND_SOC_DAPM_MIC("Digital Mic1", NULL), + SND_SOC_DAPM_MIC("Digital Mic2", NULL), };