From: Xingyu Wu Date: Mon, 5 Sep 2022 05:59:34 +0000 (+0800) Subject: sound:codecs:ac108:Support 16bit format X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a67533ac044d1de5959d47720c444c3ac43acce;p=platform%2Fkernel%2Flinux-starfive.git sound:codecs:ac108:Support 16bit format ac108:Support 16bit format with capture. Signed-off-by: Xingyu Wu --- diff --git a/sound/soc/codecs/ac108.c b/sound/soc/codecs/ac108.c index a4afb1fba258..8cd641330aca 100755 --- a/sound/soc/codecs/ac108.c +++ b/sound/soc/codecs/ac108.c @@ -162,8 +162,8 @@ static const struct pll_div ac108_pll_div_list[] = { #define AC108_RATES (SNDRV_PCM_RATE_8000_96000 & \ ~(SNDRV_PCM_RATE_32000 | 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 | \ +#define AC108_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ + /*SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE |*/ \ SNDRV_PCM_FMTBIT_S32_LE) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index c6aaeec03731..e8bc238878b1 100755 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -256,7 +256,7 @@ static int dw_i2s_hw_params(struct snd_pcm_substream *substream, switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: - if (config->sample_rate == 8000) { + if ((config->sample_rate == 8000) && (txrx == SNDRV_PCM_STREAM_PLAYBACK)) { dev_err(dev->dev, "I2S: unsupported 8000 rate with S16_LE, Stereo.\n"); return -EINVAL; }