From patchwork Tue Jul 25 23:48:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 108718 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp165686qge; Tue, 25 Jul 2017 16:48:39 -0700 (PDT) X-Received: by 10.84.167.2 with SMTP id c2mr23997118plb.365.1501026519644; Tue, 25 Jul 2017 16:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501026519; cv=none; d=google.com; s=arc-20160816; b=z1BBddRkOdTtWq7VSD0PWlv6r4kI3zkYKh/YOh4p5DgGe0jklvpar9abnDnJK6u6jP xGEQlSPJR8abG87a4mytiE8Fkjtl9FI+wHS8l4RynnN7vsPgBNFuW8/Sjm+0se4OHCMS tdumVyc/uHhThi+M956nIagjLMx6t5NUgda6Wma36SzVlnYo0uUmFMgVAzRTBr8BoGsZ LeihPcgU1gyxiNY1w+hVJqSNfBvoDXjLEloIPXa5h8b4LIzmJEykuEq0ZWYtqYTvRQS1 rvE/SNkIuS1mmDUnuVtwGwPz/dqtHezACcAu8Ey0ZbIJtdGzyi16QpdPLzie+UdudguG h5Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=0nKQTW9alY9y2QVphJ5KPl5wGxlE1w5vtg0Z/x867r8=; b=KnosIWzaqU3co0RbbgjY39V4UaTqksxahOTCcX+HdiPWORz2m7VBwYBEQqnY7JSHH0 eZN9c7aIT/7Br0yQ06VYHsWBpzbjVQTI/L509SO5Iwdjv2W74nEs0ID1CdUzmvpDUlDf CWYmY0Vvm66UQDN/pZ8NlQ2KhgtM8/KlWBZfNWq4TpP4k8hPVEnEr5jLy2IyAGEtwvHd rRy9eHWuxJjP1tfoybjQla17D/N+KFvZ3n5qcwTEOWADRFwiT+zo/Fik6DFQCGV6Br2Z AkY1FZZzycXY7fayxE/S1DfqFmNsQ6pFTA/4yMd9YYimAQpLOXb4PBrcSwvKz2PMxSH1 SkdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ajGOCpRg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k10si8822952pga.677.2017.07.25.16.48.39; Tue, 25 Jul 2017 16:48:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=ajGOCpRg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751751AbdGYXsg (ORCPT + 26 others); Tue, 25 Jul 2017 19:48:36 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:34435 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751784AbdGYXsd (ORCPT ); Tue, 25 Jul 2017 19:48:33 -0400 Received: by mail-io0-f174.google.com with SMTP id l7so62185403iof.1 for ; Tue, 25 Jul 2017 16:48:33 -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=0nKQTW9alY9y2QVphJ5KPl5wGxlE1w5vtg0Z/x867r8=; b=ajGOCpRgMjEL2GtuTTmL3fmg04TeJOfPrdyVrR8wL5J54nJLAorFP2QprOrR9lGxNh KDg/WRA8ITVCwy9QVsNxb77wr4cYrjvEaPY0CEVdNVbT80RU32Dmj+D+rsU9umd0UN0J qpr8cETSC1O6bHS4yoV3t2K87yzdTBso1dpy0= 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=0nKQTW9alY9y2QVphJ5KPl5wGxlE1w5vtg0Z/x867r8=; b=kXaXc9SROVJMlZxUjBZgHGpn8xKVvhlP4hrWl5zB0FNDuzehDtA2DcEyOojgbEoE22 ySfJVNBHi7E4IuUXUeOaIQV2HEh85Ja+OQH24FyIekTnSUaQ82zloMQsnBzWaJPgvihU jHfDiGuEtRNPNsmasMm/erdpCrhIBNMFKwMxWo+0QRo1T/DvhxACdkx+qJAtIUqw8UVo ppwh2YYpKfUncQCq3CdY/yBPYR4IZDxhgy1LNvCXI/uan7ST03I9nTToiaPIjsl7xKOJ lGnPWMkck+hnabjpZpa7SX/9fOsjyp5eBNDMN2OemWa2MMBX5q1A8X2DRs+27k6FayPZ j29w== X-Gm-Message-State: AIVw111UeXf6B/AmLZCgf3O582NgNJN4cDX7UkimzdEoc0hpOcUyxPk5 dRsrhgNYjXoXL7yD70VcTg== X-Received: by 10.107.201.23 with SMTP id z23mr2291065iof.6.1501026513183; Tue, 25 Jul 2017 16:48:33 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 16:48:32 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Cc: Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2 1/3] ASoC: codecs: msm8916-wcd-digital: add support to set_sysclk Date: Wed, 26 Jul 2017 01:48:20 +0200 Message-Id: <20170725234822.18763-2-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla This patch adds support to set_sysclk() which can let the sound card driver to set default mclk rate. In this case MCLK for internal audio codec is expected to be at 9.6MHz by default. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/msm8916-wcd-digital.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.9.3 diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c index f690442..825cc7d 100644 --- a/sound/soc/codecs/msm8916-wcd-digital.c +++ b/sound/soc/codecs/msm8916-wcd-digital.c @@ -568,6 +568,15 @@ static int msm8916_wcd_digital_codec_probe(struct snd_soc_codec *codec) return 0; } +static int msm8916_wcd_digital_codec_set_sysclk(struct snd_soc_codec *codec, + int clk_id, int source, + unsigned int freq, int dir) +{ + struct msm8916_wcd_digital_priv *p = dev_get_drvdata(codec->dev); + + return clk_set_rate(p->mclk, freq); +} + static int msm8916_wcd_digital_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -823,6 +832,7 @@ static struct snd_soc_dai_driver msm8916_wcd_digital_dai[] = { static struct snd_soc_codec_driver msm8916_wcd_digital = { .probe = msm8916_wcd_digital_codec_probe, + .set_sysclk = msm8916_wcd_digital_codec_set_sysclk, .component_driver = { .controls = msm8916_wcd_digital_snd_controls, .num_controls = ARRAY_SIZE(msm8916_wcd_digital_snd_controls), From patchwork Tue Jul 25 23:48:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 108719 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp165728qge; Tue, 25 Jul 2017 16:48:42 -0700 (PDT) X-Received: by 10.99.100.198 with SMTP id y189mr20837437pgb.355.1501026522381; Tue, 25 Jul 2017 16:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501026522; cv=none; d=google.com; s=arc-20160816; b=dQ/H3SOAlv7mHCwTHPzyIgwiejwWYMJB8XWVDE0tOXuPk6kGVGNTvcBvpm8Bfh/6N+ yDt9FEDO1dzETxJ2ieh9BJ+eNVQZprGzV9oWXqFEqV+iEpw6mWkKqOGu4cWfv8bWsePE /As9um3Fza4kjbbX0PTXxV/G2ci7rv/Yji42cTVvsf7Nt36/cTlCbaaboM9J9fiDA9sf CYuLcmu48PMxlnY8YUftR7QVJELvb5Ucg7oyzWe02bfZfLo3SwucxtD/s+Zfn0Wt8Nug qF1100BF2EAAtkv/jDl0F+GmkiWWerMU+D6s6RVxWYY9qCnmptTmfWLGtfJq9bxRAXOF zl3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=p/jaAf6BmnVZoukyOZ3FpA2j8jlfdNYAxGO0q0KYVPU=; b=y2t+/HvjCBuSn7V5226BnEqQi5KVkgLpmar9UDTVGjLKZeJOo70ZjBjyGfeTpIZScP myZ5gc2Wx25Zjtz88wT1ZVNkPPmgr8JrGVs4ajhZwMx4bRjM0Z0r5HCcHowqgAjT6ThR k0K9Oc5VthpT83aVnL9CFN8Ji1fyDlLwIOOWoh1nz8MjdsNi1ktmvBNVipQthafOis5f yF8FIv8Dl0/VVayW2YLu7+1mba9GeThaYz2SaMDboPVmA5KDuwIaTOSvimskYquBMOgT qlTvWLA5HfRCy/G+Zk3QqzSQtjeMg/mjfV/zjmASwBQYRcQma8ZBow33Ksz5IuYzT72Q YFWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=iIpHm2nN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61si7492548plc.914.2017.07.25.16.48.42; Tue, 25 Jul 2017 16:48:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=iIpHm2nN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751828AbdGYXsj (ORCPT + 26 others); Tue, 25 Jul 2017 19:48:39 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:38630 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796AbdGYXsf (ORCPT ); Tue, 25 Jul 2017 19:48:35 -0400 Received: by mail-io0-f182.google.com with SMTP id g13so61724695ioj.5 for ; Tue, 25 Jul 2017 16:48:35 -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=p/jaAf6BmnVZoukyOZ3FpA2j8jlfdNYAxGO0q0KYVPU=; b=iIpHm2nN81KkLotZUVyx5A7z3BAGlXo9sAqxyL3iDt+9eU09/LgJP1vx3YZN0jXrCT edX2tZgOEe8oc4hZiRmakcOl/Tm47l/VBuskYH6xTLoRajd1eVNSmyQ13so4P4WvH/hQ TTCA3+bVAgM+Wz1X4yOZBV9v9L6VnYuClcXKo= 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=p/jaAf6BmnVZoukyOZ3FpA2j8jlfdNYAxGO0q0KYVPU=; b=CIUTLxRtbfp2VpI6fuD7tSRolCwJ6CzT/ISHAmJL/PAbP77UZAHTu862GYMlg21cRA ZbnfNvY1sMdsoyG/Agxx2tZN/apbI7VpuE10MaXgK3JmuzoFVNxsx7GK5BGTqoHvLXoi 8wKyjqSTBY15aLGJ593WcWz9Co0XjGG/Oif0Q93fKeOuuWHPVLtpC6xFaKvbDl9+1ykH 6unGqUVLfNA6WHDYS5d6Yr5XLXt1YE0vKrx4+PrjyXClcxETEqForJ0FtzK3s16s2Cl6 zOxq3lP/Rq7AW3sazPt3rJUZzeATwGvGMRy8MANA2DajMutPDqoD3rFHa46nqXnI74j/ mtnA== X-Gm-Message-State: AIVw111vSTytG+yUpgL40prK2tHwvUBhM6rhMSGMRyzdGOikgtvsHUyT SST8rfgH9vGQeSJx X-Received: by 10.107.10.28 with SMTP id u28mr20937763ioi.172.1501026515048; Tue, 25 Jul 2017 16:48: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 m15sm5521463iti.9.2017.07.25.16.48.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 16:48:34 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Cc: Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2 2/3] ASoC: qcom: apq8016-sbc: set default mclk rate Date: Wed, 26 Jul 2017 01:48:21 +0200 Message-Id: <20170725234822.18763-3-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla MCLK for internal audio codec is expected to be at 9.6MHz by default. This patch adds support to 9.6MHz to make the default case possible. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/apq8016_sbc.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) -- 2.9.3 diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index d084d74..f07aa1e 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -34,13 +34,16 @@ struct apq8016_sbc_data { #define MIC_CTRL_QUA_WS_SLAVE_SEL_10 BIT(17) #define MIC_CTRL_TLMM_SCLK_EN BIT(1) #define SPKR_CTL_PRI_WS_SLAVE_SEL_11 (BIT(17) | BIT(16)) +#define DEFAULT_MCLK_RATE 9600000 static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_codec *codec; + struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_card *card = rtd->card; struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); - int rval = 0; + int i, rval; switch (cpu_dai->id) { case MI2S_PRIMARY: @@ -63,12 +66,24 @@ static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd) default: dev_err(card->dev, "unsupported cpu dai configuration\n"); - rval = -EINVAL; - break; + return -EINVAL; + + } + for (i = 0 ; i < dai_link->num_codecs; i++) { + struct snd_soc_dai *dai = rtd->codec_dais[i]; + + codec = dai->codec; + /* Set default mclk for internal codec */ + rval = snd_soc_codec_set_sysclk(codec, 0, 0, DEFAULT_MCLK_RATE, + SND_SOC_CLOCK_IN); + if (rval != 0 && rval != -ENOTSUPP) { + dev_warn(card->dev, "Failed to set mclk: %d\n", rval); + return rval; + } } - return rval; + return 0; } static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card) 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: 108720 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp165870qge; Tue, 25 Jul 2017 16:48:56 -0700 (PDT) X-Received: by 10.99.42.141 with SMTP id q135mr21129577pgq.175.1501026536166; Tue, 25 Jul 2017 16:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501026536; cv=none; d=google.com; s=arc-20160816; b=YZfQXHwU3NJbl9TJc8SdczJFlyX1zq7+GPz/U/1+p173wQwiK0t1E3ew8FO4TNcAIr PrKzN0MKYlae89xs0UnR9CHmo1rr9u/k/DTI4CuRfgj96z0Kb6liizbfjdCqRQUgsV7Y C+X4WnIy0oOXy2It2f3r8UJwQYK2S+lvECS+o6HiYb/R9tem5NDI6FYHthK/rQdb+LfP 7nlPr+HtGwEAXp5v/EUBD/5yfJHEqPnxTz9kmKl/cjrSogGUWEzurtVGIzB1yst5R2h3 NbaxpbnRrr7it1xfaXwYECPjKQiYx4wbyw7klj8lEbaHlU3s3sav2wQMafOIW6CYMopz OnlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=N5H2FdV6Jp+NlacTQ4MLDuXnp39KCRKQATvkkiQsgPQ=; b=qlpAh3SrEDQzZmw82ItBRSEPaembxiNnDjGUIoPPgS7gGqC+s1DReckpxKauP88YzF 42KTvuBeD7vvnbG/gROIEDKSRlIuMsJWK6q0A+fLjgEue/Z+PiFnNS7J6VOVPBAJqbro sSJJqvuNleyNqIu7fqi5BLkF1rE3CZJ52Ue/WH1S5Bs6QZCZ9Pm72PAKx1pnecyiZMe4 RvlrCafaIQCG4gMP12Y8S0I0t5meTd86tzHlE2MIZsxxQ8DObQCCgA+Pt9oxqaCHK61f GJOAvK73GbsaRd3ctmdDH7NOfNcyWK5DHt/BHtjDX8MZzloenQHyN2xv9AvFq3+9tmI9 +zNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Y9bt9Nw3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61si7492548plc.914.2017.07.25.16.48.55; Tue, 25 Jul 2017 16:48:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=Y9bt9Nw3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbdGYXsx (ORCPT + 26 others); Tue, 25 Jul 2017 19:48:53 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:34442 "EHLO mail-io0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751784AbdGYXsh (ORCPT ); Tue, 25 Jul 2017 19:48:37 -0400 Received: by mail-io0-f172.google.com with SMTP id l7so62185755iof.1 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=oOjI31N9y3C6HyRhsSAQ7MZu6PWo2XbdM5RorD9VlN8n64kVrpJM7it+LlcO5TLlsY TE5igU17onfY1Z2NwK5dDvSG2EwcWbAhLKqTlSxFI1Bx9/AiWuXY3ci/Uwvg1A/eETDA ji4+qpISS3NnECTBcXJPkGx70jwh8H8t4dSwXcGMifQhwQP2aY4EYpgFnFwPxz/5W+VY +bVP26g+HO/93u+iRFxVcsjgn7czn1vXiGYu3TnSybuOZgyj7GWaJMWwDprMFo9hGKMw 8w7rosqt2sf7V0mPRHBLTNc5u6y4m57Rzs6OXpnC10QRLIaoBlvYdAkQf/pMG913i5iJ jpng== X-Gm-Message-State: AIVw111jUOWHqdQ0CuaWkl2+aKWT9EeR+evnLtbIZb58fr0OeknBYn1Y exGleP4jU+qqPGC4 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 Cc: Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2 3/3] ASoC: codecs: msm8916-wcd-digital: select DMIC source in CIC filter path 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.9.3 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), };