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: 475948 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1238F1402B7 for ; Sun, 24 May 2015 18:14:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=etlzOQgy; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id ABC3E1A0F67 for ; Sun, 24 May 2015 18:14:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=etlzOQgy; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id CA9B81A0C90 for ; Sun, 24 May 2015 18:12:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=etlzOQgy; dkim-atps=neutral Received: by pdbki1 with SMTP id ki1so7793405pdb.1 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 Subject: [PATCH] ASoC: fsl_spdif: Don't try to round-up for clock divisor calculation 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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