Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp277556pxx; Wed, 28 Oct 2020 04:49:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXqgdNdmgyz7FK1zvJc/rb19exEAFm9oiSIuIyPCfHt9b/SiiiZmxQVuxYAOocM+HZfmWl X-Received: by 2002:a05:6402:1148:: with SMTP id g8mr7502589edw.271.1603885791301; Wed, 28 Oct 2020 04:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885791; cv=none; d=google.com; s=arc-20160816; b=h01XOtEb5hIGLRrkew/AzIVTTssi1Cb0ZBF4TLvXuBc2lsk3OW2CKC+7xwSNX2k3kJ J5lWdHXzs4Rq/IxZNXt+hi7orYiSTAWAoV+LEhSesxF08IR/6x6dB+Hf1nlK/pA0iY9Z pwAmnDW9IyDoQxsSHh8DMBYqqCN/0P9dY5VU/3RxjUBfDDeSRBJce63KwvCxMT6q8hGN 2m4ZAuHgMRQ8S5SrgxvfUJMcm17SHNX49KahPf5X4vAjI6EnCdXONJKiroopRLv5//lL Ubagkuivd/k+pqdypTmyAvLM5xNhc25as5rPVM4KfQNaZVxhMe0aLNIEkHqKzwMI7Jcu WZRA== 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=2Bbdsr6qquQFVSgOuZ7Uh1UX50WAOK5PRfNMkPgk8R4=; b=pULplWBovin8ebPv+AjH7ui+IAoyTHJxqGvSh5iO+5A8k6M43ov1OPJDI9HSQPlcXJ VnpJQMe3z1dFlZSS/HREF9D6RgnVB/O0SQxxOkFKapYflzq0eQXv+s6jcANsUFxBKss5 eWN7F0nPj90kAf96Ds06lcp5xGipIkErpmIUfIAON4Ti8ospGqW/jc/p4JYQ3mYfRYaF uaqsqqvQ6C/A/JlomHBJT2qe0uEGCu+8t9C1Rjmdq/JQhdvUZiwvlHlsJKNWjDgfoQjq 5yK3G1D0wUy9yWYkzeQFLHhn3qfejuzQFc1ai0dS6LfopiomZ2l5WF1mUKo9Ml5/Qp35 mHMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IXURm2Xl; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg14si2653130ejb.82.2020.10.28.04.49.29; Wed, 28 Oct 2020 04:49:51 -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=@kernel.org header.s=default header.b=IXURm2Xl; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794572AbgJ0PM3 (ORCPT + 99 others); Tue, 27 Oct 2020 11:12:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:33842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2899198AbgJ0PAl (ORCPT ); Tue, 27 Oct 2020 11:00:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD13A22284; Tue, 27 Oct 2020 15:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810840; bh=JCqkuyZ3RSpGTdzTJQyAtefNvboJJGIa/QlusIln+oM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IXURm2XlStKzxki3aF3YcZGMvMfV8dynf4VGKBYyx3ul5oyok5BVzpjwRE/EbVABO SUWIxfnDf2xFbCVUp0af2xAQHBbOeaQv762r6JqrVycEAwrbyMPmaFh1TsgAJWU0xT KhZidLg+cLH9HEavlKAdGJkylzLSC5ADsiRFtvF4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexandre Belloni , Miquel Raynal , Mark Brown , Sasha Levin Subject: [PATCH 5.8 250/633] ASoC: tlv320aic32x4: Fix bdiv clock rate derivation Date: Tue, 27 Oct 2020 14:49:53 +0100 Message-Id: <20201027135534.405128668@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Miquel Raynal [ Upstream commit 40b37136287ba6b34aa2f1f6123f3d6d205dc2f0 ] Current code expects a single channel to be always used. Fix this situation by forwarding the number of channels used. Then fix the derivation of the bdiv clock rate. Fixes: 96c3bb00239d ("ASoC: tlv320aic32x4: Dynamically Determine Clocking") Suggested-by: Alexandre Belloni Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20200911173140.29984-3-miquel.raynal@bootlin.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tlv320aic32x4.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index d087f3b20b1d5..50b66cf9ea8f9 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c @@ -665,7 +665,7 @@ static int aic32x4_set_processing_blocks(struct snd_soc_component *component, } static int aic32x4_setup_clocks(struct snd_soc_component *component, - unsigned int sample_rate) + unsigned int sample_rate, unsigned int channels) { u8 aosr; u16 dosr; @@ -753,7 +753,9 @@ static int aic32x4_setup_clocks(struct snd_soc_component *component, dosr); clk_set_rate(clocks[5].clk, - sample_rate * 32); + sample_rate * 32 * + channels); + return 0; } } @@ -775,7 +777,8 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream, u8 iface1_reg = 0; u8 dacsetup_reg = 0; - aic32x4_setup_clocks(component, params_rate(params)); + aic32x4_setup_clocks(component, params_rate(params), + params_channels(params)); switch (params_width(params)) { case 16: -- 2.25.1