aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ad73311.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ad73311.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ad73311.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad73311.c b/sound/soc/blackfin/bf5xx-ad73311.c
index 9825b71d0e28..732a247f2527 100644
--- a/sound/soc/blackfin/bf5xx-ad73311.c
+++ b/sound/soc/blackfin/bf5xx-ad73311.c
@@ -35,7 +35,6 @@
35#include <sound/core.h> 35#include <sound/core.h>
36#include <sound/pcm.h> 36#include <sound/pcm.h>
37#include <sound/soc.h> 37#include <sound/soc.h>
38#include <sound/soc-dapm.h>
39#include <sound/pcm_params.h> 38#include <sound/pcm_params.h>
40 39
41#include <asm/blackfin.h> 40#include <asm/blackfin.h>
@@ -47,7 +46,6 @@
47#include "../codecs/ad73311.h" 46#include "../codecs/ad73311.h"
48#include "bf5xx-sport.h" 47#include "bf5xx-sport.h"
49#include "bf5xx-i2s-pcm.h" 48#include "bf5xx-i2s-pcm.h"
50#include "bf5xx-i2s.h"
51 49
52#if CONFIG_SND_BF5XX_SPORT_NUM == 0 50#if CONFIG_SND_BF5XX_SPORT_NUM == 0
53#define bfin_write_SPORT_TCR1 bfin_write_SPORT0_TCR1 51#define bfin_write_SPORT_TCR1 bfin_write_SPORT0_TCR1
@@ -147,21 +145,11 @@ static int bf5xx_probe(struct platform_device *pdev)
147 return 0; 145 return 0;
148} 146}
149 147
150static int bf5xx_ad73311_startup(struct snd_pcm_substream *substream)
151{
152 struct snd_soc_pcm_runtime *rtd = substream->private_data;
153 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
154
155 pr_debug("%s enter\n", __func__);
156 cpu_dai->private_data = sport_handle;
157 return 0;
158}
159
160static int bf5xx_ad73311_hw_params(struct snd_pcm_substream *substream, 148static int bf5xx_ad73311_hw_params(struct snd_pcm_substream *substream,
161 struct snd_pcm_hw_params *params) 149 struct snd_pcm_hw_params *params)
162{ 150{
163 struct snd_soc_pcm_runtime *rtd = substream->private_data; 151 struct snd_soc_pcm_runtime *rtd = substream->private_data;
164 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 152 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
165 int ret = 0; 153 int ret = 0;
166 154
167 pr_debug("%s rate %d format %x\n", __func__, params_rate(params), 155 pr_debug("%s rate %d format %x\n", __func__, params_rate(params),
@@ -178,31 +166,37 @@ static int bf5xx_ad73311_hw_params(struct snd_pcm_substream *substream,
178 166
179 167
180static struct snd_soc_ops bf5xx_ad73311_ops = { 168static struct snd_soc_ops bf5xx_ad73311_ops = {
181 .startup = bf5xx_ad73311_startup,
182 .hw_params = bf5xx_ad73311_hw_params, 169 .hw_params = bf5xx_ad73311_hw_params,
183}; 170};
184 171
185static struct snd_soc_dai_link bf5xx_ad73311_dai = { 172static struct snd_soc_dai_link bf5xx_ad73311_dai[] = {
186 .name = "ad73311", 173 {
187 .stream_name = "AD73311", 174 .name = "ad73311",
188 .cpu_dai = &bf5xx_i2s_dai, 175 .stream_name = "AD73311",
189 .codec_dai = &ad73311_dai, 176 .cpu_dai_name = "bfin-i2s.0",
190 .ops = &bf5xx_ad73311_ops, 177 .codec_dai_name = "ad73311-hifi",
178 .platform_name = "bfin-i2s-pcm-audio",
179 .codec_name = "ad73311",
180 .ops = &bf5xx_ad73311_ops,
181 },
182 {
183 .name = "ad73311",
184 .stream_name = "AD73311",
185 .cpu_dai_name = "bfin-i2s.1",
186 .codec_dai_name = "ad73311-hifi",
187 .platform_name = "bfin-i2s-pcm-audio",
188 .codec_name = "ad73311",
189 .ops = &bf5xx_ad73311_ops,
190 },
191}; 191};
192 192
193static struct snd_soc_card bf5xx_ad73311 = { 193static struct snd_soc_card bf5xx_ad73311 = {
194 .name = "bf5xx_ad73311", 194 .name = "bfin-ad73311",
195 .platform = &bf5xx_i2s_soc_platform,
196 .probe = bf5xx_probe, 195 .probe = bf5xx_probe,
197 .dai_link = &bf5xx_ad73311_dai, 196 .dai_link = &bf5xx_ad73311_dai[CONFIG_SND_BF5XX_SPORT_NUM],
198 .num_links = 1, 197 .num_links = 1,
199}; 198};
200 199
201static struct snd_soc_device bf5xx_ad73311_snd_devdata = {
202 .card = &bf5xx_ad73311,
203 .codec_dev = &soc_codec_dev_ad73311,
204};
205
206static struct platform_device *bf5xx_ad73311_snd_device; 200static struct platform_device *bf5xx_ad73311_snd_device;
207 201
208static int __init bf5xx_ad73311_init(void) 202static int __init bf5xx_ad73311_init(void)
@@ -214,8 +208,7 @@ static int __init bf5xx_ad73311_init(void)
214 if (!bf5xx_ad73311_snd_device) 208 if (!bf5xx_ad73311_snd_device)
215 return -ENOMEM; 209 return -ENOMEM;
216 210
217 platform_set_drvdata(bf5xx_ad73311_snd_device, &bf5xx_ad73311_snd_devdata); 211 platform_set_drvdata(bf5xx_ad73311_snd_device, &bf5xx_ad73311);
218 bf5xx_ad73311_snd_devdata.dev = &bf5xx_ad73311_snd_device->dev;
219 ret = platform_device_add(bf5xx_ad73311_snd_device); 212 ret = platform_device_add(bf5xx_ad73311_snd_device);
220 213
221 if (ret) 214 if (ret)