From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolin Chen Subject: Re: [EXT] Re: [PATCH] ASoC: fsl_asrc: replace the process_option table with function Date: Wed, 10 Apr 2019 02:51:30 -0700 Message-ID: <20190410095129.GA3468@Asurada> References: <1554866131-12088-1-git-send-email-shengjiu.wang@nxp.com> <20190410042638.GB3032@Asurada> <20190410080052.GA5180@Asurada> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2D838F8068A for ; Wed, 10 Apr 2019 11:51:38 +0200 (CEST) Received: by mail-pg1-x541.google.com with SMTP id k19so1256938pgh.0 for ; Wed, 10 Apr 2019 02:51:38 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: "S.j. Wang" Cc: "alsa-devel@alsa-project.org" , "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "broonie@kernel.org" , "linuxppc-dev@lists.ozlabs.org" List-Id: alsa-devel@alsa-project.org On Wed, Apr 10, 2019 at 08:26:59AM +0000, S.j. Wang wrote: > > Is it possible to update the table? It'd be way quicker to use lookup table > > than real-time calculation all the time. I believe you can simply calculate all > > the values out for 12KHz and 24KHz since you have the function. If there are > > certain combinations of these two not being supported, then we could mark > > it with a special value and add an if-check to error out. > > > > Yes, but I think the function should be more flexible, if someday we need to support > Other sample rate, only need to update the list. Given the fact that the owner of the function cannot give more comments, I feel the function wouldn't be very maintainable as none of us understands it well. On the other hand, you'll need to update the supported I/O rate lists anyway, so why not just update the table as well? The supported sample rates from ALSA are limited too. Overall, I think that continue using a lookup table wins.