diff options
Diffstat (limited to 'sound/soc/omap/omap3beagle.c')
-rw-r--r-- | sound/soc/omap/omap3beagle.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c index 240e0975dd6a..e56832b0c444 100644 --- a/sound/soc/omap/omap3beagle.c +++ b/sound/soc/omap/omap3beagle.c | |||
@@ -33,14 +33,13 @@ | |||
33 | 33 | ||
34 | #include "omap-mcbsp.h" | 34 | #include "omap-mcbsp.h" |
35 | #include "omap-pcm.h" | 35 | #include "omap-pcm.h" |
36 | #include "../codecs/twl4030.h" | ||
37 | 36 | ||
38 | static int omap3beagle_hw_params(struct snd_pcm_substream *substream, | 37 | static int omap3beagle_hw_params(struct snd_pcm_substream *substream, |
39 | struct snd_pcm_hw_params *params) | 38 | struct snd_pcm_hw_params *params) |
40 | { | 39 | { |
41 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 40 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
42 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 41 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
43 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 42 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
44 | unsigned int fmt; | 43 | unsigned int fmt; |
45 | int ret; | 44 | int ret; |
46 | 45 | ||
@@ -92,35 +91,29 @@ static struct snd_soc_ops omap3beagle_ops = { | |||
92 | static struct snd_soc_dai_link omap3beagle_dai = { | 91 | static struct snd_soc_dai_link omap3beagle_dai = { |
93 | .name = "TWL4030", | 92 | .name = "TWL4030", |
94 | .stream_name = "TWL4030", | 93 | .stream_name = "TWL4030", |
95 | .cpu_dai = &omap_mcbsp_dai[0], | 94 | .cpu_dai_name = "omap-mcbsp-dai.1", |
96 | .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI], | 95 | .platform_name = "omap-pcm-audio", |
96 | .codec_dai_name = "twl4030-hifi", | ||
97 | .codec_name = "twl4030-codec", | ||
97 | .ops = &omap3beagle_ops, | 98 | .ops = &omap3beagle_ops, |
98 | }; | 99 | }; |
99 | 100 | ||
100 | /* Audio machine driver */ | 101 | /* Audio machine driver */ |
101 | static struct snd_soc_card snd_soc_omap3beagle = { | 102 | static struct snd_soc_card snd_soc_omap3beagle = { |
102 | .name = "omap3beagle", | 103 | .name = "omap3beagle", |
103 | .platform = &omap_soc_platform, | 104 | .owner = THIS_MODULE, |
104 | .dai_link = &omap3beagle_dai, | 105 | .dai_link = &omap3beagle_dai, |
105 | .num_links = 1, | 106 | .num_links = 1, |
106 | }; | 107 | }; |
107 | 108 | ||
108 | /* Audio subsystem */ | ||
109 | static struct snd_soc_device omap3beagle_snd_devdata = { | ||
110 | .card = &snd_soc_omap3beagle, | ||
111 | .codec_dev = &soc_codec_dev_twl4030, | ||
112 | }; | ||
113 | |||
114 | static struct platform_device *omap3beagle_snd_device; | 109 | static struct platform_device *omap3beagle_snd_device; |
115 | 110 | ||
116 | static int __init omap3beagle_soc_init(void) | 111 | static int __init omap3beagle_soc_init(void) |
117 | { | 112 | { |
118 | int ret; | 113 | int ret; |
119 | 114 | ||
120 | if (!(machine_is_omap3_beagle() || machine_is_devkit8000())) { | 115 | if (!(machine_is_omap3_beagle() || machine_is_devkit8000())) |
121 | pr_debug("Not OMAP3 Beagle or Devkit8000!\n"); | ||
122 | return -ENODEV; | 116 | return -ENODEV; |
123 | } | ||
124 | pr_info("OMAP3 Beagle/Devkit8000 SoC init\n"); | 117 | pr_info("OMAP3 Beagle/Devkit8000 SoC init\n"); |
125 | 118 | ||
126 | omap3beagle_snd_device = platform_device_alloc("soc-audio", -1); | 119 | omap3beagle_snd_device = platform_device_alloc("soc-audio", -1); |
@@ -129,9 +122,7 @@ static int __init omap3beagle_soc_init(void) | |||
129 | return -ENOMEM; | 122 | return -ENOMEM; |
130 | } | 123 | } |
131 | 124 | ||
132 | platform_set_drvdata(omap3beagle_snd_device, &omap3beagle_snd_devdata); | 125 | platform_set_drvdata(omap3beagle_snd_device, &snd_soc_omap3beagle); |
133 | omap3beagle_snd_devdata.dev = &omap3beagle_snd_device->dev; | ||
134 | *(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */ | ||
135 | 126 | ||
136 | ret = platform_device_add(omap3beagle_snd_device); | 127 | ret = platform_device_add(omap3beagle_snd_device); |
137 | if (ret) | 128 | if (ret) |