Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp326885pxb; Mon, 16 Aug 2021 06:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfSKhkNoz3hUapft6pW+1NSHO71F5bhBiPadmFzPDgMDm6px0WJ50BiodpxNohB25m45nV X-Received: by 2002:a05:6402:3589:: with SMTP id y9mr20263111edc.247.1629120240337; Mon, 16 Aug 2021 06:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629120240; cv=none; d=google.com; s=arc-20160816; b=hLd3y/8HHz/wc/yYmJddN6VbITV76oWGVrboeuTgUGjiTkAPz+/2at6qN+pEp2WDic 6zhIlqPo3kBcjmqD+mIOeIkIjoJheXJ2mx9jzZ7jaVnVk7QK1rv93H3kjoM7MywEIvkA YTRJdFVDDR+5V6gji3pSTSSwJiFs8skd3l9Sig//ktsrOSgRRcCWih7dUZ9NK6eUn5wV 8gXqbChb5n/Mkqh8ku3qfUPqQSkpYiZoDMWloORuT8f5vOt9VSA6L+4tywJHDDzbnXIQ Uuzz8hIHa8KJjB5JPoxjTwpX4DBTbqpMl3DCN9grqqTi4LSr2oxjtEO7l1d93AOr5WQB 35cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zf+ClzBuqfEN5lM6GC8fiu3dCkx/hn3iJKv+8vwnYE4=; b=N0cftz89aN7RjDEBohH6KVoEptXZqckE8BfVK8m8BuyvUSAOhjFR4DSpsh03tdXNkV iNeCvC2wk7uJvdeJDACdbphsHhlSlYXI5xmdTCP66og6JN0c1B+THcOCwa5UUxoPGitt d+uV5VkoSeJxdyh+bLkOKGXTxEzpDCGd1XVzceeZ/Eb2xrNkrv6/ZIi6A+EUFJNrA/2R NA99BbCReyMFgkZ7uQQeTKiFA2i2qeWNLxfyjcWnz3O5DVKkLpcQ273hPY0oXQtk9VNE Ri2UVvutoyjad4GhHphYhmxKWg6VFDUNTHL4iTnKKw81td3JVi2P3FODBGOHp+gxVzE4 7i5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="I/DdvyHd"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si4012563edc.268.2021.08.16.06.23.31; Mon, 16 Aug 2021 06:24:00 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="I/DdvyHd"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbhHPNWe (ORCPT + 99 others); Mon, 16 Aug 2021 09:22:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239754AbhHPNOh (ORCPT ); Mon, 16 Aug 2021 09:14:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87BCD632C6; Mon, 16 Aug 2021 13:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629119488; bh=ytSOdjvMoHCvvmXSDtw8YN6Tm1fNm25S8bOTjIG/qRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I/DdvyHdJzSHe6T7j1SG8uj/4JTxrK7Z+WirS6YbwxiEs//HsB2AmOniCuAJZXKAi P1DAoZX9U0K944Gb4AGcEcEC0IB83SoEKMaTRf0BLx0C7MgWM7ntaYUX+DQB/pPKNw LeemaRMwrojw28SA7H/4utcBDaw11s1qR1dMB2L8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Fitzgerald , Mark Brown , Sasha Levin Subject: [PATCH 5.13 045/151] ASoC: cs42l42: Fix bclk calculation for mono Date: Mon, 16 Aug 2021 15:01:15 +0200 Message-Id: <20210816125445.559665412@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210816125444.082226187@linuxfoundation.org> References: <20210816125444.082226187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Fitzgerald [ Upstream commit 926ef1a4c245c093acc07807e466ad2ef0ff6ccb ] An I2S frame always has a left and right channel slot even if mono data is being sent. So if channels==1 the actual bitclock frequency is 2 * snd_soc_params_to_bclk(params). Signed-off-by: Richard Fitzgerald Fixes: 2cdba9b045c7 ("ASoC: cs42l42: Use bclk from hw_params if set_sysclk was not called") Link: https://lore.kernel.org/r/20210729170929.6589-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/cs42l42.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 0d31c84b0445..fe73a5c70bdd 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -820,6 +820,10 @@ static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream, cs42l42->srate = params_rate(params); cs42l42->bclk = snd_soc_params_to_bclk(params); + /* I2S frame always has 2 channels even for mono audio */ + if (channels == 1) + cs42l42->bclk *= 2; + switch(substream->stream) { case SNDRV_PCM_STREAM_CAPTURE: if (channels == 2) { -- 2.30.2