Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1179556yba; Thu, 9 May 2019 12:04:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz4gAI6570qmZPku+C1Mh1IiOtCXdUWMf7f2Dd6dJIpKZumwGrzAWGtsrNfm+ytScpKQLz X-Received: by 2002:a17:902:74cc:: with SMTP id f12mr7396203plt.213.1557428687390; Thu, 09 May 2019 12:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557428687; cv=none; d=google.com; s=arc-20160816; b=XDgpHjzF9AUN07JmlM1WjtOPwobqBiczF5/xycSXOi+P4PXXoWFmYcc7kktn6xuYpS J0ddwhMH6wJoEzkeatbVVYOFtdmdYwLnxl7aHqjrGjNzchJ4fi0ZjxjPjbZk0dcxPt7A LZ6ZHjv2qARbeKT0H5F6caAGC7IeS+Nc1vOw5hgsUVFefRi26Z9Q1540PKtXIwJ7kIL7 6GnDaZdfa3AONgWbcxKFFR5Sf1MQNgsPU4Ho81i1Wxp95Ve50oFeTvt4HAqAqB/0ZseX oAul16Wr2SE501vgXMRMTrzjgBk2E7d4ifSS/mPcPj4+WBkBNT+AjcOTmK/hTX/0PtY7 3tKA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f03XEZzw4HfIheZ81jIy8DQNtTxqG+Hoq2ynEo6KqLM=; b=PQ5/BBbvB0po4DliuwLslkOysfluNxm/t15UeVCyR1sEdyVnn/mJrK+WgZmoqn+1tk niVYlx7n3L61UsDe7qsnm712VPaVGlASUpfn0wi20gjeb0MM61t4ug1lftugHSSgKuNp iYVAJ9OekCdQQjT2vbC4DaDq5vmlx0vD4hLMrWjrLGgLnHS4gdbLCWxvX5lgqxoFbukq AkVJKj4znknNCtlXJ/QBuIPLp41qwKaiworxXgSbnjEhEcb81xWBnSqsv4wJQaRExALV F7DZhc93bHN9NdGBgQJwnUalyveGOrY0x01uGKKfpzd6YaMM9fATQP6n6uBYoG+Zcz1/ Berg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aO1v7cDn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si4074094pgl.348.2019.05.09.12.04.31; Thu, 09 May 2019 12:04:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aO1v7cDn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728537AbfEITCF (ORCPT + 99 others); Thu, 9 May 2019 15:02:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:43974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728417AbfEISu1 (ORCPT ); Thu, 9 May 2019 14:50:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0EB312177E; Thu, 9 May 2019 18:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557427826; bh=0zZtPe/QZmm1wOMxxCB1OieNmsIUQ3UbVlb0wPX58Fw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aO1v7cDneCplmkhOI93BcaexmUVhj/0tXCcHZe8Pw5QSXO+KwxLRpHSOWzzvIhWgh Btw/+X/gZLoh4CU8CZL5UgivKdP8x0dbjYSLsLltjhsd+ui0N50R4fpLzQEQTyWIbH 4f+e9Ronjm/x89QJdKHRYFSyV67h4wqhqgMBboQQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, JaeChul Lee , Sylwester Nawrocki , Mark Brown , Sasha Levin Subject: [PATCH 5.0 19/95] ASoC: samsung: odroid: Fix clock configuration for 44100 sample rate Date: Thu, 9 May 2019 20:41:36 +0200 Message-Id: <20190509181310.684874052@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190509181309.180685671@linuxfoundation.org> References: <20190509181309.180685671@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2b13bee3884926cba22061efa75bd315e871de24 ] After commit fbeec965b8d1c ("ASoC: samsung: odroid: Fix 32000 sample rate handling") the audio root clock frequency is configured improperly for 44100 sample rate. Due to clock rate rounding it's 20070401 Hz instead of 22579000 Hz. This results in a too low value of the PSR clock divider in the CPU DAI driver and too fast actual sample rate for fs=44100. E.g. 1 kHz tone has actual 1780 Hz frequency (1 kHz * 20070401/22579000 * 2). Fix this by increasing the correction passed to clk_set_rate() to take into account inaccuracy of the EPLL frequency properly. Fixes: fbeec965b8d1c ("ASoC: samsung: odroid: Fix 32000 sample rate handling") Reported-by: JaeChul Lee Signed-off-by: Sylwester Nawrocki Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/samsung/odroid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c index e7b371b072304..45c6d73967852 100644 --- a/sound/soc/samsung/odroid.c +++ b/sound/soc/samsung/odroid.c @@ -64,11 +64,11 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream, return ret; /* - * We add 1 to the rclk_freq value in order to avoid too low clock + * We add 2 to the rclk_freq value in order to avoid too low clock * frequency values due to the EPLL output frequency not being exact * multiple of the audio sampling rate. */ - rclk_freq = params_rate(params) * rfs + 1; + rclk_freq = params_rate(params) * rfs + 2; ret = clk_set_rate(priv->sclk_i2s, rclk_freq); if (ret < 0) -- 2.20.1