Skip to content

Commit 7067e81

Browse files
jbrun3ttiwai
authored andcommitted
ASoC: cs35l36: 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-6-8371948d3921@baylibre.com
1 parent 151d82f commit 7067e81

1 file changed

Lines changed: 12 additions & 22 deletions

File tree

sound/soc/codecs/cs35l36.c

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -949,32 +949,22 @@ static const struct cs35l36_pll_config *cs35l36_get_clk_config(
949949
return NULL;
950950
}
951951

952-
static const unsigned int cs35l36_src_rates[] = {
953-
8000, 12000, 11025, 16000, 22050, 24000, 32000,
954-
44100, 48000, 88200, 96000, 176400, 192000, 384000
955-
};
956-
957-
static const struct snd_pcm_hw_constraint_list cs35l36_constraints = {
958-
.count = ARRAY_SIZE(cs35l36_src_rates),
959-
.list = cs35l36_src_rates,
960-
};
961-
962-
static int cs35l36_pcm_startup(struct snd_pcm_substream *substream,
963-
struct snd_soc_dai *dai)
964-
{
965-
snd_pcm_hw_constraint_list(substream->runtime, 0,
966-
SNDRV_PCM_HW_PARAM_RATE, &cs35l36_constraints);
967-
968-
return 0;
969-
}
970-
971952
static const struct snd_soc_dai_ops cs35l36_ops = {
972-
.startup = cs35l36_pcm_startup,
973953
.set_fmt = cs35l36_set_dai_fmt,
974954
.hw_params = cs35l36_pcm_hw_params,
975955
.set_sysclk = cs35l36_dai_set_sysclk,
976956
};
977957

958+
#define CS35L36_RATES ( \
959+
SNDRV_PCM_RATE_8000_48000 | \
960+
SNDRV_PCM_RATE_12000 | \
961+
SNDRV_PCM_RATE_24000 | \
962+
SNDRV_PCM_RATE_88200 | \
963+
SNDRV_PCM_RATE_96000 | \
964+
SNDRV_PCM_RATE_176400 | \
965+
SNDRV_PCM_RATE_192000 | \
966+
SNDRV_PCM_RATE_384000)
967+
978968
static struct snd_soc_dai_driver cs35l36_dai[] = {
979969
{
980970
.name = "cs35l36-pcm",
@@ -983,14 +973,14 @@ static struct snd_soc_dai_driver cs35l36_dai[] = {
983973
.stream_name = "AMP Playback",
984974
.channels_min = 1,
985975
.channels_max = 8,
986-
.rates = SNDRV_PCM_RATE_KNOT,
976+
.rates = CS35L36_RATES,
987977
.formats = CS35L36_RX_FORMATS,
988978
},
989979
.capture = {
990980
.stream_name = "AMP Capture",
991981
.channels_min = 1,
992982
.channels_max = 8,
993-
.rates = SNDRV_PCM_RATE_KNOT,
983+
.rates = CS35L36_RATES,
994984
.formats = CS35L36_TX_FORMATS,
995985
},
996986
.ops = &cs35l36_ops,

0 commit comments

Comments
 (0)