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) {