Skip to content

Commit eab3464

Browse files
jbrun3ttiwai
authored andcommitted
ASoC: cs53l30: 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-8-8371948d3921@baylibre.com
1 parent 79acb4c commit eab3464

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

sound/soc/codecs/cs53l30.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -739,24 +739,6 @@ static int cs53l30_set_tristate(struct snd_soc_dai *dai, int tristate)
739739
CS53L30_ASP_3ST_MASK, val);
740740
}
741741

742-
static unsigned int const cs53l30_src_rates[] = {
743-
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
744-
};
745-
746-
static const struct snd_pcm_hw_constraint_list src_constraints = {
747-
.count = ARRAY_SIZE(cs53l30_src_rates),
748-
.list = cs53l30_src_rates,
749-
};
750-
751-
static int cs53l30_pcm_startup(struct snd_pcm_substream *substream,
752-
struct snd_soc_dai *dai)
753-
{
754-
snd_pcm_hw_constraint_list(substream->runtime, 0,
755-
SNDRV_PCM_HW_PARAM_RATE, &src_constraints);
756-
757-
return 0;
758-
}
759-
760742
/*
761743
* Note: CS53L30 counts the slot number per byte while ASoC counts the slot
762744
* 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)
843825
return 0;
844826
}
845827

846-
/* SNDRV_PCM_RATE_KNOT -> 12000, 24000 Hz, limit with constraint list */
847-
#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT)
828+
#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 | \
829+
SNDRV_PCM_RATE_12000 | \
830+
SNDRV_PCM_RATE_24000)
848831

849832
#define CS53L30_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
850833
SNDRV_PCM_FMTBIT_S24_LE)
851834

852835
static const struct snd_soc_dai_ops cs53l30_ops = {
853-
.startup = cs53l30_pcm_startup,
854836
.hw_params = cs53l30_pcm_hw_params,
855837
.set_fmt = cs53l30_set_dai_fmt,
856838
.set_sysclk = cs53l30_set_sysclk,

0 commit comments

Comments
 (0)