From patchwork Wed Apr 30 10:54:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 4092611 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A404FBFF02 for ; Wed, 30 Apr 2014 10:54:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B07DB20268 for ; Wed, 30 Apr 2014 10:54:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7E53720270 for ; Wed, 30 Apr 2014 10:54:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 83B30265249; Wed, 30 Apr 2014 12:54:32 +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.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 95680265057; Wed, 30 Apr 2014 12:53:13 +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 ED90826072A; Wed, 30 Apr 2014 12:53:11 +0200 (CEST) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0212.outbound.protection.outlook.com [207.46.163.212]) by alsa0.perex.cz (Postfix) with ESMTP id C12E4261A0D for ; Wed, 30 Apr 2014 12:52:38 +0200 (CEST) Received: from BY2PR03CA064.namprd03.prod.outlook.com (10.141.249.37) by BY2PR03MB025.namprd03.prod.outlook.com (10.255.240.39) with Microsoft SMTP Server (TLS) id 15.0.934.12; Wed, 30 Apr 2014 10:52:29 +0000 Received: from BY2FFO11FD002.protection.gbl (2a01:111:f400:7c0c::103) by BY2PR03CA064.outlook.office365.com (2a01:111:e400:2c5d::37) with Microsoft SMTP Server (TLS) id 15.0.929.12 via Frontend Transport; Wed, 30 Apr 2014 10:52:30 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.1) by BY2FFO11FD002.mail.protection.outlook.com (10.1.14.124) with Microsoft SMTP Server (TLS) id 15.0.929.8 via Frontend Transport; Wed, 30 Apr 2014 10:52:30 +0000 Received: from rio.ap.freescale.net (rio.ap.freescale.net [10.192.242.9]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s3UAqHbq006317; Wed, 30 Apr 2014 03:52:27 -0700 From: Nicolin Chen To: Date: Wed, 30 Apr 2014 18:54:08 +0800 Message-ID: <862e22353c7cde177639b40f8a967f0bf9d94bb5.1398853588.git.Guangyu.Chen@freescale.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.1; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009001)(6009001)(428001)(199002)(189002)(79102001)(77982001)(20776003)(47776003)(89996001)(62966002)(85852003)(80022001)(50466002)(83072002)(74502001)(74662001)(77156001)(87286001)(6806004)(76482001)(92566001)(92726001)(88136002)(19580405001)(77096999)(31966008)(4396001)(36756003)(46102001)(80976001)(19580395003)(83322001)(99396002)(50986999)(76176999)(50226001)(86362001)(48376002)(81542001)(93916002)(87936001)(101416001)(44976005)(81342001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB025; H:tx30smr01.am.freescale.net; FPR:; MLV:sfv; PTR:gate-tx3.freescale.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Forefront-PRVS: 0197AFBD92 Received-SPF: None (: freescale.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 192.88.168.1) smtp.mailfrom=guangyu.chen@freescale.com; X-OriginatorOrg: freescale.com Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 4/5] ASoC: fsl_spdif: Print actual sample rate for debug 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP People would simply know what the driver gets the best for the current sample rate playback. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl_spdif.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 1abfb00..074b355 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -75,6 +75,7 @@ struct fsl_spdif_priv { struct platform_device *pdev; struct regmap *regmap; bool dpll_locked; + u16 txrate[SPDIF_TXRATE_MAX]; u8 txclk_df[SPDIF_TXRATE_MAX]; u8 sysclk_df[SPDIF_TXRATE_MAX]; u8 txclk_src[SPDIF_TXRATE_MAX]; @@ -418,7 +419,8 @@ clk_set_bypass: regmap_update_bits(regmap, REG_SPDIF_STC, STC_SYSCLK_DF_MASK, STC_SYSCLK_DF(sysclk_df)); - dev_dbg(&pdev->dev, "set sample rate to %d\n", sample_rate); + dev_dbg(&pdev->dev, "set sample rate to %dHz for %dHz playback\n", + spdif_priv->txrate[rate], sample_rate); return 0; } @@ -1049,6 +1051,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, savesub = 0; spdif_priv->txclk_df[index] = txclk_df; spdif_priv->sysclk_df[index] = sysclk_df; + spdif_priv->txrate[index] = arate; goto out; } else if (arate / rate[index] == 1) { /* A little bigger than expect */ @@ -1059,6 +1062,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, savesub = sub; spdif_priv->txclk_df[index] = txclk_df; spdif_priv->sysclk_df[index] = sysclk_df; + spdif_priv->txrate[index] = arate; } else if (rate[index] / arate == 1) { /* A little smaller than expect */ sub = (rate[index] - arate) * 100000; @@ -1068,6 +1072,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, savesub = sub; spdif_priv->txclk_df[index] = txclk_df; spdif_priv->sysclk_df[index] = sysclk_df; + spdif_priv->txrate[index] = arate; } } } @@ -1118,6 +1123,8 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, if (spdif_priv->txclk[index] == spdif_priv->sysclk) dev_dbg(&pdev->dev, "use sysclk df %d for %dHz sample rate\n", spdif_priv->sysclk_df[index], rate[index]); + dev_dbg(&pdev->dev, "the best rate for %dHz sample rate is %dHz\n", + rate[index], spdif_priv->txrate[index]); return 0; }