Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp339188pxx; Wed, 28 Oct 2020 06:14:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7J80VVa9LhO17vhnn9ZuQfEbA0LG2/b67nsnev/UoETY38JPcQBm3UI2TsBmLAV+fFFVa X-Received: by 2002:a17:906:4351:: with SMTP id z17mr7392404ejm.110.1603890883106; Wed, 28 Oct 2020 06:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603890883; cv=none; d=google.com; s=arc-20160816; b=QYXcow/2PRI6/G8GdTSVTobmbo5KPNDH5XfaK6GyPQ5zEaMycrih5UnjJKawfrfuI+ fFRMocpjbApc5MgZXM3PwMJaUGk7fvQA+AyZWk+g4nvdO5ZTzmczLFt0QAHSbLjQfnWn Z9ZK/g99LuSgygcXfBY65Rk7XWxJ+QCKPjUruF4X+U97XyckqP2zMfLmP5zzS8X+hNrd ObtajMa7RHgxFpIcVAWVcj90QFBH4D+ypW5EmDjLbpSURjV/zMdA7V8K31wTcG6T2zlz MMM9BdK1WzlQge9XTjSMAwRdPiPWktIf61DXD/2eA3eOkDbUEkVj0dGNe1C5EGWdYUKL t++A== 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=SfbpfOF9LF+45K7eIH4B6g2V0FxpkQUx9K5B5Ertug0=; b=CnIY2co9VJTH/8p/dwkuBsE+q9Ey7of9InMtvuQr70xi97ZHhYXGwy+tGS+ovRNJOO JTg2qBIdmrHIDQHa6JCWEXK/XZvdH3rwshkKV8juAo1eUgN5VIdEvoku8iCQCyimqNfj DjLPFAUTf64luugW9dpEgjDjDcJ88O4Ct7NaZvupfuW+TF4SscHesOuX74jo9VxNECID 1My7lgzb/Vj6qUxN6HO7qdd1PRTYfqxwv9gotEQXYpkd8S8fs2QOm/065wFJ6loynZLl 4sjHmyn2tMD9wWvL1j22aH/mUI6sUS+uBoazqItbfTB7HLySH8MEUh44Cbvc5MxS7TfB MK3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=paCA+en0; 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 p17si2879649ejg.48.2020.10.28.06.14.19; Wed, 28 Oct 2020 06:14:43 -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=paCA+en0; 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 S1800285AbgJ0Pfg (ORCPT + 99 others); Tue, 27 Oct 2020 11:35:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:48538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1799439AbgJ0Pbb (ORCPT ); Tue, 27 Oct 2020 11:31:31 -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 6430A2225E; Tue, 27 Oct 2020 15:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812689; bh=qIWY+oNC93YEsxCZyy2GK+YLiQb0Cjimv6Df59er7qA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=paCA+en0bYAQ6Xzq/IMCoAYlhp1M0Ww5JMfW3kUnOi+Yg/kebZQjih0zjYAu7ns6x ItJ83hvpEvZnPiVrxlW85SBAd+mZO5BVeLB45lar+vN6vfAsEd8f/YaFQ5sxywEjwi GoOPm56lk27Q3FdWXq3xtrcFEhPAM5inZ6VaX9AM= 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.9 296/757] ASoC: tlv320aic32x4: Fix bdiv clock rate derivation Date: Tue, 27 Oct 2020 14:49:06 +0100 Message-Id: <20201027135504.444137550@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@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 467802875c133..2e2d8e463655a 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