All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shengjiu Wang <shengjiu.wang@gmail.com>
To: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Timur Tabi <timur@kernel.org>, Xiubo Li <Xiubo.Lee@gmail.com>,
	linuxppc-dev@lists.ozlabs.org, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level function
Date: Mon, 3 Aug 2020 09:28:01 +0800	[thread overview]
Message-ID: <CAA+D8APexk_-o91B=u1bthVxXr_+gUL9Yq4UA5zscLfP3Xsa6Q@mail.gmail.com> (raw)
In-Reply-To: <20200802064351.GA24213@Asurada-Nvidia>

On Sun, Aug 2, 2020 at 2:44 PM Nicolin Chen <nicoleotsuka@gmail.com> wrote:
>
> On Sun, Aug 02, 2020 at 10:22:35AM +0800, Shengjiu Wang wrote:
>
> > > > +     /* Specific configuration for PLL */
> > > > +     if (codec_priv->pll_id && codec_priv->fll_id) {
> > > > +             if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE)
> > > > +                     pll_out = priv->sample_rate * 384;
> > > > +             else
> > > > +                     pll_out = priv->sample_rate * 256;
> > > > +
> > > > +             ret = snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0),
> > > > +                                       codec_priv->pll_id,
> > > > +                                       codec_priv->mclk_id,
> > > > +                                       codec_priv->mclk_freq, pll_out);
> > > > +             if (ret) {
> > > > +                     dev_err(dev, "failed to start FLL: %d\n", ret);
> > > > +                     goto out;
> > > > +             }
> > > > +
> > > > +             ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),
> > > > +                                          codec_priv->fll_id,
> > > > +                                          pll_out, SND_SOC_CLOCK_IN);
> > >
> > > Just came into my mind: do we need some protection here to prevent
> > > PLL/SYSCLK reconfiguration if TX/RX end up with different values?
> > >
> > Sorry,  not really catching your point. could you please elaborate?
> > Why do TX/RX end up with different values?
>
> If TX and RX run concurrently but in different sample rates or
> sample formats, pll_out would be overwritten to PLL/SYSCLK?
>
> I remember imx-wm8962 uses SSI, having symmetric flags for rates/
> channels/samplebits, but fsl-asoc-card might have (or will have)
> other use case.
>
> If all existing combinations don't have any problem, we can add
> a protection later when we need.

Good point. Current cases should be ok, as the boards with
wm8960 and wm8962 are all designed as synchronous mode.

Agree to add protection when needed in the future.

I will fix the nits and send v3.

best regards
wang shengjiu

WARNING: multiple messages have this Message-ID (diff)
From: Shengjiu Wang <shengjiu.wang@gmail.com>
To: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Timur Tabi <timur@kernel.org>, Xiubo Li <Xiubo.Lee@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Shengjiu Wang <shengjiu.wang@nxp.com>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linuxppc-dev@lists.ozlabs.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level function
Date: Mon, 3 Aug 2020 09:28:01 +0800	[thread overview]
Message-ID: <CAA+D8APexk_-o91B=u1bthVxXr_+gUL9Yq4UA5zscLfP3Xsa6Q@mail.gmail.com> (raw)
In-Reply-To: <20200802064351.GA24213@Asurada-Nvidia>

On Sun, Aug 2, 2020 at 2:44 PM Nicolin Chen <nicoleotsuka@gmail.com> wrote:
>
> On Sun, Aug 02, 2020 at 10:22:35AM +0800, Shengjiu Wang wrote:
>
> > > > +     /* Specific configuration for PLL */
> > > > +     if (codec_priv->pll_id && codec_priv->fll_id) {
> > > > +             if (priv->sample_format == SNDRV_PCM_FORMAT_S24_LE)
> > > > +                     pll_out = priv->sample_rate * 384;
> > > > +             else
> > > > +                     pll_out = priv->sample_rate * 256;
> > > > +
> > > > +             ret = snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0),
> > > > +                                       codec_priv->pll_id,
> > > > +                                       codec_priv->mclk_id,
> > > > +                                       codec_priv->mclk_freq, pll_out);
> > > > +             if (ret) {
> > > > +                     dev_err(dev, "failed to start FLL: %d\n", ret);
> > > > +                     goto out;
> > > > +             }
> > > > +
> > > > +             ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),
> > > > +                                          codec_priv->fll_id,
> > > > +                                          pll_out, SND_SOC_CLOCK_IN);
> > >
> > > Just came into my mind: do we need some protection here to prevent
> > > PLL/SYSCLK reconfiguration if TX/RX end up with different values?
> > >
> > Sorry,  not really catching your point. could you please elaborate?
> > Why do TX/RX end up with different values?
>
> If TX and RX run concurrently but in different sample rates or
> sample formats, pll_out would be overwritten to PLL/SYSCLK?
>
> I remember imx-wm8962 uses SSI, having symmetric flags for rates/
> channels/samplebits, but fsl-asoc-card might have (or will have)
> other use case.
>
> If all existing combinations don't have any problem, we can add
> a protection later when we need.

Good point. Current cases should be ok, as the boards with
wm8960 and wm8962 are all designed as synchronous mode.

Agree to add protection when needed in the future.

I will fix the nits and send v3.

best regards
wang shengjiu

  reply	other threads:[~2020-08-03  1:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  9:47 [PATCH v2] ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level function Shengjiu Wang
2020-08-01  7:59 ` Nicolin Chen
2020-08-01  7:59   ` Nicolin Chen
2020-08-01  7:59   ` Nicolin Chen
2020-08-02  2:22   ` Shengjiu Wang
2020-08-02  2:22     ` Shengjiu Wang
2020-08-02  6:43     ` Nicolin Chen
2020-08-02  6:43       ` Nicolin Chen
2020-08-03  1:28       ` Shengjiu Wang [this message]
2020-08-03  1:28         ` Shengjiu Wang

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+D8APexk_-o91B=u1bthVxXr_+gUL9Yq4UA5zscLfP3Xsa6Q@mail.gmail.com' \
    --to=shengjiu.wang@gmail.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=shengjiu.wang@nxp.com \
    --cc=timur@kernel.org \
    --cc=tiwai@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.