[2/3] ASoC: adau1372: add support for S24_LE mode

Message ID 20221028152626.109603-3-maarten.zanders@mind.be
State New
Headers
Series ASoC: adau1372: fixes after debugging custom board |

Commit Message

Maarten Zanders Oct. 28, 2022, 3:26 p.m. UTC
  The ADAU1372 contains 24bit ADCs and DACs. Allow the driver to use
its native mode which uses the same settings as the current 32 bit
mode.

Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
---
 sound/soc/codecs/adau1372.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Mark Brown Nov. 25, 2022, 7:32 p.m. UTC | #1
On Fri, Oct 28, 2022 at 05:26:24PM +0200, Maarten Zanders wrote:
> The ADAU1372 contains 24bit ADCs and DACs. Allow the driver to use
> its native mode which uses the same settings as the current 32 bit
> mode.

Normally new features like this should come at the end of the series so
that they don't get in the way of merging fixes.  No need to resend for
this though.
  

Patch

diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c
index 00d0825e193b..6b35981c8777 100644
--- a/sound/soc/codecs/adau1372.c
+++ b/sound/soc/codecs/adau1372.c
@@ -662,6 +662,7 @@  static int adau1372_hw_params(struct snd_pcm_substream *substream,
 	case 16:
 		sai1 = ADAU1372_SAI1_BCLKRATE;
 		break;
+	case 24:
 	case 32:
 		sai1 = 0;
 		break;
@@ -699,6 +700,7 @@  static int adau1372_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 	case 16:
 		sai1 = ADAU1372_SAI1_BCLK_TDMC;
 		break;
+	case 24:
 	case 32:
 		sai1 = 0;
 		break;
@@ -869,7 +871,9 @@  static const struct snd_soc_dai_ops adau1372_dai_ops = {
 	.startup = adau1372_startup,
 };
 
-#define ADAU1372_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |	SNDRV_PCM_FMTBIT_S32_LE)
+#define ADAU1372_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
+			  SNDRV_PCM_FMTBIT_S24_LE | \
+			  SNDRV_PCM_FMTBIT_S32_LE)
 
 static struct snd_soc_dai_driver adau1372_dai_driver = {
 	.name = "adau1372",