From patchwork Fri Nov 14 00:59:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5301971 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 35DA2C11AC for ; Fri, 14 Nov 2014 01:00:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E3FE201C7 for ; Fri, 14 Nov 2014 01:00:03 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BF335201E4 for ; Fri, 14 Nov 2014 01:00:01 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 29D012664AF; Fri, 14 Nov 2014 01:59:55 +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, RCVD_IN_DNSWL_NONE, 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 E1298260512; Fri, 14 Nov 2014 01:59:44 +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 5FF3A2604E9; Fri, 14 Nov 2014 01:59:43 +0100 (CET) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by alsa0.perex.cz (Postfix) with ESMTP id 322B32604E9 for ; Fri, 14 Nov 2014 01:59:35 +0100 (CET) Received: by mail-la0-f41.google.com with SMTP id gf13so2321677lab.0 for ; Thu, 13 Nov 2014 16:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=q2L6FJRN4vG7VYl+DTQYdaqKEZ+jL7fh+c+oWlkPvws=; b=nuIoIOB+YBK6iYLh+NTeVPaKFJp04Lrc6ZXGkJhxLMeFqFziZuBD3hEnOkGpf4/u+3 p1676RU3mg7kBh2d9l5XS1wQbEuopf9mBk+TWm+Wyxj6ouxPsa4B/le0Yqi0vWpY0VMz c/9NUeTdKC4yRha/oE4BtT/p0QZzB9VIwycK0feeaY9tCWNspnKJPyGozsbpnrNoFHCz zZlsQGaHIzgLyUEj13DaQ3TOEhrHQEThJw3DH+BcPMn9/zKfObpSGAPMJi7nM7g0H7UH 0CwYGAOcmqMSHcs5X1CgEaHsi5YDlgUkoxS9wsmzGdFuW2vTKwu212uQI3pvSPBMSbyo pzqw== MIME-Version: 1.0 X-Received: by 10.152.20.199 with SMTP id p7mr5341626lae.49.1415926774567; Thu, 13 Nov 2014 16:59:34 -0800 (PST) Received: by 10.152.7.39 with HTTP; Thu, 13 Nov 2014 16:59:34 -0800 (PST) In-Reply-To: References: <546450E5.9090203@beamcommunications.com> <54653283.5070404@beamcommunications.com> Date: Thu, 13 Nov 2014 22:59:34 -0200 Message-ID: From: Fabio Estevam To: Craig McQueen Cc: Nicolin Chen , "alsa-devel@alsa-project.org" , Mark Brown Subject: Re: [alsa-devel] Low sample rates for SGTL5000 on i.MX28 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 On Thu, Nov 13, 2014 at 10:29 PM, Fabio Estevam wrote: > Ok, so the 'aplay stereo_8k.wav' is converting the rate to 44.1kHz, so > that's why it does not fail. From the sgtl5000 datasheet, it looks like the MCLK range of 8 to 27MHz limitation does not apply when sgtl5000 runs in slave mode. A quick hack that allows 'aplay -D hw:0,0 stereo_8k.wav' to play: diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 6bb77d7..4a329b0 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -623,13 +623,6 @@ static int sgtl5000_set_clock(struct snd_soc_codec *codec, if (sgtl5000->master) { clk_ctl |= SGTL5000_MCLK_FREQ_PLL << diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 6bb77d7..4a329b0 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -623,13 +623,6 @@ static int sgtl5000_set_clock(struct snd_soc_codec *codec, if (sgtl5000->master) { clk_ctl |= SGTL5000_MCLK_FREQ_PLL << SGTL5000_MCLK_FREQ_SHIFT; - } 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; } } @@ -1417,7 +1410,6 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, { struct sgtl5000_priv *sgtl5000; int ret, reg, rev; - unsigned int mclk; sgtl5000 = devm_kzalloc(&client->dev, sizeof(struct sgtl5000_priv), GFP_KERNEL); @@ -1441,14 +1433,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; diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c index 61822cc..3bba6cf 100644 --- a/sound/soc/mxs/mxs-sgtl5000.c +++ b/sound/soc/mxs/mxs-sgtl5000.c @@ -49,13 +49,6 @@ static int mxs_sgtl5000_hw_params(struct snd_pcm_substream *s break; } - /* Sgtl5000 sysclk should be >= 8MHz and <= 27M */ - if (mclk < 8000000 || mclk > 27000000) { - dev_err(codec_dai->dev, "Invalid mclk frequency: %u.%03uMHz\n", - mclk / 1000000, mclk / 1000 % 1000); - return -EINVAL; - } - /* Set SGTL5000's SYSCLK (provided by SAIF MCLK) */ ret = snd_soc_dai_set_sysclk(codec_dai, SGTL5000_SYSCLK, mclk, 0); if (ret) {