ASoC: rk3399_gru_sound: Support 32, 44.1 and 88.2 kHz sample rates

According to the datasheet the max98357a also supports 32, 44.1 and
88.2 kHz sample rate. This support was also introduced recently by
commit fdf34366d3 ("ASoC: max98357a: add missing supported rates").

Actually the machine driver validates the supported sample rates but
this is not really needed because the component driver can all apply
whatever constraints are needed and do their own validation. So, remove
the checks from the machine driver as are not needed at all. This way,
we also support 32, 44.1 and 88.2 kHz sample rates and we get rid of the
errors like the below.

  rk3399-gru-sound sound: rockchip_sound_max98357a_hw_params() doesn't support this sample rate: 44100
  rk3399-gru-sound sound: ASoC: machine hw_params failed: -22

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Enric Balletbo i Serra 2019-06-21 17:58:08 +02:00 коммит произвёл Mark Brown
Родитель b9f2e25c59
Коммит 30b233b1cb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
1 изменённых файлов: 1 добавлений и 13 удалений

Просмотреть файл

@ -66,19 +66,7 @@ static int rockchip_sound_max98357a_hw_params(struct snd_pcm_substream *substrea
unsigned int mclk;
int ret;
/* max98357a supports these sample rates */
switch (params_rate(params)) {
case 8000:
case 16000:
case 48000:
case 96000:
mclk = params_rate(params) * SOUND_FS;
break;
default:
dev_err(rtd->card->dev, "%s() doesn't support this sample rate: %d\n",
__func__, params_rate(params));
return -EINVAL;
}
mclk = params_rate(params) * SOUND_FS;
ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, 0, mclk, 0);
if (ret) {