From patchwork Fri Nov 16 07:41:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Kumar X-Patchwork-Id: 10685699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96EEE14E2 for ; Fri, 16 Nov 2018 08:21:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 897082D4B6 for ; Fri, 16 Nov 2018 08:21:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DC922D57A; Fri, 16 Nov 2018 08:21:39 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 76C502D4B6 for ; Fri, 16 Nov 2018 08:21:38 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 868F4267B0B; Fri, 16 Nov 2018 09:21:23 +0100 (CET) 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 2C892267AFE; Fri, 16 Nov 2018 09:21:18 +0100 (CET) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id 40589267AFF for ; Fri, 16 Nov 2018 09:21:12 +0100 (CET) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2CC7E60AD8; Fri, 16 Nov 2018 07:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542354138; bh=PKwOCpyVUgf2gi0v1K1HRwsQEfeFoBHrjB1CxZPLmSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HJz7YfDQViB0/7UZgZfDhQijcFMfqYstDLgk1xAAdPG6tcRGVIG8R8dcx4nrE5zr3 NaWm1YW9jOhzfO3XxGzcOVfLx3wtxfCe26ePRZhiXgo87FM8OK8C7YyM2oxHR1Z/5w Ps7l7OHmzF2TSM7AU6a9NLYGgW8odr3b0IgqFHvU= Received: from rohkumar-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rohitkr@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3C202607DC; Fri, 16 Nov 2018 07:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542354137; bh=PKwOCpyVUgf2gi0v1K1HRwsQEfeFoBHrjB1CxZPLmSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oBN0+otPebVEY1xxIXKDrw4qzDPCy4PG5t2oZdwFfHAMdX9JXc+ykevH09Og034J7 TgoRmpJ+84qbTZEN/c19fIeXnzi2EtXche8q88NBETtR7ZZZBDZhrF47lzNBpmYmT2 RUB9MvISrECHho4naTK7+F6AshE72livm2L/KbtI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3C202607DC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rohitkr@codeaurora.org From: Rohit kumar To: plai@codeaurora.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com, srinivas.kandagatla@linaro.org Date: Fri, 16 Nov 2018 13:11:57 +0530 Message-Id: <1542354118-23360-2-git-send-email-rohitkr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542354118-23360-1-git-send-email-rohitkr@codeaurora.org> References: <1542354118-23360-1-git-send-email-rohitkr@codeaurora.org> Cc: Rohit kumar Subject: [alsa-devel] [PATCH 1/2] ASoC: sdm845: Update slot_width for Quaternary TDM port 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 Change slot_width for quaternary TDM port to 16 and update bclk rate for TDM and MI2S interfaces accordingly. Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla --- sound/soc/qcom/sdm845.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c index 8d0cdff..84e6ee7 100644 --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -13,7 +13,8 @@ #define DEFAULT_SAMPLE_RATE_48K 48000 #define DEFAULT_MCLK_RATE 24576000 -#define DEFAULT_BCLK_RATE 12288000 +#define TDM_BCLK_RATE 6144000 +#define MI2S_BCLK_RATE 1536000 struct sdm845_snd_data { struct snd_soc_card *card; @@ -33,7 +34,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream, switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: - slot_width = 32; + slot_width = 16; break; default: dev_err(rtd->dev, "%s: invalid param format 0x%x\n", @@ -115,7 +116,7 @@ static int sdm845_snd_startup(struct snd_pcm_substream *substream) DEFAULT_MCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); snd_soc_dai_set_sysclk(cpu_dai, Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT, - DEFAULT_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); + MI2S_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); } snd_soc_dai_set_fmt(cpu_dai, fmt); break; @@ -125,7 +126,7 @@ static int sdm845_snd_startup(struct snd_pcm_substream *substream) if (++(data->quat_tdm_clk_count) == 1) { snd_soc_dai_set_sysclk(cpu_dai, Q6AFE_LPASS_CLK_ID_QUAD_TDM_IBIT, - DEFAULT_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); + TDM_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK); } break; From patchwork Fri Nov 16 07:41:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Kumar X-Patchwork-Id: 10685695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4769114E2 for ; Fri, 16 Nov 2018 08:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37C7B2D392 for ; Fri, 16 Nov 2018 08:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B8C22D4B3; Fri, 16 Nov 2018 08:21:25 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 6FA962D488 for ; Fri, 16 Nov 2018 08:21:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EE7A0267AFE; Fri, 16 Nov 2018 09:21:20 +0100 (CET) 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 B41ED267B04; Fri, 16 Nov 2018 09:21:17 +0100 (CET) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id 3E310267AFC for ; Fri, 16 Nov 2018 09:21:12 +0100 (CET) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1CFFB60BDE; Fri, 16 Nov 2018 07:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542354144; bh=fqp4AT1uIem7ySYLI609JUEky7lrVM8VWGL4thGluHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENN1QLlstWs2rcjqmRqW3BuwnbgJ/b5Kx46RfUFI5qPIA2Spfapl+tkPbnqnaPSM3 qBi1WRXMKhDV/eB2FLZ5KXIzIH/CN+IeAbj6hDPDIAhp+1k5PhonMpyKo6rBVN3dg9 JvM5b5bHWtJpv05iesJNPdt8gH9RH19Ic4xWL674= Received: from rohkumar-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rohitkr@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9128D6086B; Fri, 16 Nov 2018 07:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542354143; bh=fqp4AT1uIem7ySYLI609JUEky7lrVM8VWGL4thGluHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e2XN8asc6Zq4UMwA9mQ+gALVdb0ZLPHqsMHqxSFyN/ZxHhUqBjWm4RhBheP8q/mH2 TInw+hB2gNh3mKoSMiEeuTVbuSSsHrbxrbb3Usseakkq0LG2sGkTI/wiGEAAQljrne iSXzfAHmEsBd5Fz1xbtnhyrsquby+8NLROZyids4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9128D6086B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rohitkr@codeaurora.org From: Rohit kumar To: plai@codeaurora.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com, srinivas.kandagatla@linaro.org Date: Fri, 16 Nov 2018 13:11:58 +0530 Message-Id: <1542354118-23360-3-git-send-email-rohitkr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542354118-23360-1-git-send-email-rohitkr@codeaurora.org> References: <1542354118-23360-1-git-send-email-rohitkr@codeaurora.org> Cc: Rohit kumar Subject: [alsa-devel] [PATCH 2/2] ASoC: sdm845: Add support for Secondary MI2S interface 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 Add support to configure bit clock for secondary MI2S TX interface. Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla --- sound/soc/qcom/sdm845.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c index 84e6ee7..58593db 100644 --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -19,6 +19,7 @@ struct sdm845_snd_data { struct snd_soc_card *card; uint32_t pri_mi2s_clk_count; + uint32_t sec_mi2s_clk_count; uint32_t quat_tdm_clk_count; }; @@ -121,6 +122,15 @@ static int sdm845_snd_startup(struct snd_pcm_substream *substream) snd_soc_dai_set_fmt(cpu_dai, fmt); break; + case SECONDARY_MI2S_TX: + if (++(data->sec_mi2s_clk_count) == 1) { + snd_soc_dai_set_sysclk(cpu_dai, + Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT, + MI2S_BCLK_RATE, SNDRV_PCM_STREAM_CAPTURE); + } + snd_soc_dai_set_fmt(cpu_dai, fmt); + break; + case QUATERNARY_TDM_RX_0: case QUATERNARY_TDM_TX_0: if (++(data->quat_tdm_clk_count) == 1) { @@ -157,6 +167,14 @@ static void sdm845_snd_shutdown(struct snd_pcm_substream *substream) }; break; + case SECONDARY_MI2S_TX: + if (--(data->sec_mi2s_clk_count) == 0) { + snd_soc_dai_set_sysclk(cpu_dai, + Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT, + 0, SNDRV_PCM_STREAM_CAPTURE); + } + break; + case QUATERNARY_TDM_RX_0: case QUATERNARY_TDM_TX_0: if (--(data->quat_tdm_clk_count) == 0) {