Skip to content

Commit c061d1e

Browse files
jbrun3ttiwai
authored andcommitted
ASoC: qcom: q6asm-dai: drop SNDRV_PCM_RATE_KNOT
The custom rate constraint list was necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. 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-10-8371948d3921@baylibre.com
1 parent 9469cf5 commit c061d1e

1 file changed

Lines changed: 10 additions & 21 deletions

File tree

sound/soc/qcom/qdsp6/q6asm-dai.c

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,13 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_playback = {
128128
#define Q6ASM_FEDAI_DRIVER(num) { \
129129
.playback = { \
130130
.stream_name = "MultiMedia"#num" Playback", \
131-
.rates = (SNDRV_PCM_RATE_8000_192000| \
132-
SNDRV_PCM_RATE_KNOT), \
131+
.rates = (SNDRV_PCM_RATE_8000_48000 | \
132+
SNDRV_PCM_RATE_12000 | \
133+
SNDRV_PCM_RATE_24000 | \
134+
SNDRV_PCM_RATE_88200 | \
135+
SNDRV_PCM_RATE_96000 | \
136+
SNDRV_PCM_RATE_176400 | \
137+
SNDRV_PCM_RATE_192000), \
133138
.formats = (SNDRV_PCM_FMTBIT_S16_LE | \
134139
SNDRV_PCM_FMTBIT_S24_LE), \
135140
.channels_min = 1, \
@@ -139,8 +144,9 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_playback = {
139144
}, \
140145
.capture = { \
141146
.stream_name = "MultiMedia"#num" Capture", \
142-
.rates = (SNDRV_PCM_RATE_8000_48000| \
143-
SNDRV_PCM_RATE_KNOT), \
147+
.rates = (SNDRV_PCM_RATE_8000_48000 | \
148+
SNDRV_PCM_RATE_12000 | \
149+
SNDRV_PCM_RATE_24000), \
144150
.formats = (SNDRV_PCM_FMTBIT_S16_LE | \
145151
SNDRV_PCM_FMTBIT_S24_LE), \
146152
.channels_min = 1, \
@@ -152,18 +158,6 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_playback = {
152158
.id = MSM_FRONTEND_DAI_MULTIMEDIA##num, \
153159
}
154160

155-
/* Conventional and unconventional sample rate supported */
156-
static unsigned int supported_sample_rates[] = {
157-
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
158-
88200, 96000, 176400, 192000
159-
};
160-
161-
static struct snd_pcm_hw_constraint_list constraints_sample_rates = {
162-
.count = ARRAY_SIZE(supported_sample_rates),
163-
.list = supported_sample_rates,
164-
.mask = 0,
165-
};
166-
167161
static const struct snd_compr_codec_caps q6asm_compr_caps = {
168162
.num_descriptors = 1,
169163
.descriptor[0].max_ch = 2,
@@ -390,11 +384,6 @@ static int q6asm_dai_open(struct snd_soc_component *component,
390384
else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
391385
runtime->hw = q6asm_dai_hardware_capture;
392386

393-
ret = snd_pcm_hw_constraint_list(runtime, 0,
394-
SNDRV_PCM_HW_PARAM_RATE,
395-
&constraints_sample_rates);
396-
if (ret < 0)
397-
dev_info(dev, "snd_pcm_hw_constraint_list failed\n");
398387
/* Ensure that buffer size is a multiple of period size */
399388
ret = snd_pcm_hw_constraint_integer(runtime,
400389
SNDRV_PCM_HW_PARAM_PERIODS);

0 commit comments

Comments
 (0)