Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3398019rwa; Tue, 23 Aug 2022 04:14:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR4YXtLqCVdmb3XjSF6J8dVM0baSTuTDPYM/UDMXqXlhYeVAuCTqaou31ugL2/bCR+LOkFTP X-Received: by 2002:a17:902:ebd2:b0:172:8eee:80f5 with SMTP id p18-20020a170902ebd200b001728eee80f5mr24205240plg.9.1661253246345; Tue, 23 Aug 2022 04:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253246; cv=none; d=google.com; s=arc-20160816; b=Z6Yt3d5Hym5pXBwW+Yc418/tpunu/ltzJyFYMai70Zd7IUoGLj/gk91ebfr954w6b/ xgbSNbsLBLD7CprOGAlaxaQ6oXeKBqvwDpT5Owf1ynj9KsXD1HlWgY3GaL41O5ZqUk/S a2g4jyNgvW+r05lADVWxvuVG5sNC4TAhw/ad+qMJy5Ka11UcIZDrwapoEzloarRGXMrL JYmQ/q1BFZ0QXAYaoecs1tUoqpb9vXGroBjv+Fqfn4ZqlKhg7gHZYY2mMcOYNAQIRVUY 3KVBQkxGNhEUX9R4trCOFDEtuqdidwy2kdz+vYIS9S8CfS+n13LduVcebVi1kdeU1lo8 ht4A== 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=5/eGwWK5GK3ZMRfvNR9CTsErrtJJzcGSngTU/2mDcYo=; b=MeENI1t3yZMa8SQw5Z7ak5Y95a8UKRiIys8WzSTBHNNwJa1T+KOGy3ouhFA8y4cQZE ra+1qEJ4DXKFw4S5Ymlxdx0q0PvENoB+s2D6tzP0Pn3F2X8tA7fv4h8J4qDWmFQloRNo qSNAVTL2U1a+PF3Efutbgj1r/owhIfflfWmsE1B8Fit5MRhYnIAwa3A/PPl4WT0hnNsr GhIniH5KSsf1KiPjkDI0lLDtOBTuiE0NhRSfDFLJ4JIDKCgXwwH0pdduSdJp4jfQiFvJ 0TI7NkQmc/y28X8RsB5CigtJ7pmLlvUdAR4KtdPjtFaNNinLzniemHFRA27BSyp6usnS QJtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GAzXUwRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t33-20020a635361000000b004197e33daf5si16641130pgl.863.2022.08.23.04.13.55; Tue, 23 Aug 2022 04:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GAzXUwRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1352772AbiHWKIv (ORCPT + 99 others); Tue, 23 Aug 2022 06:08:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352584AbiHWKCK (ORCPT ); Tue, 23 Aug 2022 06:02:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E2D7C329; Tue, 23 Aug 2022 01:50:09 -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 C7468B81C1C; Tue, 23 Aug 2022 08:50:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EEFDC433C1; Tue, 23 Aug 2022 08:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244606; bh=v5/YKtomldikhe/i3h6gjddah5wV/t0Qwoy5NR3BAPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GAzXUwRupk6uElk0tOdB83kTX7dJpzZccYvDRXVMLRGuINwQJ1bzG3Z164d0vKhwx ujSRn4y6GncUehSLS6nZJGPYokrbQPMufwSD57tyPHkzXf7Jt/+Y+x8G+HKwbujMvA 5r6i9QlsCwZNBtpISWF0TRlOttjbUwH73fQLDRRU= 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.15 122/244] ASoC: codec: tlv320aic32x4: fix mono playback via I2S Date: Tue, 23 Aug 2022 10:24:41 +0200 Message-Id: <20220823080103.132900132@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; }; 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 = codec_dai->component; + struct aic32x4_priv *aic32x4 = snd_soc_component_get_drvdata(component); u8 iface_reg_1 = 0; u8 iface_reg_2 = 0; u8 iface_reg_3 = 0; @@ -654,6 +657,8 @@ static int aic32x4_set_dai_fmt(struct sn return -EINVAL; } + aic32x4->fmt = 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; } + /* PCM over I2S is always 2-channel */ + if ((aic32x4->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) + channels = 2; + madc = DIV_ROUND_UP((32 * adc_resource_class), aosr); max_dosr = (AIC32X4_MAX_DOSR_FREQ / sample_rate / dosr_increment) * dosr_increment;