aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/tlv320dac33.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 05a4e9fade47..13d521cfe393 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -764,6 +764,8 @@ static int dac33_startup(struct snd_pcm_substream *substream,
764 /* Stream started, save the substream pointer */ 764 /* Stream started, save the substream pointer */
765 dac33->substream = substream; 765 dac33->substream = substream;
766 766
767 snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
768
767 return 0; 769 return 0;
768} 770}
769 771
@@ -803,6 +805,10 @@ static int dac33_hw_params(struct snd_pcm_substream *substream,
803 dac33->fifo_size = DAC33_FIFO_SIZE_16BIT; 805 dac33->fifo_size = DAC33_FIFO_SIZE_16BIT;
804 dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 32); 806 dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 32);
805 break; 807 break;
808 case SNDRV_PCM_FORMAT_S32_LE:
809 dac33->fifo_size = DAC33_FIFO_SIZE_24BIT;
810 dac33->burst_rate = CALC_BURST_RATE(dac33->burst_bclkdiv, 64);
811 break;
806 default: 812 default:
807 dev_err(codec->dev, "unsupported format %d\n", 813 dev_err(codec->dev, "unsupported format %d\n",
808 params_format(params)); 814 params_format(params));
@@ -856,6 +862,9 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
856 aictrl_a |= (DAC33_NCYCL_16 | DAC33_WLEN_16); 862 aictrl_a |= (DAC33_NCYCL_16 | DAC33_WLEN_16);
857 fifoctrl_a |= DAC33_WIDTH; 863 fifoctrl_a |= DAC33_WIDTH;
858 break; 864 break;
865 case SNDRV_PCM_FORMAT_S32_LE:
866 aictrl_a |= (DAC33_NCYCL_32 | DAC33_WLEN_24);
867 break;
859 default: 868 default:
860 dev_err(codec->dev, "unsupported format %d\n", 869 dev_err(codec->dev, "unsupported format %d\n",
861 substream->runtime->format); 870 substream->runtime->format);
@@ -990,7 +999,10 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
990 dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 999 dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C,
991 dac33->burst_bclkdiv); 1000 dac33->burst_bclkdiv);
992 else 1001 else
993 dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 32); 1002 if (substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE)
1003 dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 32);
1004 else
1005 dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 16);
994 1006
995 switch (dac33->fifo_mode) { 1007 switch (dac33->fifo_mode) {
996 case DAC33_FIFO_MODE1: 1008 case DAC33_FIFO_MODE1:
@@ -1438,7 +1450,7 @@ static struct snd_soc_codec_driver soc_codec_dev_tlv320dac33 = {
1438 1450
1439#define DAC33_RATES (SNDRV_PCM_RATE_44100 | \ 1451#define DAC33_RATES (SNDRV_PCM_RATE_44100 | \
1440 SNDRV_PCM_RATE_48000) 1452 SNDRV_PCM_RATE_48000)
1441#define DAC33_FORMATS SNDRV_PCM_FMTBIT_S16_LE 1453#define DAC33_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
1442 1454
1443static struct snd_soc_dai_ops dac33_dai_ops = { 1455static struct snd_soc_dai_ops dac33_dai_ops = {
1444 .startup = dac33_startup, 1456 .startup = dac33_startup,