From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C997C43218 for ; Sat, 27 Apr 2019 01:56:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA39420679 for ; Sat, 27 Apr 2019 01:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556330212; bh=leyroQKv0L1MrUXY10KB1SmLHOLip/bil2w3Pnm6D2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LJVGK7h6N6HJpMpkFXemcv1Jiw8So1PDKtgZQdDhyssHH4nQ2F+upbtn1sIkkH6gB MmEuDi3R72AoKMLhpNzaW6RpcfKsagP13p1D3fCT75vY1M3tmqY8aKuiE8j44d5JId 7TXvNPbS076W5i0kyP4CCO0+h2c/3LggpQgd/ZpU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727868AbfD0B4v (ORCPT ); Fri, 26 Apr 2019 21:56:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:41832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727189AbfD0Bix (ORCPT ); Fri, 26 Apr 2019 21:38:53 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D83E5214AE; Sat, 27 Apr 2019 01:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556329132; bh=leyroQKv0L1MrUXY10KB1SmLHOLip/bil2w3Pnm6D2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k3rMW/RbKVe8c/DlaijYAF+VFuwkCN2NMv7YVXJ1q0p2KHzZsuzipWQkPLs6Iq9Iu hVGj1PatWPDe1lWMKwUe8z3c4DuASxn866M8TgduaLsqxnEKKUNlLTtS79KPHdyTyW ZQbRREiZQhYhDbs8pdlN0y6q6aaez1gcNjKcpAog= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sylwester Nawrocki , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.0 13/79] ASoC: samsung: odroid: Fix clock configuration for 44100 sample rate Date: Fri, 26 Apr 2019 21:37:32 -0400 Message-Id: <20190427013838.6596-13-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190427013838.6596-1-sashal@kernel.org> References: <20190427013838.6596-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sylwester Nawrocki [ 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 e7b371b07230..45c6d7396785 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.19.1