From patchwork Thu Nov 27 15:02:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5396751 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 F2F7F9F39B for ; Thu, 27 Nov 2014 15:03:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39D4B201F5 for ; Thu, 27 Nov 2014 15:03:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3F003201C7 for ; Thu, 27 Nov 2014 15:03:10 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6A754266525; Thu, 27 Nov 2014 16:03:09 +0100 (CET) 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, 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 0C97D26621A; Thu, 27 Nov 2014 16:02:38 +0100 (CET) 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 21F04266199; Thu, 27 Nov 2014 16:02:35 +0100 (CET) Received: from mail-qg0-f54.google.com (mail-qg0-f54.google.com [209.85.192.54]) by alsa0.perex.cz (Postfix) with ESMTP id EF1002661A7 for ; Thu, 27 Nov 2014 16:02:26 +0100 (CET) Received: by mail-qg0-f54.google.com with SMTP id q107so3616499qgd.13 for ; Thu, 27 Nov 2014 07:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cIdPCqWbTj+ePoSAn5NgiF+TIHa2J/xxxUxChGfGqAA=; b=E7y7oG2r3Bw/rXhqlOxqfZP9OgdmS9zaLu54tbbAsmETGoLJBFwClHHxVTk68KREjh JfqI5AK9KreHC47KwmwAh2z07j1R9zS3wCuBSCXacF6Orz2zdHSWkTOx2/TyFeMeRQ2j vpdOdd8dZlINn+bM5KCpALHGCwb692ctIpl+Ofhwdxqb9BTEOarZ295UJBPw9cwjfga4 syCnoY6GUDIthQstAzlPwiY7FVEZSK43oDQLMqXzy7sptXFMdRByZgyGdP/rEYPWxMou 1IX8PclhZ868Ypj55bk7p0a3FOBWQC7J7c3o/BbM1a+7qc1Te/Vt1ItH9xRqXfaHvDu2 zHhg== X-Received: by 10.224.45.65 with SMTP id d1mr55221220qaf.43.1417100546289; Thu, 27 Nov 2014 07:02:26 -0800 (PST) Received: from localhost.localdomain ([201.82.52.106]) by mx.google.com with ESMTPSA id b17sm6728466qah.35.2014.11.27.07.02.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Nov 2014 07:02:25 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Date: Thu, 27 Nov 2014 13:02:00 -0200 Message-Id: <1417100521-8483-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417100521-8483-1-git-send-email-festevam@gmail.com> References: <1417100521-8483-1-git-send-email-festevam@gmail.com> Cc: Fabio Estevam , alsa-devel@alsa-project.org, shawn.guo@linaro.org, craig.mcqueen@beamcommunications.com Subject: [alsa-devel] [PATCH 2/3] ASoC: sgtl5000: Remove MCLK restriction 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 According to the sgtl5000 datasheet the MCLK frequency range restriction of 8 to 27 MHz only applies when the PLL is used - synchronous SYS_MCLK input mode. When running the codec as slave, the master should generate MCLK in the range of 256*fs, 384*fs or 512*fs, which is called asynchronous SYS_MCLK input mode. In asynchronous SYS_MCLK we cannot have the 8 to 27 MHz check because if we want to play a 8KHz sample rate track, with a MCLK of 8k * 512 = 4.096MHz the current check would return -EINVAL, which is not correct. Remove the 8 to 27MHz frequency check, since this only applies to the synchronous SYS_MCLK input case. Signed-off-by: Fabio Estevam --- sound/soc/codecs/sgtl5000.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 600c072..8dea6b3 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1434,7 +1434,6 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, { struct sgtl5000_priv *sgtl5000; int ret, reg, rev; - unsigned int mclk; struct device_node *np = client->dev.of_node; u32 value; @@ -1459,14 +1458,6 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, return ret; } - /* SGTL5000 SYS_MCLK should be between 8 and 27 MHz */ - mclk = clk_get_rate(sgtl5000->mclk); - if (mclk < 8000000 || mclk > 27000000) { - dev_err(&client->dev, "Invalid SYS_CLK frequency: %u.%03uMHz\n", - mclk / 1000000, mclk / 1000 % 1000); - return -EINVAL; - } - ret = clk_prepare_enable(sgtl5000->mclk); if (ret) return ret;