From 2a11a10abe1b88b86e44480511262c72da97e55a Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 26 Jun 2014 08:06:56 +0300 Subject: ASoC: tlv320aic3x: Add support for S24_LE format The codec need to be configured to 24bit mode in case of S24_LE format. Signed-off-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic3x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sound/soc/codecs/tlv320aic3x.c') diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 5360772..d275890 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -880,6 +880,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, data |= (0x01 << 4); break; case SNDRV_PCM_FORMAT_S24_3LE: + case SNDRV_PCM_FORMAT_S24_LE: data |= (0x02 << 4); break; case SNDRV_PCM_FORMAT_S32_LE: @@ -1194,7 +1195,8 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec, #define AIC3X_RATES SNDRV_PCM_RATE_8000_96000 #define AIC3X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ - SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) + SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE) static const struct snd_soc_dai_ops aic3x_dai_ops = { .hw_params = aic3x_hw_params, -- cgit v1.1 From 3e3e2922c12f29b177b18acc15655186466a92f2 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 31 Jul 2014 12:48:36 +0100 Subject: ASoC: tlv320aic3x: Convert to params_width() The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic3x.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sound/soc/codecs/tlv320aic3x.c') diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index d275890..00b127f 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -873,17 +873,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, /* select data word length */ data = snd_soc_read(codec, AIC3X_ASD_INTF_CTRLB) & (~(0x3 << 4)); - switch (params_format(params)) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (params_width(params)) { + case 16: break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: data |= (0x01 << 4); break; - case SNDRV_PCM_FORMAT_S24_3LE: - case SNDRV_PCM_FORMAT_S24_LE: + case 24: data |= (0x02 << 4); break; - case SNDRV_PCM_FORMAT_S32_LE: + case 32: data |= (0x03 << 4); break; } -- cgit v1.1