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