aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap3beagle.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/omap3beagle.c')
-rw-r--r--sound/soc/omap/omap3beagle.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
index 6aa428e07d86..b0cff9f33b7e 100644
--- a/sound/soc/omap/omap3beagle.c
+++ b/sound/soc/omap/omap3beagle.c
@@ -41,23 +41,33 @@ static int omap3beagle_hw_params(struct snd_pcm_substream *substream,
41 struct snd_soc_pcm_runtime *rtd = substream->private_data; 41 struct snd_soc_pcm_runtime *rtd = substream->private_data;
42 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 42 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
43 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 43 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
44 unsigned int fmt;
44 int ret; 45 int ret;
45 46
47 switch (params_channels(params)) {
48 case 2: /* Stereo I2S mode */
49 fmt = SND_SOC_DAIFMT_I2S |
50 SND_SOC_DAIFMT_NB_NF |
51 SND_SOC_DAIFMT_CBM_CFM;
52 break;
53 case 4: /* Four channel TDM mode */
54 fmt = SND_SOC_DAIFMT_DSP_A |
55 SND_SOC_DAIFMT_IB_NF |
56 SND_SOC_DAIFMT_CBM_CFM;
57 break;
58 default:
59 return -EINVAL;
60 }
61
46 /* Set codec DAI configuration */ 62 /* Set codec DAI configuration */
47 ret = snd_soc_dai_set_fmt(codec_dai, 63 ret = snd_soc_dai_set_fmt(codec_dai, fmt);
48 SND_SOC_DAIFMT_I2S |
49 SND_SOC_DAIFMT_NB_NF |
50 SND_SOC_DAIFMT_CBM_CFM);
51 if (ret < 0) { 64 if (ret < 0) {
52 printk(KERN_ERR "can't set codec DAI configuration\n"); 65 printk(KERN_ERR "can't set codec DAI configuration\n");
53 return ret; 66 return ret;
54 } 67 }
55 68
56 /* Set cpu DAI configuration */ 69 /* Set cpu DAI configuration */
57 ret = snd_soc_dai_set_fmt(cpu_dai, 70 ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
58 SND_SOC_DAIFMT_I2S |
59 SND_SOC_DAIFMT_NB_NF |
60 SND_SOC_DAIFMT_CBM_CFM);
61 if (ret < 0) { 71 if (ret < 0) {
62 printk(KERN_ERR "can't set cpu DAI configuration\n"); 72 printk(KERN_ERR "can't set cpu DAI configuration\n");
63 return ret; 73 return ret;