Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp525558pxx; Wed, 28 Oct 2020 10:17:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZyL5qiUCI61NrcUh7PdA5QsPsY3hQyavynkI/YGfrakaIS5KtecF1LA9Y4bmkz2ntl2qA X-Received: by 2002:a50:ec8d:: with SMTP id e13mr8618662edr.143.1603905450365; Wed, 28 Oct 2020 10:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603905450; cv=none; d=google.com; s=arc-20160816; b=u5SUztxvvwz9ctbuJz1RfxNr05zd2zCeOw8+r9C3VVSKNjrOl6T/oES9UtPNMlJ7Pq 09s47EYYaQOnB9W0MdX1jHcd6dTw5TGmbrRO14VT1jksYISE7732wxxYLvuZ4rxnhQUS wNWG64q5+XBFfyeFTt1XtjLxJCj6pLpfWcP0K1oX9NsrN8KSV0tQmlufr1LZUg54BPFg E/wr+2MfsVpoo+tJZ2kdaxBbKA+zB3R6zK1N2YWRCnikJGrUuXZqloxNNFuJespjW3hu +slB5v5eKzoxTmu3/r4VHMhNsj6FVTgFvB0zu+ESinxbk5rruQQjGLwOeBcJOdCnq9f1 QCvA== 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=qZDfwi31+Lg03enEqvUd4QarMZKzZi+fgN7l5+Ap7kI=; b=scsYItgkELIVLpvE1BKw4G5uTuTZ6+bv0BMMmxrH+0LojSZHE4zNyoFh/5OoA/vB39 LSChqZswY9FZuCiD3QxihPFPa8fNaQBjSajn/eYe2CgsyMwHyvvL0Y+L5LjDyt2EiqyK 0EMompT7gpKJ/XOd3b3b6dkDv8MShapTm3tRKq4mdueowhYgC+TmpwqVxV6dWKVhOMOk xWrssnWMzrSJ4o/z3W7pXoDbvB4FqczVpRqFjEREuLzsaSeeO07Y4PIo0bOEC6YceHIM hxqpiSKQ8uQQ5oYBEtNI0IcrgBU+G3oDqnQmt0NP1kPdoYpWUflOrRs+Bln6fum2WWU2 sdqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wbjEIST2; 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 d23si10484edy.397.2020.10.28.10.17.07; Wed, 28 Oct 2020 10:17:30 -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=wbjEIST2; 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 S1820725AbgJ0Rhi (ORCPT + 99 others); Tue, 27 Oct 2020 13:37:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:34158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760601AbgJ0OfY (ORCPT ); Tue, 27 Oct 2020 10:35:24 -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 04FA52225E; Tue, 27 Oct 2020 14:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809323; bh=RcIzurEMObCL2BqpbK87Mn1TjLYSitSSXF80HUIWTNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wbjEIST2t2/Un4EQbqHmelY7Uo7SNWo5hQDNqKCmZMdMWVWnPkfvTPszTgG6fLAmK r/2hpVg0xJ1j46LUxkgahn4sM8keLf9bLXHgpGgSbqdElLtl7dOVVCUe0jU0kKljN4 EOWkFf9G1NdRH/SemUryHSJjSXT+1q73qUyqfed8= 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.4 156/408] ASoC: tlv320aic32x4: Fix bdiv clock rate derivation Date: Tue, 27 Oct 2020 14:51:34 +0100 Message-Id: <20201027135502.326027443@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 68165de1c8dea..7a1ffbaf48be5 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c @@ -662,7 +662,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; @@ -750,7 +750,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; } } @@ -772,7 +774,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