Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3324803rwa; Tue, 23 Aug 2022 02:52:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ai5GdTV/4QoYvNRpoXaMz50Y7x7T7fB2YpnFywmghKS67xUJRNVJTq1g4pVNgaxl9tVG2 X-Received: by 2002:a17:90a:9486:b0:1fa:ad51:4a78 with SMTP id s6-20020a17090a948600b001faad514a78mr2480114pjo.176.1661248349753; Tue, 23 Aug 2022 02:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248349; cv=none; d=google.com; s=arc-20160816; b=GBDKeFFFo1LI0hn656YkwRcQiQlfV5gbG+dPpHSzCvMZv6b4gxi6GNcqLdZ2kgppoG OchX8pX32IzH91Nn+9v6HvbnHROphtJeaXJHdP/2kG9JWmII46KpmbW3slCKgHEw8+wl ckwl7zi95/sNmytkDLWcK5iX1C6UFqTtzTBMhFRsisO48xnWiEPiWqiF44/V7hvEmYnH 6+MhEremE/8xeJP+UdxaI9bQJ+C1VJcatOPsM7Eh9b3IHWMWN5wtl6sp5LMRJJVOm0qI wVdJCaECB5t4c4d7dXn79BT5aJv+trRQ7AlYB3aIsdqyfajlj6+aKbifY0no3kEsIvhH ylEw== 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=aZ12vSzBJifgyHQU6Z9RKro4bt/MW9vby5/701cXkbf6ChR4CRThQHG3BsUiLQ3Zgp kdwf66PSZKom8fBGPH4adHxqh5cylkj9ER++D0J6aarBV0YelqFq8peLaMAf8K4TVu7K YFpfLr3f4X7V+tyVJKSoQCzBnRePQfgl5NPZOrTNfmD/iFcms4LsG/baJpJZi08d4/dC fDZ1qpXRSfv42Fn1U3lwDoKmauOlbSmu68RojmJ8qq5y7eEGGUsC6yjIwJvSKDJRIRnp eNAfFDxrBiOI+Z839sJh7SFmGKcuRjUY9SbxwYl2qZ/OnOryBKBaT/HQeZQPI7bJw3g2 WCjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qj3HGkjw; 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 k6-20020a170902ce0600b0016daefb1c72si14725196plg.263.2022.08.23.02.52.19; Tue, 23 Aug 2022 02:52:29 -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=qj3HGkjw; 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 S1348513AbiHWJMN (ORCPT + 99 others); Tue, 23 Aug 2022 05:12:13 -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-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;