Skip to content

Commit 9469cf5

Browse files
jbrun3ttiwai
authored andcommitted
ASoC: Intel: avs: drop SNDRV_PCM_RATE_KNOT
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@baylibre.com> Reviewed-by: David Rhodes <drhodes@opensource.cirrus.com> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20240905-alsa-12-24-128-v1-9-8371948d3921@baylibre.com
1 parent eab3464 commit 9469cf5

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

sound/soc/intel/avs/pcm.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -471,16 +471,6 @@ static int hw_rule_param_size(struct snd_pcm_hw_params *params, struct snd_pcm_h
471471
static int avs_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
472472
{
473473
struct snd_pcm_runtime *runtime = substream->runtime;
474-
static const unsigned int rates[] = {
475-
8000, 11025, 12000, 16000,
476-
22050, 24000, 32000, 44100,
477-
48000, 64000, 88200, 96000,
478-
128000, 176400, 192000,
479-
};
480-
static const struct snd_pcm_hw_constraint_list rate_list = {
481-
.count = ARRAY_SIZE(rates),
482-
.list = rates,
483-
};
484474
int ret;
485475

486476
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)
492482
if (ret < 0)
493483
return ret;
494484

495-
ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &rate_list);
496-
if (ret < 0)
497-
return ret;
498-
499485
/* Adjust buffer and period size based on the audio format. */
500486
snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, hw_rule_param_size, NULL,
501487
SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_CHANNELS,
@@ -1332,7 +1318,9 @@ static const struct snd_soc_dai_driver i2s_dai_template = {
13321318
.channels_min = 1,
13331319
.channels_max = 8,
13341320
.rates = SNDRV_PCM_RATE_8000_192000 |
1335-
SNDRV_PCM_RATE_KNOT,
1321+
SNDRV_PCM_RATE_12000 |
1322+
SNDRV_PCM_RATE_24000 |
1323+
SNDRV_PCM_RATE_128000,
13361324
.formats = SNDRV_PCM_FMTBIT_S16_LE |
13371325
SNDRV_PCM_FMTBIT_S32_LE,
13381326
.subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
@@ -1343,7 +1331,9 @@ static const struct snd_soc_dai_driver i2s_dai_template = {
13431331
.channels_min = 1,
13441332
.channels_max = 8,
13451333
.rates = SNDRV_PCM_RATE_8000_192000 |
1346-
SNDRV_PCM_RATE_KNOT,
1334+
SNDRV_PCM_RATE_12000 |
1335+
SNDRV_PCM_RATE_24000 |
1336+
SNDRV_PCM_RATE_128000,
13471337
.formats = SNDRV_PCM_FMTBIT_S16_LE |
13481338
SNDRV_PCM_FMTBIT_S32_LE,
13491339
.subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 |

0 commit comments

Comments
 (0)