All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 2/2] ASoC: Intel: Add machine driver for CX2072X on BYT/CHT platforms
Date: Wed, 24 Apr 2019 15:08:04 +0200	[thread overview]
Message-ID: <s5h36m7o8jv.wl-tiwai@suse.de> (raw)
In-Reply-To: <s5h5zr4pl2x.wl-tiwai@suse.de>

On Tue, 23 Apr 2019 21:39:50 +0200,
Takashi Iwai wrote:
> 
> > > +static int byt_cht_cx2072x_fixup(struct snd_soc_pcm_runtime *rtd,
> > > +				 struct snd_pcm_hw_params *params)
> > > +{
> > > +	struct snd_interval *rate =
> > > +		hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
> > > +	struct snd_interval *channels =
> > > +		hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
> > > +	int ret;
> > > +
> > > +	/* The DSP will covert the FE rate to 48k, stereo, 24bits */
> > > +	rate->min = rate->max = 48000;
> > > +	channels->min = channels->max = 2;
> > > +
> > > +	/* set SSP2 to 24-bit */
> > > +	params_set_format(params, SNDRV_PCM_FORMAT_S24_LE);
> > > +
> > > +	/*
> > > +	 * Default mode for SSP configuration is TDM 4 slot, override config
> > > +	 * with explicit setting to I2S 2ch 24-bit. The word length is set with
> > > +	 * dai_set_tdm_slot() since there is no other API exposed
> > > +	 */
> > > +	ret = snd_soc_dai_set_fmt(rtd->cpu_dai,
> > > +				SND_SOC_DAIFMT_I2S     |
> > > +				SND_SOC_DAIFMT_NB_NF   |
> > > +				SND_SOC_DAIFMT_CBS_CFS);
> > > +	if (ret < 0) {
> > > +		dev_err(rtd->dev, "can't set format to I2S, err %d\n", ret);
> > > +		return ret;
> > > +	}
> > > +
> > > +	ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x3, 0x3, 2, 24);
> > > +	if (ret < 0) {
> > > +		dev_err(rtd->dev, "can't set I2S config, err %d\n", ret);
> > > +		return ret;
> > > +	}
> > > +
> > > +	snd_soc_dai_set_bclk_ratio(rtd->codec_dai, 50);
> > 
> > that part would be problematic for SOF. IIRC we put all clock-related
> > stuff in the init, and ignore the fixups to use topology-based
> > information instead. If this call to _set_bclk_ratio can be moved to
> > the init it's more future-proof. Is there a reason to do this here in
> > the fixup?
> 
> No particular reason from my side.  I just took over your code ;)
> 
> That is, it'd be appreciated if you can give a fixup patch that can be
> applied on top.

OK, I tried just moving snd_soc_dai_set_bclk_ratio() into the init
callback, and it seems working fine.  The fix will be included in v2
patch.


thanks,

Takashi

      reply	other threads:[~2019-04-24 13:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 14:13 [PATCH 0/2] ASoC: CX2072X codec support (revised) Takashi Iwai
2019-04-23 14:13 ` [PATCH 1/2] ASoC: Add support for Conexant CX2072X CODEC Takashi Iwai
2019-04-27 17:59   ` Mark Brown
2019-05-02  7:04     ` Takashi Iwai
2019-05-02  7:52       ` Takashi Iwai
2019-05-03  6:52         ` Mark Brown
     [not found]       ` <20190503064729.GF14916@sirena.org.uk>
2019-05-03  7:18         ` Takashi Iwai
     [not found]           ` <20190506042625.GK14916@sirena.org.uk>
2019-05-06  9:55             ` Takashi Iwai
2019-05-06 14:05               ` Mark Brown
2019-05-06 15:26                 ` Takashi Iwai
2019-05-08  8:10                   ` Mark Brown
2019-05-08  8:16                     ` Takashi Iwai
2019-05-08  8:59                       ` Mark Brown
2019-05-08  9:16                         ` Takashi Iwai
2019-05-08 10:10                           ` Mark Brown
2019-05-03  8:05         ` Takashi Iwai
2019-04-23 14:13 ` [PATCH 2/2] ASoC: Intel: Add machine driver for CX2072X on BYT/CHT platforms Takashi Iwai
2019-04-23 19:20   ` Pierre-Louis Bossart
2019-04-23 19:39     ` Takashi Iwai
2019-04-24 13:08       ` Takashi Iwai [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=s5h36m7o8jv.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=pierre-louis.bossart@linux.intel.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.