From patchwork Mon Jul 17 13:54:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 107962 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4594913obm; Mon, 17 Jul 2017 06:55:15 -0700 (PDT) X-Received: by 10.99.123.6 with SMTP id w6mr7399943pgc.71.1500299714911; Mon, 17 Jul 2017 06:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500299714; cv=none; d=google.com; s=arc-20160816; b=hYr90mx7PTl16is8Q8gZHFpdgSZqtHFiYuspgBPl8E5V0t++S2eWBNwjrBgmdphayS Fxn32bJQO6ON/2VqhY8HhmFDi9n+DnVzO04h8qLh28fxvf/GW5h8X9YV2lQo9uwCSy0k 5NP+hYWV6lO/cO9T/lTYhetjbGRDEEhHJqbAhktEBAjB52TwfBRyd5XKNvX1GBO5jAUN V1uZaTjoMxNROfSPd1UIWrysUo3rSeKYEyJOUySouctcmUmw8u/7xvvBFJRL0hQLhnp1 OBMdMk530ermS3YIwPTB/VejNLHH1IholPhyco65KZpkP1cfdqiKeUHlQfhCZZd04dKb xTtg== 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=+hYBJ4dwwHsvwnbtbRGOcHcbGbJ2OCVJnBrZLatl9nc=; b=cR+7kLlXB8YjXeMvOyRYjG5WMBsAWJit3wNvyWhz4H0K4GaXvnG3Wg6I+8UyAMXyHz zY/+apft+fM1ehPyOkB2Q9HZiAC5Fvbkc/aSeoNzdgu9qEWN5BiWgu+dr4mC1TNJegtr Fe/2KCuCp6TWdxi83G1GGBgKhVsIGhrI/c3gnkMagPCEB9Q+2E0QwqM8TndqseZkxVof +aIcN8PuGPKjmXXZmrKRv3qCmknyk0ptJphblX+WmHs8oYe9Xw0YldiuVMLtMfsq60h0 rC2bgDhFJavl2iaeZhnfA2FzftSfeUyw/NpaqoMhyoUW+J7ZIiQR2aw7JEFeYiBzuuEH KhWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=XAQm3Els; 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 g3si13240563plk.571.2017.07.17.06.55.14; Mon, 17 Jul 2017 06:55:14 -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=XAQm3Els; 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 S1751422AbdGQNzM (ORCPT + 25 others); Mon, 17 Jul 2017 09:55:12 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:33662 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbdGQNyc (ORCPT ); Mon, 17 Jul 2017 09:54:32 -0400 Received: by mail-io0-f170.google.com with SMTP id h64so43371605iod.0 for ; Mon, 17 Jul 2017 06:54:32 -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=+hYBJ4dwwHsvwnbtbRGOcHcbGbJ2OCVJnBrZLatl9nc=; b=XAQm3ElsiyRd9wVsiZ/DYQRhGNft7D/+v/AcEwjLFEMagHvMmVoNzPCkjiGzqlnzfV ozC7RS5jA/jwPh1ruT+w1AQF7EJRigDtKFEQKyPQM4V/0jTrgQThXwKIlcEug/uxzCnr +HHkmTiUfZnRIAgHi2qy5mFZjvp2NAQudFEjY= 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=+hYBJ4dwwHsvwnbtbRGOcHcbGbJ2OCVJnBrZLatl9nc=; b=BOo5cN5hrScKAOZnwX3C7fyvwnH3b+4cnFJQ+o+1ie1dNnMCMZMDys4+pv+KQ4/Fe1 1AW/YjtmVix27mkuVZ728W8+u1otAbJmjR6mcLgPMFL1VgKbKtH3uZcMOsGm/3m1exA0 u9T6r2oVK+8UJr0Ys1ovaaaUBZHb7FySeZsJDhVBod9zDDKFHXe1MHopAPDP9uBwmEuc 55qHGwKfBZLSPsKXTrdLYAGQ8mkDqiSJTVUBUoRrLtdKFk030KwjyThzAHWm4zX+ah3u QAm/gaovfJPBlfUOt4uee1osxsM6hblhaM1JNxlcuM7T+1szdrNxLbm3UwEF5urfiM9c H70w== X-Gm-Message-State: AIVw110ENAshil1CYqxiBoT3jT3rUpoxNPqeQJhx/si9QaPNIU3ZZcj0 yZ5f9xhg3X2KoqfO X-Received: by 10.107.8.14 with SMTP id 14mr19306232ioi.197.1500299671727; Mon, 17 Jul 2017 06:54:31 -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.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:54:31 -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 1/3] ASoC: codecs: msm8916-wcd-digital: add support to set_sysclk Date: Mon, 17 Jul 2017 15:54:08 +0200 Message-Id: <20170717135410.26812-2-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> 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.11.0 diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c index f690442af8c9..126a0ee8aded 100644 --- a/sound/soc/codecs/msm8916-wcd-digital.c +++ b/sound/soc/codecs/msm8916-wcd-digital.c @@ -568,6 +568,16 @@ static int msm8916_wcd_digital_codec_probe(struct snd_soc_codec *codec) return 0; } +static int msm8916_set_dai_sysclk(struct snd_soc_dai *dai, + int clk_id, unsigned int freq, int dir) +{ + struct msm8916_wcd_digital_priv *p = dev_get_drvdata(dai->codec->dev); + + clk_set_rate(p->mclk, freq); + + return 0; +} + static int msm8916_wcd_digital_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -792,6 +802,7 @@ static struct snd_soc_dai_ops msm8916_wcd_digital_dai_ops = { .startup = msm8916_wcd_digital_startup, .shutdown = msm8916_wcd_digital_shutdown, .hw_params = msm8916_wcd_digital_hw_params, + .set_sysclk = msm8916_set_dai_sysclk, }; static struct snd_soc_dai_driver msm8916_wcd_digital_dai[] = { From patchwork Mon Jul 17 13:54:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 107960 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4594430obm; Mon, 17 Jul 2017 06:54:42 -0700 (PDT) X-Received: by 10.99.114.73 with SMTP id c9mr29803685pgn.267.1500299682549; Mon, 17 Jul 2017 06:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500299682; cv=none; d=google.com; s=arc-20160816; b=U2GdZn57PXZUAGU57nDwg6Nv2HP1YzLGVodN3y6q6+FZ20tI1ULmyt9fHNW94FLGVp ijEOMBmC+BnWSH4bwfqm3oqRCMoBnJ4/aG/DV2fvv1c56O+A1oj27Jl0khUH61mKZd5N 65NfZBLjJGnblhERbR28/wvp5lrNszeeSgugNLUUtrr8Zmb+Ly/GgZCrqzR9LJn4pwKk DKIJj1j+dxrCa2j66tHkoMER0e3ob2BVNrYVWx3Sos+cIwBmfaomBy4fKtcwt9EBF5TA z6mxNiKg8CVkEywD+P2TpGA8UY1dU1Ik+Erv3zf2ntwAkDpH5pf45ZxFseJAd4cDCSV5 TQQg== 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=noHLrg0B0L5gQYYxd2vCEoVwGuMf5GJnS7EnbkZKdBM=; b=RN5pr6LDiB0ItesCSYBD7vlabniq3ikyPQwy2aoiDxujxiVg++v/FHK+p88EKt6dbO e0nL9U/rIe0/LTrW0mPAHHNVuTFRhK1z7r71I1DqYWZqT/9oE8RkAR6XS6JrAXJomvqi 2LsaLsRot4bE7PVk2OZkiRuqfdfPiuh2ft5+lKP6t1EUPmcM7yXqdEB3n9pN+IHEvNXh ZY/DaIWzwqXh4QqF6Eu3DXIzYuUauBIz1LuWGhsNp/Q1pRpK8NB7WIMe64asCZgg4wf8 zSBcRF+YWm3uO2CUqcHB7oP0Cijo6/HI6Df6kD7XhACz5ZK8CM6gVsQ5Vg4usTg7AhQ7 Ogag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=FCy9aCMw; 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 w11si12539508pfl.184.2017.07.17.06.54.42; Mon, 17 Jul 2017 06:54: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=FCy9aCMw; 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 S1751385AbdGQNyi (ORCPT + 25 others); Mon, 17 Jul 2017 09:54:38 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:36522 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbdGQNye (ORCPT ); Mon, 17 Jul 2017 09:54:34 -0400 Received: by mail-io0-f182.google.com with SMTP id z62so43462912ioi.3 for ; Mon, 17 Jul 2017 06:54: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=noHLrg0B0L5gQYYxd2vCEoVwGuMf5GJnS7EnbkZKdBM=; b=FCy9aCMw6Q6unE3M7WO8UfSSeiFsyXPfrdvaDimt0UOVUkXbqJ06Xg6xkcOxG1AfxN GPn5lG0M3nSRT60bxFtxLxA4htLWBsmkloCvOzBUF3TZ+4i/HmYU1v/Dx3A28qlddPXE kLR8NNiYMN6g1Lz930ndPKtwVb/Yj8umfi7vE= 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=noHLrg0B0L5gQYYxd2vCEoVwGuMf5GJnS7EnbkZKdBM=; b=LjzPYCPCKskZSl/VTGYKSoY2bqYQ6Rn3HKRJn9eV0Rt0e0/f2M87bL6+Wr3EkbJM2m VOFI2bXJXnO1lya9PnvvIME04SVmHP0buMAELFv5EufQ1lKCKcpkC90NaaaNVl5+MiGU V2ChHoM+guMVkNHpW8+pPmjHPTTeZRL4NMSsLHfU4iSlRJqoimrTqhtayT6Pg0PMOG+1 7N1BxzI9mvkQyPTLiC5knNxhwpRK8ATZqCVHsx8NlqQn1TY/bHhvH5qeFk7LshwrsVda 6Kduue8gHh5gyf0xJaxI5dsG5aqi+VEUuS6MTR7E+ZW6ArOlXla7B8yz/rDIxowvAIK7 ZcVg== X-Gm-Message-State: AIVw1110psy8ZWxhxUJzW1U0+TR5CeBhHNXrjkUjx7BV5mTvXlaAj9VN llk6oBcXds6yl521nhB91A== X-Received: by 10.107.133.84 with SMTP id h81mr21659972iod.230.1500299673516; Mon, 17 Jul 2017 06:54: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 138sm5880561itw.10.2017.07.17.06.54.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:54:33 -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 2/3] ASoC: qcom: apq8016-sbc: set default mclk rate Date: Mon, 17 Jul 2017 15:54:09 +0200 Message-Id: <20170717135410.26812-3-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> 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 | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.11.0 diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index d084d7468299..1064c1b85c63 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -34,10 +34,12 @@ 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_dai *codec_dai = rtd->codec_dai; struct snd_soc_card *card = rtd->card; struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); int rval = 0; @@ -68,6 +70,10 @@ static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd) } + /* Set default mclk for internal codec */ + snd_soc_dai_set_sysclk(codec_dai, 0, DEFAULT_MCLK_RATE, + SND_SOC_CLOCK_IN); + return rval; } 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: 107961 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp4594640obm; Mon, 17 Jul 2017 06:54:56 -0700 (PDT) X-Received: by 10.98.76.145 with SMTP id e17mr19238755pfj.78.1500299696352; Mon, 17 Jul 2017 06:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500299696; cv=none; d=google.com; s=arc-20160816; b=KeTwZ2ObTnIO+RsGq3PbaTL9l151XTwQPnahzwTyD1I58ZHuv6rraBhAjgwk0OVSUD zRdIDslLo9BQpnmKjP9md7rY1KgzchMJ7S4hSLShHrsgFH7/o+P+iJDQgTdymcYg9dvG GVrU53y1jOXIGUBMRDTUoDi60H/0qFdqiu2MIMOQBF6xqJzEYi60Y1qBQTTraJEgprKq iCWIDj9LUI+t18mTN7WBYRSah+1Vjd8QeVxmqh2EOULsOlCG2sapLZKBRxSX3/CM8GVc ghOiQCSR/tI5mTB2/m8y63LE4Ej/XK/IgOlz6sgRquJ2uTb80cRAlge/US27oi7p7CM+ vViw== 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=e7sCsayXZozxMb18/kCm23DklQtfgyFc0n4U07Em41c=; b=EnvzQ+iUZSHorFrBMHFMl9oUndyw+toWcJuxi4/M7Q4omQTA5hkyC8YXCTxP5+yNRB KlthSeg7ASZFhq4ZdyrTY5fJIJP9amGKn6gCH3WWnjhwqSCVuVddJc0qixA82KEzAoRX KhZI+01qOqHUNKAsX7vYGtLm2IinxxZaXcth2KtyydVq/sfE27JUy3KU1rCfhaoMzkJ1 Gh/CFT3F9VwQ+ouu2zVd4FTDmtV3czNc5Kb1RqWTjb3xCzNllIwNB/VN0sFrJ6ZgSh5o yp31rE2+PTpm/vqmfOM3rmGzg2d6CHMMvcAXk1j7m8/zhKQ7JzH4G7ibUIWBOdm2Qeq2 dDSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Nzwvb7dN; 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 g3si13240563plk.571.2017.07.17.06.54.55; Mon, 17 Jul 2017 06:54: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=Nzwvb7dN; 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 S1751403AbdGQNyx (ORCPT + 25 others); Mon, 17 Jul 2017 09:54:53 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:37328 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751286AbdGQNyg (ORCPT ); Mon, 17 Jul 2017 09:54:36 -0400 Received: by mail-it0-f41.google.com with SMTP id m84so52167532ita.0 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=dta2tt8ZRkGjt/s2KZnNcwl/lH5ClfvV8it+/NtfMTyXm/Ahq5gHnGOss+Mlkkb3Vr wXc4WANfYg/AgRUHXgvzqBo/8Z6aT3+v22kVRYY1JPQ3D7a0O07K7U9rnWFpZP9xxwkR 6ce/wL9iuncLAWp+yKJoQ4VsV95SKDFMhbTvxy6/U41NO5E3gHZtBtIAci2QBDsv4tMQ nNLqqf9l7THvOGBpBmdSqhvOotH1A10oqpr0f92wkdeVM0i7abssTFKCdcGdjDvVKgR2 7OccWK0U+Mr3iWEzDCK/OCVc8Ufa/MCQMkgHR6ittKxwxaty1AHZ+jYKztwv5os10Jna Ltlw== X-Gm-Message-State: AIVw112LDGVQZSLBNlkZh31YWZe2EiXP6Q2OUJuSm0v1DdphR8f1vN7M MfVJeXpsIJAr7MQ7 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 Cc: Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 3/3] ASoC: codecs: msm8916-wcd-digital: fix dmic support 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> 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 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(+) -- 2.11.0 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), };