Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2061351yba; Fri, 19 Apr 2019 11:20:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHnYAtLz2y6w7tyelgPCRDbIico1Kco0ewNa+gM+ZQUMewXQy9NHWxi1yk8pkWCYiyQGeT X-Received: by 2002:a17:902:8a4:: with SMTP id 33mr5279484pll.7.1555698019926; Fri, 19 Apr 2019 11:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555698019; cv=none; d=google.com; s=arc-20160816; b=BBBf9SHKfSZG9GfaAmUK7iD5tr4WmZx7/yxmNlQ+pQQaBgr/fEunniU+x5VmuG1d18 3Iq8iJk9D1NeLuV/VufZsLxdLcUxHAFNfNWpgV9XL5xX7fZAzPWl6DsCFDuP37uj5Axj /m5KgeEy4rh6ZmtG3guv0XUMPLp86HbOm1Y7M84HxGh16G/TrgRqJtCAZjxqCPL8jUKM UierpsxXqQOSsP35O59xfrIfuqVBktGMDIvk1D2Q2cCAoraOn16xxDlmaOuW2/eTQdnc k7xNRB0kPhOxZMzAEMD+ZuPxAoIXHmZeO+KhNVG0rEwUDvv4i/tfi3Owjya7heZES9j7 VDoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8DHK4rYDwWPVNuuRQozpzQhPs53i6eTIw/NWHTPBpUw=; b=ls3iGIvAOHo/C6/kkATg2ifK/WAsRPTKTSQ8sSeRcjKBEkR6lvF2xj4iy+/ZoV8jI/ l/6y6VdGJ0ozJHfzM0KE98UNP6fPctFFr0N+oHBzzsI6AR1GAJNSxdnBJ+IJ7JUzs6jp IhzxrLBtFiatcNRh1aIdbOABWgkWNzQUarRZbV6s2sFunlMA5A45/Ie/jNXapJGhMS8M jgeevxKD0tBEQyLISyNF2fqXjJJMm7MzHReo7NCQwtfXAeALbPjqTJjyRCIiuIfZzTJn zCLw768c11cItKKTTqCvpupU1NkVlsIAJSImzfMHWaZt7mxA+YqqDi1PigLbdcqzVKN2 1Jdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SwCw9SHk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si5398195pgj.427.2019.04.19.11.19.38; Fri, 19 Apr 2019 11:20:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SwCw9SHk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727371AbfDSSRl (ORCPT + 99 others); Fri, 19 Apr 2019 14:17:41 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33233 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727353AbfDSSRk (ORCPT ); Fri, 19 Apr 2019 14:17:40 -0400 Received: by mail-pf1-f193.google.com with SMTP id h5so2886896pfo.0 for ; Fri, 19 Apr 2019 11:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8DHK4rYDwWPVNuuRQozpzQhPs53i6eTIw/NWHTPBpUw=; b=SwCw9SHkBEdf0FNwY3ddHfVt/5MXgvQz8yLP6w+50L7rBCJTPluD7bwwgk4+1Wl1Kz 5IAjZaOb6rtGAjK9pbFCcTXW3IrwKt+9noZyd+6mQ/5kGe/c9dUp3EwlqSwS1ywQMsSD QZY6XymID6Nl8Pq01a9OmT64PczfAR1cF6Xn/fM/sdubY9RfrCT6hqElx/m8RJDQkoYW /iRoT07AnZ1mvW6PSt0sgl7Ab56eLwwj3lvm+lubyo65xPl+UEI1dASI32AsYQAfMKIN xYLabW3+MuWY3sQHXKl+knWnBgRmj59ZaM7HhzJI6bplqm8AYTlO6tpEm0GImFXLTvKS c3Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8DHK4rYDwWPVNuuRQozpzQhPs53i6eTIw/NWHTPBpUw=; b=bzFPy0+fr6BDbPb0VFRJQZxIGB/VgmrU+yb3iOijG8V89OhNVplarHeeGNuTWnlCaC 8mMt/gSFdY5K/s900orJgfFO56DIbtoMf5XSDk7Z7lL0Tym9Nm6uT0AOK4c6Ek4QkW44 uS3nCAbgltJOkrLLIVBZVN2xODPotDPktJx0BRcuEpU1b3DD2yZR5xDhZzUiP45CgJNd moI2JnKOyhFWwccbd72fSn2wH5FlwvGysUqZ8WJa1sp5mFJ0btYte6CU3+UArBTZSNb/ csnOBfnVDdb4hE4PnSeuv0RVgl9RLCdI+8zJ/jUaDFsvZH26xEIhJDsyoge0RPkFku3R ubHg== X-Gm-Message-State: APjAAAVSsPqPxvEbqhdJ5obj8cFWg4cJrUHG8jk2YYffn2U6HGvA74b2 tLx+ZU2dNQqjVgA5a1wkLnQ= X-Received: by 2002:a63:d84a:: with SMTP id k10mr5084606pgj.441.1555697409412; Fri, 19 Apr 2019 11:10:09 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id i129sm9382006pfc.163.2019.04.19.11.10.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 11:10:09 -0700 (PDT) Date: Fri, 19 Apr 2019 11:10:03 -0700 From: Nicolin Chen To: "S.j. Wang" Cc: "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "broonie@kernel.org" , "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V4 1/3] ASoC: fsl_asrc: Fix the issue about unsupported rate Message-ID: <20190419181003.GA1136@Asurada-Nvidia.nvidia.com> References: <06c3e420b9fabfbec67becc2f9de009ce79a1d4b.1555669068.git.shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06c3e420b9fabfbec67becc2f9de009ce79a1d4b.1555669068.git.shengjiu.wang@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 19, 2019 at 10:23:50AM +0000, S.j. Wang wrote: > When the output sample rate is [8kHz, 30kHz], the limitation > of the supported ratio range is (1/24, 8). In the driver > we use (8kHz, 30kHz) instead of [8kHz, 30kHz]. > So this patch is to fix this issue and the potential rounding > issue with divider. > > Fixes: fff6e03c7b65 ("ASoC: fsl_asrc: add support for 8-30kHz > output sample rate") > Cc: > Signed-off-by: Shengjiu Wang > --- > sound/soc/fsl/fsl_asrc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c > index 0b937924d2e4..5b8adc7fb117 100644 > --- a/sound/soc/fsl/fsl_asrc.c > +++ b/sound/soc/fsl/fsl_asrc.c > @@ -282,10 +282,10 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair) > return -EINVAL; > } > > - if ((outrate > 8000 && outrate < 30000) && > - (outrate/inrate > 24 || inrate/outrate > 8)) { > - pair_err("exceed supported ratio range [1/24, 8] for \ > - inrate/outrate: %d/%d\n", inrate, outrate); > + if ((outrate >= 8000 && outrate <= 30000) && > + (outrate > 24 * inrate || inrate > 8 * outrate)) { > + pair_err("exceed supported ratio range (1/24, 8) for inrate/outrate: %d/%d\n", Using one of the conditions: if (inrate > 8 * outrate) pair_err(); This means: if (inrate <= 8 * outrate) /* Everything is fine */ So the supported ratio range is still [1/24, 8] right? Thanks