From patchwork Thu Oct 2 19:16:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5020321 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 951569F327 for ; Thu, 2 Oct 2014 19:17:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C50C4201FE for ; Thu, 2 Oct 2014 19:17:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8AD07201F2 for ; Thu, 2 Oct 2014 19:17:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 08177261A40; Thu, 2 Oct 2014 21:17:46 +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 B5C3E2617B5; Thu, 2 Oct 2014 21:17:35 +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 181682617DD; Thu, 2 Oct 2014 21:17:34 +0200 (CEST) Received: from mail-yk0-f178.google.com (mail-yk0-f178.google.com [209.85.160.178]) by alsa0.perex.cz (Postfix) with ESMTP id EECBE261735 for ; Thu, 2 Oct 2014 21:17:26 +0200 (CEST) Received: by mail-yk0-f178.google.com with SMTP id 9so1486847ykp.37 for ; Thu, 02 Oct 2014 12:17:25 -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=2VDmXmBqShVGnh4sQXNhl60H5oeHtBseu8aXQFpgzZc=; b=SYDa4/S/mRQsw12n1hpsOgCKnfpFWNGE6Iv5KdAlHteWxSQXrxpSFC2rKWAUVsSP26 c6/Lq0Yb6BJ7bHDOHPQiibnKmNhP/7IHq/W1wzFtA2cMTmPd92FretQiHSnJESVN0Soy DKMK+JOatJEReNT73StfP6AuPtPI5/kl+9ONwIB3rcPmo0J70PIan2v4E1oDWZsdNljA uyrFFKvH7o/r0a1gTE/tnGxyIm51YffTyL07DnF7x8W1QUT9xWysYu8pZ8khnbudTkre 8o9PsHCbEBush2H14l6UkQI71cMxgkyntoqhTvm0/PE5cVHKBOqOlJGQc0GDNPJn6y6J Qbhg== X-Received: by 10.236.231.178 with SMTP id l48mr989760yhq.143.1412277445180; Thu, 02 Oct 2014 12:17:25 -0700 (PDT) Received: from localhost.localdomain ([201.82.52.106]) by mx.google.com with ESMTPSA id n36sm2046146yhp.49.2014.10.02.12.17.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Oct 2014 12:17:24 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Thu, 2 Oct 2014 16:16:50 -0300 Message-Id: <1412277410-25888-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: Improve the error message on slave mode setting 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 From: Fabio Estevam For sgtl5000 to operate in slave mode it can only work in "Synchronous SYS_MCLK input" mode. In this mode only the following rates can be supported: 256*Fs, 384*Fs, 512*Fs. Improve the error message to give a better indication as to why the clocking failed for slave mode: [ 12.515399] sgtl5000 1-000a: PLL not supported in slave mode [ 12.524124] sgtl5000 1-000a: 233 ratio is not supported. SYS_MCLK needs to be 256, 384 or 512 * fs [ 12.535938] sgtl5000 1-000a: ASoC: can't set sgtl5000 hw params: -22 Signed-off-by: Fabio Estevam --- sound/soc/codecs/sgtl5000.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index a604a22..c1936bc 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -626,6 +626,9 @@ static int sgtl5000_set_clock(struct snd_soc_codec *codec, int frame_rate) } else { dev_err(codec->dev, "PLL not supported in slave mode\n"); + dev_err(codec->dev, "%d ratio is not supported. " + "SYS_MCLK needs to be 256, 384 or 512 * fs\n", + sgtl5000->sysclk / sys_fs); return -EINVAL; } }