summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXingyu Wu <xingyu.wu@starfivetech.com>2022-09-05 12:25:15 +0300
committerXingyu Wu <xingyu.wu@starfivetech.com>2022-09-05 12:25:21 +0300
commit18815bc8557135b65313668ea493da371c375d56 (patch)
tree7f859c5f0cd3540df8652544e8814c98a7c15e00
parentef7704e855f7031bcc03c9b8f9839412e11e7286 (diff)
downloadlinux-18815bc8557135b65313668ea493da371c375d56.tar.xz
sound:codecs:ac108:Support 32k sampling rate
ac108:Support 32k sampling rate. Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
-rwxr-xr-xsound/soc/codecs/ac108.c2
-rwxr-xr-xsound/soc/dwc/dwc-i2s.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/codecs/ac108.c b/sound/soc/codecs/ac108.c
index 29303f6f5c4d..4aaa1f6cfe86 100755
--- a/sound/soc/codecs/ac108.c
+++ b/sound/soc/codecs/ac108.c
@@ -160,7 +160,7 @@ static const struct pll_div ac108_pll_div_list[] = {
/* AC108 definition */
#define AC108_CHANNELS_MAX 8 /* range[1, 16] */
#define AC108_RATES (SNDRV_PCM_RATE_8000_96000 & \
- ~(SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_64000 | \
+ ~(SNDRV_PCM_RATE_64000 | \
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000))
#define AC108_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
/*SNDRV_PCM_FMTBIT_S20_3LE | \
diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index e8bc238878b1..88fe68124f74 100755
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -277,7 +277,8 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream,
break;
case SNDRV_PCM_FORMAT_S32_LE:
- if ((config->sample_rate == 16000) && (config->chan_nr == 1)) {
+ if ((config->sample_rate == 16000) && (config->chan_nr == 1) &&
+ (txrx == SNDRV_PCM_STREAM_PLAYBACK)) {
dev_err(dev->dev, "I2S: unsupported 16000 rate with S32_LE, Mono.\n");
return -EINVAL;
}