Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp335587ybg; Tue, 9 Jun 2020 01:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5UJbtksWOt8suUoLUbER03PwUWdbHSWifPfV1NBWmJ5pO3x19c3uXVxTX6w40ip3JysHM X-Received: by 2002:a17:906:4a8d:: with SMTP id x13mr23504944eju.26.1591692017612; Tue, 09 Jun 2020 01:40:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591692017; cv=none; d=google.com; s=arc-20160816; b=XmgxD0TWfPbMz3R3wjAq7yt76fcX+hk1JDV2t1Ur/P9bVwE+PCt7q1O7G4tXW8o0E3 JjQa/VoFNVf30UrcM26BZeWC6PL9Z0rLL7Gu0CD6c5VllvB7PtJ79ykcOVGKmrROYrFG G0eXCeE6/WIF5gR1G99dHXNwpi4xRk8CXy25SSTtNNH49b3OuRtKenVNAHgtSeeSLPn0 BtwLXobNO8FR6xD1BXIknSkILcILsu4CuOux3plWk5LNCxr/qIMmov26/p714kyqccwm Vsdc3yYVpgeO27izSQgCq1EMAb0BmH9ZqbrRywofwykL6goyyoygiAyDXR1sRptCSlqa DnjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=jQoAD3CwIvGaUCahdIlsqa1aWUrOIqxaXiPIGOfDVaI=; b=PB+rerJcHCHBpJdEWZFyi9Tj0PAMdm2Wj2X0GLiUulRIkh7ccjADoUUAGuDhCEmG21 mJaWVtizyw4xmOV7O54jx2WPVMHsnO6POdzo4V+Ft28cpgIZb5+WBJZDLbM1gkoVBhoO IbEmVfbrK/jtx6fblafWGBh00liHp5oxImIpC3Hw9tE4bi3w+J4Wx2ww4wKBEhHWp97b 4VR76o1h8nMISbRmezCv9uaOOdYlXEo4nFtEuq48do63CWl5nSO8JtFfqcjkC/WXR5tc myfDHQM6nxGhAcYPsUoFR23jMmul/KgNZKKCBmY9JjNaQlGsia61i1AuQz9pblOXyOCx YDhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si7475492ejr.634.2020.06.09.01.39.53; Tue, 09 Jun 2020 01:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728105AbgFIIaT (ORCPT + 99 others); Tue, 9 Jun 2020 04:30:19 -0400 Received: from inva020.nxp.com ([92.121.34.13]:40416 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbgFIIaS (ORCPT ); Tue, 9 Jun 2020 04:30:18 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 596BB1A12E4; Tue, 9 Jun 2020 10:30:17 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 305FC1A274D; Tue, 9 Jun 2020 10:30:13 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 8AACC4033E; Tue, 9 Jun 2020 16:30:04 +0800 (SGT) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_ssi: Fix bclk calculation for mono channel Date: Tue, 9 Jun 2020 16:19:28 +0800 Message-Id: <1591690768-1691-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For mono channel, ssi will switch to normal mode. In normal mode, the Word Length Control bits control the word length divider in clock generator, which is different with I2S master mode, the word length is fixed to 32bit. So we refine the famula for mono channel, otherwise there will be sound issue for S24_LE. Fixes: b0a7043d5c2c ("ASoC: fsl_ssi: Caculate bit clock rate using slot number and width") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_ssi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index bad89b0d129e..e347776590f7 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -695,6 +695,11 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream, /* Generate bit clock based on the slot number and slot width */ freq = slots * slot_width * params_rate(hw_params); + /* The slot_width is not fixed to 32 for normal mode */ + if (params_channels(hw_params) == 1) + freq = (slots <= 1 ? 2 : slots) * params_width(hw_params) * + params_rate(hw_params); + /* Don't apply it to any non-baudclk circumstance */ if (IS_ERR(ssi->baudclk)) return -EINVAL; -- 2.21.0