Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1293534ybh; Thu, 16 Jul 2020 08:16:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrbH9wwFSmpLuWTOdCzWp/LuYtYpcjsrTSLBvaM+GIB+u4Yq4iBTJOZty2n1gb1HrOJUY4 X-Received: by 2002:a50:b941:: with SMTP id m59mr4788755ede.321.1594912580034; Thu, 16 Jul 2020 08:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594912580; cv=none; d=google.com; s=arc-20160816; b=dF01qwgDNZjXVfkmZ4nv7g72fe2SZWgv4huMXdHIkwKdz3P7a5QLDWRwr+XGiRmwkL ALY/PDVdr1GRwnfjQMLviNvjuf7d9exgY2iGUkSFtzkp200rm2IlmKRQDUhzPR+F0Zi5 iET6zVvueV4D7LiQ1rQV0jAvE0xUwDfqWOZovN2lsRfyOP4tL+iLUUzHSiQaPm6R23p+ ybZvjTwLZhfDVZEXjVGmC0FxzNV0aX9LOnunNlmzRstUVLvgSM7lxgFlzPokOTvROkgl VgNhS1jM1Bg4jbve948JTjR9vdvsroWAHReKEwmrSmQTT90Geacdo4/waKdy4cWsO4pQ 70GQ== 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=IuXzAnXT03Pat2hLLJMMX9SB10U+37e8HvRfydsnFnI=; b=r7tCFmWuSp/XolOMb58leHTNBHT02jYKUKzg5i3cZLmVTVLO7RXp2lzliqBvwuazvN 97RnW8FrBzP5COgHeBnQ3WF6cR5hyP5TbvLrLt43/k4vGH22/5UFpAVnOlA4M0mSQO4X lDmOKGIordqrYAaA9Axi/cWdNF+4y7SnfddDP8e+PqeXAMCeOxeHqarlnJoD5iO+kMNk sDvNHMwv8cafG8O8XUPSNxP5hzXn1NgK+3vQP7L54F+qH9JRi+t4jk5sSJtfGAcz2ZBC DYNA+uLgaJiawKV9X/Xl25GHnFA6HCoHy3R9zhVV0p4cBVNXZwdtt+7MUGN/uSMIoWcC /s4w== 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 v27si1995784ejc.624.2020.07.16.08.15.56; Thu, 16 Jul 2020 08:16:20 -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 S1728783AbgGPPPU (ORCPT + 99 others); Thu, 16 Jul 2020 11:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728552AbgGPPPU (ORCPT ); Thu, 16 Jul 2020 11:15:20 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76891C061755 for ; Thu, 16 Jul 2020 08:15:20 -0700 (PDT) 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 1A5362A5297; Thu, 16 Jul 2020 16:15:19 +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 v2 2/2] ASoC: fsl_asrc: always use internal ratio Date: Thu, 16 Jul 2020 17:13:54 +0200 Message-Id: <20200716151352.193451-3-arnaud.ferraris@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200716151352.193451-1-arnaud.ferraris@collabora.com> References: <20200716145201.186270-1-arnaud.ferraris@collabora.com> <20200716151352.193451-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 6d43cab6c885..0b79a02d0d76 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