33 #include <linux/module.h>
34 #include <linux/device.h>
49 static int bf5xx_tdm_set_dai_fmt(
struct snd_soc_dai *cpu_dai,
85 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
89 bf5xx_tdm->
tcr2 &= ~0x1f;
90 bf5xx_tdm->
rcr2 &= ~0x1f;
93 bf5xx_tdm->
tcr2 |= 31;
94 bf5xx_tdm->
rcr2 |= 31;
99 pr_err(
"not supported PCM format yet\n");
114 bf5xx_tdm->
rcr2, 0, 0);
116 pr_err(
"SPORT is busy!\n");
121 bf5xx_tdm->
tcr2, 0, 0);
123 pr_err(
"SPORT is busy!\n");
136 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
144 static int bf5xx_tdm_set_channel_map(
struct snd_soc_dai *dai,
145 unsigned int tx_num,
unsigned int *tx_slot,
146 unsigned int rx_num,
unsigned int *rx_slot)
148 struct sport_device *sport_handle = snd_soc_dai_get_drvdata(dai);
152 unsigned int tx_mapped = 0, rx_mapped = 0;
158 for (i = 0; i < tx_num; i++) {
161 (!(tx_mapped & (1 << slot)))) {
163 tx_mapped |= 1 <<
slot;
167 for (i = 0; i < rx_num; i++) {
170 (!(rx_mapped & (1 << slot)))) {
172 rx_mapped |= 1 <<
slot;
183 struct sport_device *sport = snd_soc_dai_get_drvdata(dai);
199 struct sport_device *sport = snd_soc_dai_get_drvdata(dai);
203 pr_err(
"SPORT is busy!\n");
209 pr_err(
"SPORT is busy!\n");
215 pr_err(
"SPORT is busy!\n");
225 #define bf5xx_tdm_suspend NULL
226 #define bf5xx_tdm_resume NULL
230 .hw_params = bf5xx_tdm_hw_params,
231 .set_fmt = bf5xx_tdm_set_dai_fmt,
232 .shutdown = bf5xx_tdm_shutdown,
233 .set_channel_map = bf5xx_tdm_set_channel_map,
249 .ops = &bf5xx_tdm_dai_ops,
266 pr_err(
"SPORT is busy!\n");
268 goto sport_config_err;
273 pr_err(
"SPORT is busy!\n");
275 goto sport_config_err;
280 pr_err(
"SPORT is busy!\n");
282 goto sport_config_err;
287 pr_err(
"Failed to register DAI: %d\n", ret);
288 goto sport_config_err;
300 struct sport_device *sport_handle = platform_get_drvdata(pdev);
309 .probe = bfin_tdm_probe,