]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: cs53l30: drop SNDRV_PCM_RATE_KNOT
authorJerome Brunet <jbrunet@baylibre.com>
Thu, 5 Sep 2024 14:12:59 +0000 (16:12 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Sep 2024 07:23:55 +0000 (09:23 +0200)
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-8-8371948d3921@baylibre.com
sound/soc/codecs/cs53l30.c

index bcbaf28a0b2d98d1d3156e238ef74082a0296eb0..28f4be37dec19653f6a51244258dd2853e9bc012 100644 (file)
@@ -739,24 +739,6 @@ static int cs53l30_set_tristate(struct snd_soc_dai *dai, int tristate)
                                  CS53L30_ASP_3ST_MASK, val);
 }
 
-static unsigned int const cs53l30_src_rates[] = {
-       8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
-};
-
-static const struct snd_pcm_hw_constraint_list src_constraints = {
-       .count = ARRAY_SIZE(cs53l30_src_rates),
-       .list = cs53l30_src_rates,
-};
-
-static int cs53l30_pcm_startup(struct snd_pcm_substream *substream,
-                              struct snd_soc_dai *dai)
-{
-       snd_pcm_hw_constraint_list(substream->runtime, 0,
-                                  SNDRV_PCM_HW_PARAM_RATE, &src_constraints);
-
-       return 0;
-}
-
 /*
  * Note: CS53L30 counts the slot number per byte while ASoC counts the slot
  * number per slot_width. So there is a difference between the slots of ASoC
@@ -843,14 +825,14 @@ static int cs53l30_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
        return 0;
 }
 
-/* SNDRV_PCM_RATE_KNOT -> 12000, 24000 Hz, limit with constraint list */
-#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT)
+#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 |     \
+                      SNDRV_PCM_RATE_12000 |           \
+                      SNDRV_PCM_RATE_24000)
 
 #define CS53L30_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
                        SNDRV_PCM_FMTBIT_S24_LE)
 
 static const struct snd_soc_dai_ops cs53l30_ops = {
-       .startup = cs53l30_pcm_startup,
        .hw_params = cs53l30_pcm_hw_params,
        .set_fmt = cs53l30_set_dai_fmt,
        .set_sysclk = cs53l30_set_sysclk,