summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l36.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2024-09-05 16:12:57 +0200
committerTakashi Iwai <tiwai@suse.de>2024-09-06 09:23:55 +0200
commit7067e8142c4b37b4b78c6ba8eb23bf9ce4a2c5ec (patch)
tree19a63a4d1ee9d5812df3cf3959da1998d6685da4 /sound/soc/codecs/cs35l36.c
parentALSA: hdspm: drop SNDRV_PCM_RATE_KNOT (diff)
downloadlinux-7067e8142c4b37b4b78c6ba8eb23bf9ce4a2c5ec.tar.xz
linux-7067e8142c4b37b4b78c6ba8eb23bf9ce4a2c5ec.zip
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
Diffstat (limited to '')
-rw-r--r--sound/soc/codecs/cs35l36.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index cbea79bd8980..b49c6905e872 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -949,32 +949,22 @@ static const struct cs35l36_pll_config *cs35l36_get_clk_config(
return NULL;
}
-static const unsigned int cs35l36_src_rates[] = {
- 8000, 12000, 11025, 16000, 22050, 24000, 32000,
- 44100, 48000, 88200, 96000, 176400, 192000, 384000
-};
-
-static const struct snd_pcm_hw_constraint_list cs35l36_constraints = {
- .count = ARRAY_SIZE(cs35l36_src_rates),
- .list = cs35l36_src_rates,
-};
-
-static int cs35l36_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, &cs35l36_constraints);
-
- return 0;
-}
-
static const struct snd_soc_dai_ops cs35l36_ops = {
- .startup = cs35l36_pcm_startup,
.set_fmt = cs35l36_set_dai_fmt,
.hw_params = cs35l36_pcm_hw_params,
.set_sysclk = cs35l36_dai_set_sysclk,
};
+#define CS35L36_RATES ( \
+ SNDRV_PCM_RATE_8000_48000 | \
+ SNDRV_PCM_RATE_12000 | \
+ SNDRV_PCM_RATE_24000 | \
+ SNDRV_PCM_RATE_88200 | \
+ SNDRV_PCM_RATE_96000 | \
+ SNDRV_PCM_RATE_176400 | \
+ SNDRV_PCM_RATE_192000 | \
+ SNDRV_PCM_RATE_384000)
+
static struct snd_soc_dai_driver cs35l36_dai[] = {
{
.name = "cs35l36-pcm",
@@ -983,14 +973,14 @@ static struct snd_soc_dai_driver cs35l36_dai[] = {
.stream_name = "AMP Playback",
.channels_min = 1,
.channels_max = 8,
- .rates = SNDRV_PCM_RATE_KNOT,
+ .rates = CS35L36_RATES,
.formats = CS35L36_RX_FORMATS,
},
.capture = {
.stream_name = "AMP Capture",
.channels_min = 1,
.channels_max = 8,
- .rates = SNDRV_PCM_RATE_KNOT,
+ .rates = CS35L36_RATES,
.formats = CS35L36_TX_FORMATS,
},
.ops = &cs35l36_ops,