From nobody Thu Dec 18 13:01:49 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BEA6C3F6B0 for ; Tue, 23 Aug 2022 09:13:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348539AbiHWJMR (ORCPT ); Tue, 23 Aug 2022 05:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348263AbiHWJKD (ORCPT ); Tue, 23 Aug 2022 05:10:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F016674E0C; Tue, 23 Aug 2022 01:31:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 47597B81C3E; Tue, 23 Aug 2022 08:18:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E1BEC433B5; Tue, 23 Aug 2022 08:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242737; bh=v5/YKtomldikhe/i3h6gjddah5wV/t0Qwoy5NR3BAPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qj3HGkjwGSyeVQ0S2U3jJuo01kGAvwwwyJpuRx+Xm/gT2bD1P1GSH6yBeY3fZsFSF Fc+zhCZyDWnFTed93V0lKYrskH7XTn+vOqRjpr6YSSGILDsWAFz6t625NpsZkH9cep pX9TIw4fJmM+gvfN/Qs0KoQtwl2z6CvF8A9Fg+vc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Zabel , Mark Brown Subject: [PATCH 5.19 184/365] ASoC: codec: tlv320aic32x4: fix mono playback via I2S Date: Tue, 23 Aug 2022 10:01:25 +0200 Message-Id: <20220823080125.922323509@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Philipp Zabel commit b4b5f29a076e52181f63e45a2ad1bc88593072e3 upstream. The two commits referenced below break mono playback via I2S DAI because they set BCLK to half the required speed. For PCM transport over I2S, the number of transmitted channels is always 2, even for mono playback. Fixes: dcd79364bff3 ("ASoC: codec: tlv3204: Enable 24 bit audio support") Fixes: 40b37136287b ("ASoC: tlv320aic32x4: Fix bdiv clock rate derivation") Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220810104156.665452-1-p.zabel@pengutronix= .de Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/tlv320aic32x4.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c @@ -49,6 +49,8 @@ struct aic32x4_priv { struct aic32x4_setup_data *setup; struct device *dev; enum aic32x4_type type; + + unsigned int fmt; }; =20 static int aic32x4_reset_adc(struct snd_soc_dapm_widget *w, @@ -611,6 +613,7 @@ static int aic32x4_set_dai_sysclk(struct static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int= fmt) { struct snd_soc_component *component =3D codec_dai->component; + struct aic32x4_priv *aic32x4 =3D snd_soc_component_get_drvdata(component); u8 iface_reg_1 =3D 0; u8 iface_reg_2 =3D 0; u8 iface_reg_3 =3D 0; @@ -654,6 +657,8 @@ static int aic32x4_set_dai_fmt(struct sn return -EINVAL; } =20 + aic32x4->fmt =3D fmt; + snd_soc_component_update_bits(component, AIC32X4_IFACE1, AIC32X4_IFACE1_DATATYPE_MASK | AIC32X4_IFACE1_MASTER_MASK, iface_reg_1); @@ -758,6 +763,10 @@ static int aic32x4_setup_clocks(struct s return -EINVAL; } =20 + /* PCM over I2S is always 2-channel */ + if ((aic32x4->fmt & SND_SOC_DAIFMT_FORMAT_MASK) =3D=3D SND_SOC_DAIFMT_I2S) + channels =3D 2; + madc =3D DIV_ROUND_UP((32 * adc_resource_class), aosr); max_dosr =3D (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) * dosr_increment;