aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ad1836.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ad1836.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ad1836.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad1836.c b/sound/soc/blackfin/bf5xx-ad1836.c
index 0f45a3f56be8..f79d1655e035 100644
--- a/sound/soc/blackfin/bf5xx-ad1836.c
+++ b/sound/soc/blackfin/bf5xx-ad1836.c
@@ -20,7 +20,6 @@
20#include <sound/core.h> 20#include <sound/core.h>
21#include <sound/pcm.h> 21#include <sound/pcm.h>
22#include <sound/soc.h> 22#include <sound/soc.h>
23#include <sound/soc-dapm.h>
24#include <sound/pcm_params.h> 23#include <sound/pcm_params.h>
25 24
26#include <asm/blackfin.h> 25#include <asm/blackfin.h>
@@ -30,28 +29,18 @@
30#include <asm/portmux.h> 29#include <asm/portmux.h>
31 30
32#include "../codecs/ad1836.h" 31#include "../codecs/ad1836.h"
33#include "bf5xx-sport.h"
34 32
35#include "bf5xx-tdm-pcm.h" 33#include "bf5xx-tdm-pcm.h"
36#include "bf5xx-tdm.h" 34#include "bf5xx-tdm.h"
37 35
38static struct snd_soc_card bf5xx_ad1836; 36static struct snd_soc_card bf5xx_ad1836;
39 37
40static int bf5xx_ad1836_startup(struct snd_pcm_substream *substream)
41{
42 struct snd_soc_pcm_runtime *rtd = substream->private_data;
43 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
44
45 cpu_dai->private_data = sport_handle;
46 return 0;
47}
48
49static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream, 38static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream,
50 struct snd_pcm_hw_params *params) 39 struct snd_pcm_hw_params *params)
51{ 40{
52 struct snd_soc_pcm_runtime *rtd = substream->private_data; 41 struct snd_soc_pcm_runtime *rtd = substream->private_data;
53 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 42 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
54 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 43 struct snd_soc_dai *codec_dai = rtd->codec_dai;
55 unsigned int channel_map[] = {0, 4, 1, 5, 2, 6, 3, 7}; 44 unsigned int channel_map[] = {0, 4, 1, 5, 2, 6, 3, 7};
56 int ret = 0; 45 int ret = 0;
57 /* set cpu DAI configuration */ 46 /* set cpu DAI configuration */
@@ -76,30 +65,36 @@ static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream,
76} 65}
77 66
78static struct snd_soc_ops bf5xx_ad1836_ops = { 67static struct snd_soc_ops bf5xx_ad1836_ops = {
79 .startup = bf5xx_ad1836_startup,
80 .hw_params = bf5xx_ad1836_hw_params, 68 .hw_params = bf5xx_ad1836_hw_params,
81}; 69};
82 70
83static struct snd_soc_dai_link bf5xx_ad1836_dai = { 71static struct snd_soc_dai_link bf5xx_ad1836_dai[] = {
84 .name = "ad1836", 72 {
85 .stream_name = "AD1836", 73 .name = "ad1836",
86 .cpu_dai = &bf5xx_tdm_dai, 74 .stream_name = "AD1836",
87 .codec_dai = &ad1836_dai, 75 .cpu_dai_name = "bfin-tdm.0",
88 .ops = &bf5xx_ad1836_ops, 76 .codec_dai_name = "ad1836-hifi",
77 .platform_name = "bfin-tdm-pcm-audio",
78 .codec_name = "spi0.4",
79 .ops = &bf5xx_ad1836_ops,
80 },
81 {
82 .name = "ad1836",
83 .stream_name = "AD1836",
84 .cpu_dai_name = "bfin-tdm.1",
85 .codec_dai_name = "ad1836-hifi",
86 .platform_name = "bfin-tdm-pcm-audio",
87 .codec_name = "spi0.4",
88 .ops = &bf5xx_ad1836_ops,
89 },
89}; 90};
90 91
91static struct snd_soc_card bf5xx_ad1836 = { 92static struct snd_soc_card bf5xx_ad1836 = {
92 .name = "bf5xx_ad1836", 93 .name = "bfin-ad1836",
93 .platform = &bf5xx_tdm_soc_platform, 94 .dai_link = &bf5xx_ad1836_dai[CONFIG_SND_BF5XX_SPORT_NUM],
94 .dai_link = &bf5xx_ad1836_dai,
95 .num_links = 1, 95 .num_links = 1,
96}; 96};
97 97
98static struct snd_soc_device bf5xx_ad1836_snd_devdata = {
99 .card = &bf5xx_ad1836,
100 .codec_dev = &soc_codec_dev_ad1836,
101};
102
103static struct platform_device *bfxx_ad1836_snd_device; 98static struct platform_device *bfxx_ad1836_snd_device;
104 99
105static int __init bf5xx_ad1836_init(void) 100static int __init bf5xx_ad1836_init(void)
@@ -110,8 +105,7 @@ static int __init bf5xx_ad1836_init(void)
110 if (!bfxx_ad1836_snd_device) 105 if (!bfxx_ad1836_snd_device)
111 return -ENOMEM; 106 return -ENOMEM;
112 107
113 platform_set_drvdata(bfxx_ad1836_snd_device, &bf5xx_ad1836_snd_devdata); 108 platform_set_drvdata(bfxx_ad1836_snd_device, &bf5xx_ad1836);
114 bf5xx_ad1836_snd_devdata.dev = &bfxx_ad1836_snd_device->dev;
115 ret = platform_device_add(bfxx_ad1836_snd_device); 109 ret = platform_device_add(bfxx_ad1836_snd_device);
116 110
117 if (ret) 111 if (ret)