[alsa-devel] [PATCH v2 3/8] ASoC: qdsp6: q6afe-dai: add support to pcm port dais
Mark Brown
broonie at kernel.org
Mon Feb 10 14:34:16 CET 2020
On Sun, Feb 09, 2020 at 10:47:43AM -0500, Adam Serbinski wrote:
> +static int q6pcm_hw_params(struct snd_pcm_substream *substream,
> + struct snd_pcm_hw_params *params,
> + struct snd_soc_dai *dai)
> +{
> + struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev);
> + struct q6afe_pcm_cfg *pcm = &dai_data->port_config[dai->id].pcm_cfg;
> +
> + pcm->sample_rate = params_rate(params);
> +
This and set_fmt() don't do any validation of the value being set.
> static const struct snd_soc_dai_ops q6tdm_ops = {
> .prepare = q6afe_dai_prepare,
> .shutdown = q6afe_dai_shutdown,
> - .set_sysclk = q6afe_mi2s_set_sysclk,
> + .set_sysclk = q6afe_tdm_set_sysclk,
> .set_tdm_slot = q6tdm_set_tdm_slot,
> .set_channel_map = q6tdm_set_channel_map,
> .hw_params = q6tdm_hw_params,
This looks like a separate bug fix that should be split out?
> + }, {
> + .playback = {
> + .stream_name = "Primary PCM Playback",
> + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
> + .formats = SNDRV_PCM_FMTBIT_S16_LE |
> + SNDRV_PCM_FMTBIT_S24_LE,
> + .rate_min = 8000,
> + .rate_max = 16000,
> + },
It is surprising to see rate_min and rate_max specified when we're not
using _KNOT, and again there's weird formatting here with the tabs
before the rate values.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20200210/c36eca2b/attachment.sig>
More information about the Alsa-devel
mailing list