All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chiang, Mac" <mac.chiang@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: "guennadi.liakhovetski@linux.intel.com"
	<guennadi.liakhovetski@linux.intel.com>,
	"kai.vehmanen@linux.intel.com" <kai.vehmanen@linux.intel.com>,
	"liam.r.girdwood@linux.intel.com"
	<liam.r.girdwood@linux.intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"fan,  shuming" <shumingf@realtek.com>,
	"Lu, Brent" <brent.lu@intel.com>
Subject: RE: [PATCH] ASoC: Intel: sof_rt5682: add 512FS MCLK clock configuration
Date: Wed, 19 Jan 2022 06:40:13 +0000	[thread overview]
Message-ID: <PH0PR11MB583286547DFF8BA8CEB2B0D584599@PH0PR11MB5832.namprd11.prod.outlook.com> (raw)
In-Reply-To: <6aba2a91-695c-c69b-db0a-59a6b27fb425@linux.intel.com>

> > @@ -362,6 +361,9 @@ static int sof_rt5682_hw_params(struct
> snd_pcm_substream *substream,
> >  	if (sof_rt5682_quirk & SOF_RT5682S_HEADPHONE_CODEC_PRESENT)
> {
> >  		pll_id = RT5682S_PLL2;
> >  		clk_id = RT5682S_SCLK_S_PLL2;
> > +
> > +		if (pll_in == 24576000)
> > +			clk_id = RT5682S_SCLK_S_MCLK;
> 
> this case only affects the RT5682s case.
Thanks Pierre, you are right. Per discussed with Shuming, both 5682vs and 5682vd have to affect.
> 
> >  	} else {
> >  		pll_id = RT5682_PLL1;
> >  		clk_id = RT5682_SCLK_S_PLL1;
> 
> for the RT5682 we keep using the PLL. Is this intentional?
> 
> I also wonder if we can avoid the hard-coding. Can we use e.g.
> 
> if (pll_in == params_rate(params) * 512)
Agree, no hard-coding.
> ?
>
> 
> > @@ -369,11 +371,14 @@ static int sof_rt5682_hw_params(struct
> > snd_pcm_substream *substream,
> >
> >  	pll_out = params_rate(params) * 512;
> >
> > -	/* Configure pll for codec */
> > -	ret = snd_soc_dai_set_pll(codec_dai, pll_id, pll_source, pll_in,
> > -				  pll_out);
> > -	if (ret < 0)
> > -		dev_err(rtd->dev, "snd_soc_dai_set_pll err = %d\n", ret);
> > +	/* when MCLK is 512FS, no need to set PLL configuration additionally.
> */
> > +	if (pll_in != 24576000) {
> 
> can we use if (pll_in == pll_out) ?
Agree, will modify as if (!(pll_in == pll_out)) {
> 
> > +		/* Configure pll for codec */
> > +		ret = snd_soc_dai_set_pll(codec_dai, pll_id, pll_source, pll_in,
> > +					  pll_out);
> > +		if (ret < 0)
> > +			dev_err(rtd->dev, "snd_soc_dai_set_pll err = %d\n",
> ret);
> > +	}
> >
> >  	/* Configure sysclk for codec */
> >  	ret = snd_soc_dai_set_sysclk(codec_dai, clk_id,
> >

  reply	other threads:[~2022-01-19  6:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18  8:49 [PATCH] ASoC: Intel: sof_rt5682: add 512FS MCLK clock configuration Mac Chiang
2022-01-18 15:19 ` Pierre-Louis Bossart
2022-01-19  6:40   ` Chiang, Mac [this message]
2022-01-19  8:54     ` Lu, Brent

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=PH0PR11MB583286547DFF8BA8CEB2B0D584599@PH0PR11MB5832.namprd11.prod.outlook.com \
    --to=mac.chiang@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brent.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shumingf@realtek.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.