Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1278444ybh; Thu, 16 Jul 2020 07:56:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvG43qDUrLGn3H+TQLY9lfxFhcaWtF54BhIKUPPg/WyLsMbw3Eph/CFZhBWTAzIc0ts2v8 X-Received: by 2002:a17:906:7d9:: with SMTP id m25mr3987624ejc.25.1594911370040; Thu, 16 Jul 2020 07:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594911370; cv=none; d=google.com; s=arc-20160816; b=ZM2748QT/tjNe4fQzDWENFDogdLiYH7fECeOharSDAdfjfSv5s3V//YN0toEAMirqe 7HxdwoPIh4tD4/kPb7aQF+0enLY1UeuB8ZdJRn/OEaR8totWEkld2+midp5hFWgaGzoF T+EZgrwqVskBZZcwzOdZXzuPFUYQdFKHDmGRiUPNytYhyIAmA1USwjiEH/plf2hkGso3 48/I7Y7x1VEice/d3gEJNrR/RyjlLu2IghYs5IK0OPbQT3up3AUH6aaOt0RY/n+EhRGB z/n7irncYumpUdg4dApI9XnOCWmDaELjOVDQ+V+EflPnC6q576+3XQPNAUhvXqc8ackc XO2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=skCDbhENF62LhjTpa7t21/w/MwHytRyIVsv+OARwnNI=; b=RM1ftExFjYvKJa0CuVlAM6xY9X66nW1UvDwHFDdHN+fTs/25XxfNk+bI8dkU/34Vro LknmvajyDhufXscxrivNVmrrU0VfYdmLYYaa0WX7TiJIGSwEByc8E/Z5jX6yQSr+e0Zl EWqTANRA+HAeFzXxcjMBeI0FD94LjfEcQerEA2K6yIEfZD/egkvEpwwiDg08X1tuC66P tIjFrJ6zf1XK9DqIKlg2ARQwDOKa8xGzI51UrZN9+t6Wh49WhLw/6duMTtQO3x696GNy GOsR1HpZMU4vYTQogzxtdMYlsYpreyrxC88O05rtPaqHQLNQGJGGh1TBiUjujWH+ao95 WQmw== ARC-Authentication-Results: i=1; mx.google.com; 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si3075064ejb.364.2020.07.16.07.55.44; Thu, 16 Jul 2020 07:56:10 -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; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728834AbgGPOwl (ORCPT + 99 others); Thu, 16 Jul 2020 10:52:41 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46564 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728678AbgGPOwj (ORCPT ); Thu, 16 Jul 2020 10:52:39 -0400 Received: from xps.home (unknown [IPv6:2a01:e35:2fb5:1510:95f7:ce7f:fb76:c54a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aferraris) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 421E82A50E0; Thu, 16 Jul 2020 15:52:38 +0100 (BST) From: Arnaud Ferraris To: alsa-devel@alsa-project.org Cc: Timur Tabi , Nicolin Chen , Xiubo Li , Fabio Estevam , Shengjiu Wang , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, kernel@collabora.com, Arnaud Ferraris Subject: [PATCH 2/2] ASoC: fsl_asrc: always use internal ratio Date: Thu, 16 Jul 2020 16:52:01 +0200 Message-Id: <20200716145201.186270-3-arnaud.ferraris@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200716145201.186270-1-arnaud.ferraris@collabora.com> References: <20200716145201.186270-1-arnaud.ferraris@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Even though the current driver calculates the dividers to be used depending on the clocks and sample rates, enabling the internal ratio can lead to noticeable improvements in the audio quality, based on my testing. As stated in the documentation, "When USRx=1 and IDRx=0, ASRC internal measured ratio will be used", so setting this bit even when not in "Ideal Ratio" mode still makes sense. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index bfd35b9c0781..cc0f70c9140f 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -465,7 +465,7 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate) regmap_update_bits(asrc->regmap, REG_ASRCTR, ASRCTR_ATSi_MASK(index), ASRCTR_ATS(index)); regmap_update_bits(asrc->regmap, REG_ASRCTR, - ASRCTR_USRi_MASK(index), 0); + ASRCTR_USRi_MASK(index), ASRCTR_USR(index)); /* Set the input and output clock sources */ regmap_update_bits(asrc->regmap, REG_ASRCSR, @@ -507,8 +507,7 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate) /* Enable Ideal Ratio mode */ regmap_update_bits(asrc->regmap, REG_ASRCTR, - ASRCTR_IDRi_MASK(index) | ASRCTR_USRi_MASK(index), - ASRCTR_IDR(index) | ASRCTR_USR(index)); + ASRCTR_IDRi_MASK(index), ASRCTR_IDR(index); fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc); -- 2.27.0