[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <011edf7b-5787-4e35-bf61-ebe356ccfe1a@intel.com>
Date: Tue, 10 Sep 2024 09:47:59 +0200
From: Cezary Rojewski <cezary.rojewski@...el.com>
To: Jerome Brunet <jbrunet@...libre.com>
CC: <linux-sound@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<patches@...nsource.cirrus.com>, <alsa-devel@...a-project.org>,
<linux-arm-msm@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-sunxi@...ts.linux.dev>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai
<tiwai@...e.com>, David Rhodes <david.rhodes@...rus.com>, Richard Fitzgerald
<rf@...nsource.cirrus.com>, Liam Girdwood <lgirdwood@...il.com>, Mark Brown
<broonie@...nel.org>, Pierre-Louis Bossart
<pierre-louis.bossart@...ux.intel.com>, Liam Girdwood
<liam.r.girdwood@...ux.intel.com>, Peter Ujfalusi
<peter.ujfalusi@...ux.intel.com>, Bard Liao
<yung-chuan.liao@...ux.intel.com>, Ranjani Sridharan
<ranjani.sridharan@...ux.intel.com>, Kai Vehmanen
<kai.vehmanen@...ux.intel.com>, Srinivas Kandagatla
<srinivas.kandagatla@...aro.org>, Chen-Yu Tsai <wens@...e.org>, "Jernej
Skrabec" <jernej.skrabec@...il.com>, Samuel Holland <samuel@...lland.org>
Subject: Re: [PATCH 09/13] ASoC: Intel: avs: drop SNDRV_PCM_RATE_KNOT
On 2024-09-05 4:13 PM, Jerome Brunet wrote:
> The custom rate constraint list was necessary to support 12kHz, 24kHz and
> 128kHz. These rates are now available through SNDRV_PCM_RATE_12000,
> SNDRV_PCM_RATE_24000 and SNDRV_PCM_RATE_128000.
>
> Use them and drop the custom rate constraint rule.
>
> Signed-off-by: Jerome Brunet <jbrunet@...libre.com>
> ---
Thank you for this cleanup.
Reviewed-by: Cezary Rojewski <cezary.rojewski@...el.com>
> sound/soc/intel/avs/pcm.c | 22 ++++++----------------
> 1 file changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
> index c76b86254a8b..afc0fc74cf94 100644
> --- a/sound/soc/intel/avs/pcm.c
> +++ b/sound/soc/intel/avs/pcm.c
> @@ -471,16 +471,6 @@ static int hw_rule_param_size(struct snd_pcm_hw_params *params, struct snd_pcm_h
> static int avs_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
> {
> struct snd_pcm_runtime *runtime = substream->runtime;
> - static const unsigned int rates[] = {
> - 8000, 11025, 12000, 16000,
> - 22050, 24000, 32000, 44100,
> - 48000, 64000, 88200, 96000,
> - 128000, 176400, 192000,
> - };
> - static const struct snd_pcm_hw_constraint_list rate_list = {
> - .count = ARRAY_SIZE(rates),
> - .list = rates,
> - };
> int ret;
>
> ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
> @@ -492,10 +482,6 @@ static int avs_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
> if (ret < 0)
> return ret;
>
> - ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &rate_list);
> - if (ret < 0)
> - return ret;
> -
> /* Adjust buffer and period size based on the audio format. */
> snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, hw_rule_param_size, NULL,
> SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_CHANNELS,
> @@ -1332,7 +1318,9 @@ static const struct snd_soc_dai_driver i2s_dai_template = {
> .channels_min = 1,
> .channels_max = 8,
> .rates = SNDRV_PCM_RATE_8000_192000 |
> - SNDRV_PCM_RATE_KNOT,
> + SNDRV_PCM_RATE_12000 |
> + SNDRV_PCM_RATE_24000 |
> + SNDRV_PCM_RATE_128000,
> .formats = SNDRV_PCM_FMTBIT_S16_LE |
> SNDRV_PCM_FMTBIT_S32_LE,
> .subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
> @@ -1343,7 +1331,9 @@ static const struct snd_soc_dai_driver i2s_dai_template = {
> .channels_min = 1,
> .channels_max = 8,
> .rates = SNDRV_PCM_RATE_8000_192000 |
> - SNDRV_PCM_RATE_KNOT,
> + SNDRV_PCM_RATE_12000 |
> + SNDRV_PCM_RATE_24000 |
> + SNDRV_PCM_RATE_128000,
> .formats = SNDRV_PCM_FMTBIT_S16_LE |
> SNDRV_PCM_FMTBIT_S32_LE,
> .subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
>
Powered by blists - more mailing lists