Received: by 2002:a17:90a:c8b:0:0:0:0 with SMTP id v11csp2296421pja; Fri, 19 Apr 2019 11:29:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfhEqc7kGEAp0Z2bJ+/rbd+AyBQCbaWsL4iYKE/zFYjcZ4djJW9g0XvV5AxeqcEmZBrM6v X-Received: by 2002:a17:902:758e:: with SMTP id j14mr5384042pll.286.1555698565361; Fri, 19 Apr 2019 11:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555698565; cv=none; d=google.com; s=arc-20160816; b=VO/lDQKXRVMX7Xw3/afUBflDu9s034kbjElbea/HuV11jHoX+VnnxOxeoY2An6FZmZ gNrt567YwvT6Wg0ynmHSx4O34YVsSI7mOOMVLOf7DiLjQpUSFFjkeILwJMhDd1GbaMjr MGqQ2K0o21cAzpgGAJkc5uvaiB2vS0vrep0uh53lVENrNbr3tNjv7/cws05DXuWHGJSF +sXUd7EIxMJeuiFUndZskkhRM7llbpecwj9YLU0Kdf0oCEAwwa+cffCXd+PThPeZkhJg nRV+mJfJWlyNiMVy09tijygNy3ki+ubyzQZtgM+KlwuPG/FD5JzM9gmJ6fOMfgJlcgiF 265A== 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=ONT5+2CVkj6hhrYr8uWDTX1Rkzzw8yLeZIpjJqMpjY0=; b=tqmOUDtIr/JFI141kJwSwmxkT1GNC178wJiaI0Zkk1rO39J/0xCk7PaUGlk7n4YWo3 N6cT/mT2UrZefwcPluQZuy8bYjrQGI0ruVasRGJ9JEk7TgIoQZRgyTnDhBW9Un0Ag4l9 yHWQ8or3gP1WQrTPa3fUjJEMeD21WgmbEFiO7oDhZrlDAUXHsf9QHdhotiiN0h2/+6V6 +LcVrJaOycOb+lFGbXB8AOB8TzBtcmhRo6lH7eOQTdqllPIMyDH4l8nf330ntqYwD6rX bj1W5LX/6XtX9gZfsBxIyyscOqFlZ2P8C8G02+IoiRagCRRY75T7S85N0IudV3nmXwaf /HXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PvP10dfs; 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 d6si5964050pfg.66.2019.04.19.11.29.10; Fri, 19 Apr 2019 11:29:25 -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=PvP10dfs; 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 S1727390AbfDSS2R (ORCPT + 99 others); Fri, 19 Apr 2019 14:28:17 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36684 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbfDSS2R (ORCPT ); Fri, 19 Apr 2019 14:28:17 -0400 Received: by mail-pg1-f196.google.com with SMTP id 85so2997036pgc.3 for ; Fri, 19 Apr 2019 11:28:16 -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=ONT5+2CVkj6hhrYr8uWDTX1Rkzzw8yLeZIpjJqMpjY0=; b=PvP10dfsssoEwVuVGPSsDItBuLoNejtOxSAekgSyrDu81+aFomxA7AAm5XNUVHWMHb CH3AuYdpeLXnxnHx8pKlCwf7BglN8b7FFuuTSMoRLxdRVMiShgysz9XmHN/3ufYD6j8f Gb15kSDSpN5e03RQZd36eUWqf2fHKL79qyZm5oslfSAilc3K21Djqht9HBBe2ZgNDbN/ AGo4bY9XFVIS1xjDDto7O8kMPt6zEPVl5ToqrQanfQIPApz+DGWqqBh3W719QhVjtew6 9qE0xHdyKlp1n9wodh05AanIgIFEZ9Z47SM2HbChPlVloODQVNgrneYvMhI3nqvG9TFX JbUQ== 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=ONT5+2CVkj6hhrYr8uWDTX1Rkzzw8yLeZIpjJqMpjY0=; b=AzfPxrUUF/otThH+KoPP+BqhQ6Kz0XSj6k8/o1gmMjdlsll4UihtIHZCg17xwnWR99 2I7NxibvZ4hQlRjewxvg23/043RF6ag3Qa9+Vj65ZA2GUS+/UX9v+W21QQ8ZTMhsBAg1 Dp+YQctL5xksE0wOJLWsMRYrGPQce+tUOWjS1YailqxDZVbAfYDMdNrbGpnakl+vC4LX MzIU9Y2vRnJX/ac/BtyVumN/A/NTu+3jnVq6uacfqmi9qt7w6cNxHmkqDzHKS9G03kN7 1H3QwEDg5wd1ISntUMDI0ISR+Rz8HSmUvEegsstVc19oBC5S+8KELtgTCwldp9k+ZVLs KNJA== X-Gm-Message-State: APjAAAUAIdwFgMXGG+p+SWD9OYw51zYKlWlGnNkAxr5iQXouM/UZU1e1 BkeO6Aq6afQdnEq/dXGxGe8= X-Received: by 2002:a63:5c43:: with SMTP id n3mr5188956pgm.163.1555698496395; Fri, 19 Apr 2019 11:28:16 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id f2sm8558920pgc.30.2019.04.19.11.28.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 11:28:15 -0700 (PDT) Date: Fri, 19 Apr 2019 11:28:13 -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 3/3] ASoC: fsl_asrc: Unify the supported input and output rate Message-ID: <20190419182812.GC1136@Asurada-Nvidia.nvidia.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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:56AM +0000, S.j. Wang wrote: > Unify the supported input and output rate, add the > 12kHz/24kHz/128kHz to the support list > > Signed-off-by: Shengjiu Wang > --- > sound/soc/fsl/fsl_asrc.c | 32 +++++++++++++++++++------------- > 1 file changed, 19 insertions(+), 13 deletions(-) > > diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c > index 2c4bbc3499db..0d06e738264a 100644 > --- a/sound/soc/fsl/fsl_asrc.c > +++ b/sound/soc/fsl/fsl_asrc.c > @@ -27,13 +27,14 @@ > dev_dbg(&asrc_priv->pdev->dev, "Pair %c: " fmt, 'A' + index, ##__VA_ARGS__) > > /* Corresponding to process_option */ > -static int supported_input_rate[] = { > - 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, > - 96000, 176400, 192000, > +static unsigned int supported_asrc_rate[] = { > + 5512, 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, > + 64000, 88200, 96000, 128000, 176400, 192000, > }; > > -static int supported_asrc_rate[] = { > - 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000, > +static struct snd_pcm_hw_constraint_list fsl_asrc_rate_constraints = { > + .count = ARRAY_SIZE(supported_asrc_rate), > + .list = supported_asrc_rate, > }; > > /** > @@ -293,11 +294,11 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair) > ideal = config->inclk == INCLK_NONE; > > /* Validate input and output sample rates */ > - for (in = 0; in < ARRAY_SIZE(supported_input_rate); in++) > - if (inrate == supported_input_rate[in]) > + for (in = 0; in < ARRAY_SIZE(supported_asrc_rate); in++) > + if (inrate == supported_asrc_rate[in]) > break; Not sure if we still need it upon having hw_constraint. Maybe m2m needs it?