lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 1/2] ASoC: fsl_asrc: replace the process_option table with function
Hi Shengjiu,

This looks better. Just a couple of more small comments inline.

On Wed, Apr 17, 2019 at 09:06:18AM +0000, S.j. Wang wrote:

> +static int fsl_asrc_sel_proc(int inrate, int outrate, int *pre_proc,
> + int *post_proc)

Just a nit: it looks better by grouping them two-two.

static int fsl_asrc_sel_proc(int inrate, int outrate,
int *pre_proc, int *post_proc)

> + /* Condition for selection of post-processing */
> + post_proc_cond2 = (inrate * 15 > outrate * 16 && outrate < 56000) ||
> + (inrate > 56000 && outrate < 56000);

Could align the indentation:
post_proc_cond2 = (inrate * 15 > outrate * 16 && outrate < 56000) ||
(inrate > 56000 && outrate < 56000);

Here:
> + /* Does not support cases: Tsout > 8.125 * Tsin */
> + if (inrate * 8 > 65 * outrate)
> + return -EINVAL;
And here:
> + ret = fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc);
> + if (ret) {
> + pair_err("No supported pre-processing options\n");
> + return ret;
> + }

Instead of a general message, I was thinking of a more specific
one by telling users that the ratio between the two rates isn't
supported -- something similar to what I suggested previously:

pair_err("Does not support %d (input) > 8.125 * %d (output)\n",
outrate, inrate);

Thanks
Nicolin

\
 
 \ /
  Last update: 2019-04-17 20:53    [W:0.038 / U:7.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site