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

>
>
> On Fri, Apr 19, 2019 at 10:23:53AM +0000, S.j. Wang wrote:
>
> > @@ -289,6 +318,12 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair
> *pair)
> > return -EINVAL;
> > }
> >
> > + ret = fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc);
>
> Since the function always return 0, I am thinking of treating this function as
> a lookup function, and then moving this call right before the register
> settings -- as we have already made sure that both inrate and outrate are
> supported.

Ok.

>
> > + if (ret) {
> > + pair_err("No supported pre-processing options\n");
> > + return ret;
> > + }
>
> And probably no longer need this error-out. If there's a new limitation
> related to this function, I believe we can add it to the rate validation
> section as we are doing now -- better to have rate validation code at one
> place.
>
Ok.

> > @@ -380,8 +415,8 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair
> *pair)
> > /* Apply configurations for pre- and post-processing */
>
> Here:
> - /* Apply configurations for pre- and post-processing */
> + /* Select and apply configurations for pre- and post-processing */
> + fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_proc);
> > regmap_update_bits(asrc_priv->regmap, REG_ASRCFG,
> > ASRCFG_PREMODi_MASK(index) |
> ASRCFG_POSTMODi_MASK(index),
> > - ASRCFG_PREMOD(index, process_option[in][out][0]) |
> > - ASRCFG_POSTMOD(index, process_option[in][out][1]));
> > + ASRCFG_PREMOD(index, pre_proc) |
> > + ASRCFG_POSTMOD(index, post_proc));

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