linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shengjiu Wang <shengjiu.wang@gmail.com>
To: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Timur Tabi <timur@kernel.org>, Xiubo Li <Xiubo.Lee@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>,
	kernel@collabora.com
Subject: Re: [PATCH v2 2/2] ASoC: fsl_asrc: always use internal ratio
Date: Mon, 20 Jul 2020 18:20:44 +0800	[thread overview]
Message-ID: <CAA+D8AP+cN5Z_ahBm2Kh+eE4TzA=LHaSoFQEiZw=Qr2jCf1OwA@mail.gmail.com> (raw)
In-Reply-To: <e4d96e1f-b988-bb24-b784-b4198d172e40@collabora.com>

On Fri, Jul 17, 2020 at 5:58 PM Arnaud Ferraris
<arnaud.ferraris@collabora.com> wrote:
>
>
>
> Le 17/07/2020 à 01:37, Nicolin Chen a écrit :
> >> @@ -507,8 +507,7 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate)
> >>
> >>      /* Enable Ideal Ratio mode */
> >
> > The code is against the comments now -- need to update this line.
>
> It isn't, the following code still enables "Ideal Ratio" mode (see below)
>
> >>      regmap_update_bits(asrc->regmap, REG_ASRCTR,
> >> -                       ASRCTR_IDRi_MASK(index) | ASRCTR_USRi_MASK(index),
> >> -                       ASRCTR_IDR(index) | ASRCTR_USR(index));
> >> +                       ASRCTR_IDRi_MASK(index), ASRCTR_IDR(index);
> >
> > The driver falls back to ideal ratio mode if there is no matched
> > clock source. Your change seems to apply internal ratio mode any
> > way? Probably would break the fallback routine.
>
> Strictly speaking, internal ratio is only enabled when we have matched
> clock sources, and is used in addition to the calculated dividers
> (allows the ASRC to better adjust to drifting/inaccurate physical
> clocks). "Ideal Ratio" mode is different, and still enabled as a
> fallback when no clock source is matched.
>
> Ideal ratio requires both USRi and IDRi bits to be set, and that would
> still be the case if there is no matched clock source.
>
> The only difference my patch introduces is that USRi is always set (was
> previously cleared for "normal" mode), and therefore only IDRi needs to
> be set in order to enable ideal ratio mode.
>

In my experience, the USRi = 0, no matter the value of IDRi, it is
internal ratio mode.  USRi=1, IDRi=0, it is also internal ratio mode.
So original code should be ok for internal ratio mode,  no need
to add this change.
could you please double check it?

best regards
wang shengjiu

      reply	other threads:[~2020-07-20 10:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 14:51 [PATCH 0/2] ASoC: fsl_asrc: improve clock selection and quality Arnaud Ferraris
2020-07-16 14:52 ` [PATCH 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different Arnaud Ferraris
2020-07-16 15:07   ` Arnaud Ferraris
2020-07-16 14:52 ` [PATCH 2/2] ASoC: fsl_asrc: always use internal ratio Arnaud Ferraris
2020-07-16 15:13 ` [PATCH v2 0/2] ASoC: fsl_asrc: improve clock selection and quality Arnaud Ferraris
2020-07-16 15:13   ` [PATCH v2 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different Arnaud Ferraris
2020-07-16 23:20     ` Nicolin Chen
2020-07-17 10:38       ` [PATCH v3 0/1] ASoC: fsl_asrc: always select different clocks Arnaud Ferraris
2020-07-17 10:38         ` [PATCH v3 1/1] ASoC: fsl_asrc: make sure the input and output clocks are different Arnaud Ferraris
2020-07-17 23:05           ` Nicolin Chen
2020-07-20 10:34           ` Shengjiu Wang
2020-07-17 11:21         ` [PATCH v3 0/1] ASoC: fsl_asrc: always select different clocks Mark Brown
2020-07-17 11:34           ` Arnaud Ferraris
2020-07-17 11:45             ` Mark Brown
2020-07-16 15:13   ` [PATCH v2 2/2] ASoC: fsl_asrc: always use internal ratio Arnaud Ferraris
2020-07-16 23:37     ` Nicolin Chen
2020-07-17  9:58       ` Arnaud Ferraris
2020-07-20 10:20         ` Shengjiu Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA+D8AP+cN5Z_ahBm2Kh+eE4TzA=LHaSoFQEiZw=Qr2jCf1OwA@mail.gmail.com' \
    --to=shengjiu.wang@gmail.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.ferraris@collabora.com \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=timur@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).