30 #include <linux/module.h>
31 #include <linux/device.h>
54 static int bf5xx_i2s_set_dai_fmt(
struct snd_soc_dai *cpu_dai,
57 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(cpu_dai);
103 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
107 bf5xx_i2s->
tcr2 &= ~0x1f;
108 bf5xx_i2s->
rcr2 &= ~0x1f;
111 bf5xx_i2s->
tcr2 |= 7;
112 bf5xx_i2s->
rcr2 |= 7;
115 bf5xx_i2s->
tcr2 |= 15;
116 bf5xx_i2s->
rcr2 |= 15;
120 bf5xx_i2s->
tcr2 |= 23;
121 bf5xx_i2s->
rcr2 |= 23;
125 bf5xx_i2s->
tcr2 |= 31;
126 bf5xx_i2s->
rcr2 |= 31;
142 bf5xx_i2s->
rcr2, 0, 0);
144 pr_err(
"SPORT is busy!\n");
149 bf5xx_i2s->
tcr2, 0, 0);
151 pr_err(
"SPORT is busy!\n");
162 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
174 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
176 pr_debug(
"%s : sport %d\n", __func__, dai->
id);
187 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
191 pr_debug(
"%s : sport %d\n", __func__, dai->
id);
194 bf5xx_i2s->
rcr2, 0, 0);
196 pr_err(
"SPORT is busy!\n");
201 bf5xx_i2s->
tcr2, 0, 0);
203 pr_err(
"SPORT is busy!\n");
211 #define bf5xx_i2s_suspend NULL
212 #define bf5xx_i2s_resume NULL
215 #define BF5XX_I2S_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
216 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
217 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \
218 SNDRV_PCM_RATE_96000)
220 #define BF5XX_I2S_FORMATS \
221 (SNDRV_PCM_FMTBIT_S8 | \
222 SNDRV_PCM_FMTBIT_S16_LE | \
223 SNDRV_PCM_FMTBIT_S24_LE | \
224 SNDRV_PCM_FMTBIT_S32_LE)
227 .shutdown = bf5xx_i2s_shutdown,
228 .hw_params = bf5xx_i2s_hw_params,
229 .set_fmt = bf5xx_i2s_set_dai_fmt,
245 .ops = &bf5xx_i2s_dai_ops,
262 pr_err(
"Failed to register DAI: %d\n", ret);
272 struct sport_device *sport_handle = platform_get_drvdata(pdev);
283 .probe = bf5xx_i2s_probe,