From patchwork Sun May 24 08:12:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 6471351 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7BF1D9F1CC for ; Sun, 24 May 2015 08:13:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E58C2052A for ; Sun, 24 May 2015 08:13:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4FF9F204E7 for ; Sun, 24 May 2015 08:13:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 96C7E260670; Sun, 24 May 2015 10:13:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 08E3F26061E; Sun, 24 May 2015 10:13:02 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8AE83260626; Sun, 24 May 2015 10:13:00 +0200 (CEST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by alsa0.perex.cz (Postfix) with ESMTP id 11F9E26061B for ; Sun, 24 May 2015 10:12:52 +0200 (CEST) Received: by pdea3 with SMTP id a3so49430733pde.2 for ; Sun, 24 May 2015 01:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=a7BQxvZNxw2xTaRth719ilE+QMRkbtHcIcAP2Fw6MLc=; b=etlzOQgygcw6J1O6ca+hHldQi1sGPAskPyv3NlmcvNwG3noSY1J4YNv+KYeiOV5vLg 8zxo1hfFsNgCWEG0uL2nO1xIAzw3bY8s+nQlY+ss47e9GXTWPpFQVIbwUrLKw8uCz/l/ xnTvQXD6pFxPv4LYzh5urjh17hPkjnowc1yfSzSFfQK1JarT/0zKDtnNyYIeJgTs4ytS 9yLSDb9iw92MVdOhEvTO89Xx38QbF8uxeB4VolI/Ry1wkSd3L2GJDATP1ZaEWl00I8ZN ilc0wlExlyS/Ozr7HDcKvsjNOXQKb+b5qhId6v/zj6FAwnKXvFJIeEtGAm4DS9kRfO9I fr5g== X-Received: by 10.70.56.4 with SMTP id w4mr30144206pdp.148.1432455170630; Sun, 24 May 2015 01:12:50 -0700 (PDT) Received: from Asurada-CZ80.hsd1.ca.comcast.net (c-73-189-64-245.hsd1.ca.comcast.net. [73.189.64.245]) by mx.google.com with ESMTPSA id kr9sm6708455pab.30.2015.05.24.01.12.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 May 2015 01:12:50 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Sun, 24 May 2015 01:12:41 -0700 Message-Id: <1432455161-4924-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: fabio.estevam@freescale.com, alsa-devel@alsa-project.org, zidan.wang@freescale.com, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH] ASoC: fsl_spdif: Don't try to round-up for clock divisor calculation X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP As commit 6c8ca30eec7b ("ASoC: fsl_ssi: Don't try to round-up for PM divisor calculation") mentioned that there's no more need to use a round up work around to get a better divisor since the clk-divider driver has been refined a lot. So this patch applies the same modification to fsl_spdif driver. Signed-off-by: Nicolin Chen Cc: Fabio Estevam Cc: Zidan Wang --- Fabio and Zidan, Theoretically, it should have the same problem as fsl_ssi driver had. But I don't have an S/PDIF test environment. So I need your helps to confirm it. Thank you. sound/soc/fsl/fsl_spdif.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 91eb3ae..8e93221 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -417,11 +417,9 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, if (clk != STC_TXCLK_SPDIF_ROOT) goto clk_set_bypass; - /* - * The S/PDIF block needs a clock of 64 * fs * txclk_df. - * So request 64 * fs * (txclk_df + 1) to get rounded. - */ - ret = clk_set_rate(spdif_priv->txclk[rate], 64 * sample_rate * (txclk_df + 1)); + /* The S/PDIF block needs a clock of 64 * fs * txclk_df */ + ret = clk_set_rate(spdif_priv->txclk[rate], + 64 * sample_rate * txclk_df); if (ret) { dev_err(&pdev->dev, "failed to set tx clock rate\n"); return ret; @@ -1060,7 +1058,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, for (sysclk_df = sysclk_dfmin; sysclk_df <= sysclk_dfmax; sysclk_df++) { for (txclk_df = 1; txclk_df <= 128; txclk_df++) { - rate_ideal = rate[index] * (txclk_df + 1) * 64; + rate_ideal = rate[index] * txclk_df * 64; if (round) rate_actual = clk_round_rate(clk, rate_ideal); else