From patchwork Mon Jul 17 13:54:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 9845155 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 0C5C16037F for ; Mon, 17 Jul 2017 13:55:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F235128528 for ; Mon, 17 Jul 2017 13:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6D4E28509; Mon, 17 Jul 2017 13:55:12 +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 1F0C02851A for ; Mon, 17 Jul 2017 13:55:12 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A65B8266EA0; Mon, 17 Jul 2017 15:54:41 +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 9880D266EA2; Mon, 17 Jul 2017 15:54:39 +0200 (CEST) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com [209.85.214.48]) by alsa0.perex.cz (Postfix) with ESMTP id 6C7E1266E91 for ; Mon, 17 Jul 2017 15:54:36 +0200 (CEST) Received: by mail-it0-f48.google.com with SMTP id h199so17990600ith.1 for ; Mon, 17 Jul 2017 06:54:36 -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=e7sCsayXZozxMb18/kCm23DklQtfgyFc0n4U07Em41c=; b=Nzwvb7dN943AV1xGZX0kxNFwiM/DAga1PZ7oZpQ1eIwlMKQ7YUtPenNliB5m4HGhAo 5II94w9X0201HECUBY+PsUUhy/bIPTsluz1XhUtcXLh7+XLL5+r8F5Ijxq9NvsqKFRHT OlidOEE/hiJuh+q4bWGfWJErhH3THEJS5vpCA= 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=e7sCsayXZozxMb18/kCm23DklQtfgyFc0n4U07Em41c=; b=Y/hG9RTea6qwrSvdIBO3kQIPTnHez0XzxKjvP3lIJBXPW3aQW83ufnWRPHVv6YxP3N B04kBNoK1o3CBCXArvdxn4yiMVVdb3AhOF5Ypf/j8Lg6nQkbJSTE25R0oi1dAydkw+XN MbLJrP4klO4v3D5cv9O36q16hVnOa3S/YqhnMemDpMwnKvONTqj9FqORCU2H8uD7gI2Y xSNDvTSZHUot6pG49MFNUfuhyACJqKgKXkAspqa52LcdbP9K9sIvmrzYBbjH1N0dfpiK nrSNMZDiBtQqKqA6IIHVcBZnV5qu3ZBohAA3lnBjszqZ2FrqdxGvKaowMrL3bG4UJD77 3lgw== X-Gm-Message-State: AIVw1103qkibELpc5R9WCMRLQemv4nrngFV+DVwy7a/kYt3pkWxJl8ZO 4+eRTWp11fLRlKf1 X-Received: by 10.36.106.5 with SMTP id l5mr5404178itc.95.1500299675482; Mon, 17 Jul 2017 06:54:35 -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 138sm5880561itw.10.2017.07.17.06.54.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:54:35 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Date: Mon, 17 Jul 2017 15:54:10 +0200 Message-Id: <20170717135410.26812-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170717135410.26812-1-srinivas.kandagatla@linaro.org> References: <20170717135410.26812-1-srinivas.kandagatla@linaro.org> Cc: linux-kernel@vger.kernel.org, Patrick Lai , Srinivas Kandagatla , Takashi Iwai Subject: [alsa-devel] [PATCH 3/3] ASoC: codecs: msm8916-wcd-digital: fix dmic support 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 dmic support which was broken in this driver. 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 126a0ee8aded..3265bd404fd7 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), };