blob: 7761827314b2528d8d8ec3d7c3c33aef7862a1d4 [file] [log] [blame]
Graeme Gregory74930bb2007-05-14 11:03:52 +02001/*
2 * neo1973_wm8753.c -- SoC audio for Neo1973
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC.
5 * Author: Graeme Gregory
6 * graeme.gregory@wolfsonmicro.com or linux@wolfsonmicro.com
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
Graeme Gregory74930bb2007-05-14 11:03:52 +020013 */
14
15#include <linux/module.h>
16#include <linux/moduleparam.h>
17#include <linux/timer.h>
18#include <linux/interrupt.h>
19#include <linux/platform_device.h>
Graeme Gregory74930bb2007-05-14 11:03:52 +020020#include <sound/core.h>
21#include <sound/pcm.h>
22#include <sound/soc.h>
Graeme Gregory74930bb2007-05-14 11:03:52 +020023
Mark Brownfb2aa072008-10-08 13:02:20 +010024#include <asm/mach-types.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010025#include <mach/regs-clock.h>
26#include <mach/regs-gpio.h>
27#include <mach/hardware.h>
Graeme Gregory8ba02ac2008-04-30 20:24:54 +020028#include <linux/io.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010029#include <mach/spi-gpio.h>
Harald Welteaa9673c2007-12-19 15:37:49 +010030
Ben Dooks8150bc82009-03-04 00:49:26 +000031#include <plat/regs-iis.h>
Harald Welteaa9673c2007-12-19 15:37:49 +010032
Graeme Gregory74930bb2007-05-14 11:03:52 +020033#include "../codecs/wm8753.h"
Jassi Brar4b640cf2010-11-22 15:35:57 +090034#include "dma.h"
Graeme Gregory74930bb2007-05-14 11:03:52 +020035#include "s3c24xx-i2s.h"
36
Mark Brown87506542008-11-18 20:50:34 +000037static struct snd_soc_card neo1973;
Graeme Gregory74930bb2007-05-14 11:03:52 +020038
39static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
40 struct snd_pcm_hw_params *params)
41{
42 struct snd_soc_pcm_runtime *rtd = substream->private_data;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000043 struct snd_soc_dai *codec_dai = rtd->codec_dai;
44 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
Graeme Gregory74930bb2007-05-14 11:03:52 +020045 unsigned int pll_out = 0, bclk = 0;
46 int ret = 0;
47 unsigned long iis_clkrate;
48
Mark Brownee7d4762009-03-06 18:04:34 +000049 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +020050
Graeme Gregory74930bb2007-05-14 11:03:52 +020051 iis_clkrate = s3c24xx_i2s_get_clockrate();
52
53 switch (params_rate(params)) {
54 case 8000:
55 case 16000:
56 pll_out = 12288000;
57 break;
58 case 48000:
59 bclk = WM8753_BCLK_DIV_4;
60 pll_out = 12288000;
61 break;
62 case 96000:
63 bclk = WM8753_BCLK_DIV_2;
64 pll_out = 12288000;
65 break;
66 case 11025:
67 bclk = WM8753_BCLK_DIV_16;
68 pll_out = 11289600;
69 break;
70 case 22050:
71 bclk = WM8753_BCLK_DIV_8;
72 pll_out = 11289600;
73 break;
74 case 44100:
75 bclk = WM8753_BCLK_DIV_4;
76 pll_out = 11289600;
77 break;
78 case 88200:
79 bclk = WM8753_BCLK_DIV_2;
80 pll_out = 11289600;
81 break;
82 }
83
84 /* set codec DAI configuration */
Liam Girdwood64105cf2008-07-08 13:19:18 +010085 ret = snd_soc_dai_set_fmt(codec_dai,
Graeme Gregory74930bb2007-05-14 11:03:52 +020086 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
87 SND_SOC_DAIFMT_CBM_CFM);
88 if (ret < 0)
89 return ret;
90
91 /* set cpu DAI configuration */
Liam Girdwood64105cf2008-07-08 13:19:18 +010092 ret = snd_soc_dai_set_fmt(cpu_dai,
Graeme Gregory74930bb2007-05-14 11:03:52 +020093 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
94 SND_SOC_DAIFMT_CBM_CFM);
95 if (ret < 0)
96 return ret;
97
98 /* set the codec system clock for DAC and ADC */
Liam Girdwood64105cf2008-07-08 13:19:18 +010099 ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_MCLK, pll_out,
Graeme Gregory74930bb2007-05-14 11:03:52 +0200100 SND_SOC_CLOCK_IN);
101 if (ret < 0)
102 return ret;
103
104 /* set MCLK division for sample rate */
Liam Girdwood64105cf2008-07-08 13:19:18 +0100105 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK,
Graeme Gregory8ba02ac2008-04-30 20:24:54 +0200106 S3C2410_IISMOD_32FS);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200107 if (ret < 0)
108 return ret;
109
110 /* set codec BCLK division for sample rate */
Liam Girdwood64105cf2008-07-08 13:19:18 +0100111 ret = snd_soc_dai_set_clkdiv(codec_dai, WM8753_BCLKDIV, bclk);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200112 if (ret < 0)
113 return ret;
114
115 /* set prescaler division for sample rate */
Liam Girdwood64105cf2008-07-08 13:19:18 +0100116 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,
Graeme Gregory8ba02ac2008-04-30 20:24:54 +0200117 S3C24XX_PRESCALE(4, 4));
Graeme Gregory74930bb2007-05-14 11:03:52 +0200118 if (ret < 0)
119 return ret;
120
121 /* codec PLL input is PCLK/4 */
Mark Brown85488032009-09-05 18:52:16 +0100122 ret = snd_soc_dai_set_pll(codec_dai, WM8753_PLL1, 0,
Graeme Gregory74930bb2007-05-14 11:03:52 +0200123 iis_clkrate / 4, pll_out);
124 if (ret < 0)
125 return ret;
126
127 return 0;
128}
129
130static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
131{
132 struct snd_soc_pcm_runtime *rtd = substream->private_data;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000133 struct snd_soc_dai *codec_dai = rtd->codec_dai;
Graeme Gregory74930bb2007-05-14 11:03:52 +0200134
Mark Brownee7d4762009-03-06 18:04:34 +0000135 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +0200136
Graeme Gregory74930bb2007-05-14 11:03:52 +0200137 /* disable the PLL */
Takashi Iwai140318a2009-10-01 08:40:32 +0200138 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL1, 0, 0, 0);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200139}
140
141/*
142 * Neo1973 WM8753 HiFi DAI opserations.
143 */
144static struct snd_soc_ops neo1973_hifi_ops = {
145 .hw_params = neo1973_hifi_hw_params,
146 .hw_free = neo1973_hifi_hw_free,
147};
148
149static int neo1973_voice_hw_params(struct snd_pcm_substream *substream,
150 struct snd_pcm_hw_params *params)
151{
152 struct snd_soc_pcm_runtime *rtd = substream->private_data;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000153 struct snd_soc_dai *codec_dai = rtd->codec_dai;
Graeme Gregory74930bb2007-05-14 11:03:52 +0200154 unsigned int pcmdiv = 0;
155 int ret = 0;
156 unsigned long iis_clkrate;
157
Mark Brownee7d4762009-03-06 18:04:34 +0000158 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +0200159
Graeme Gregory74930bb2007-05-14 11:03:52 +0200160 iis_clkrate = s3c24xx_i2s_get_clockrate();
161
162 if (params_rate(params) != 8000)
163 return -EINVAL;
164 if (params_channels(params) != 1)
165 return -EINVAL;
166
167 pcmdiv = WM8753_PCM_DIV_6; /* 2.048 MHz */
168
169 /* todo: gg check mode (DSP_B) against CSR datasheet */
170 /* set codec DAI configuration */
Liam Girdwood64105cf2008-07-08 13:19:18 +0100171 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B |
Graeme Gregory74930bb2007-05-14 11:03:52 +0200172 SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
173 if (ret < 0)
174 return ret;
175
176 /* set the codec system clock for DAC and ADC */
Liam Girdwood64105cf2008-07-08 13:19:18 +0100177 ret = snd_soc_dai_set_sysclk(codec_dai, WM8753_PCMCLK, 12288000,
Graeme Gregory74930bb2007-05-14 11:03:52 +0200178 SND_SOC_CLOCK_IN);
179 if (ret < 0)
180 return ret;
181
182 /* set codec PCM division for sample rate */
Liam Girdwood64105cf2008-07-08 13:19:18 +0100183 ret = snd_soc_dai_set_clkdiv(codec_dai, WM8753_PCMDIV, pcmdiv);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200184 if (ret < 0)
185 return ret;
186
Andrea Gelminifa2eb002010-10-16 15:19:20 +0200187 /* configure and enable PLL for 12.288MHz output */
Takashi Iwai140318a2009-10-01 08:40:32 +0200188 ret = snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0,
Graeme Gregory74930bb2007-05-14 11:03:52 +0200189 iis_clkrate / 4, 12288000);
190 if (ret < 0)
191 return ret;
192
193 return 0;
194}
195
196static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
197{
198 struct snd_soc_pcm_runtime *rtd = substream->private_data;
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000199 struct snd_soc_dai *codec_dai = rtd->codec_dai;
Graeme Gregory74930bb2007-05-14 11:03:52 +0200200
Mark Brownee7d4762009-03-06 18:04:34 +0000201 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +0200202
Graeme Gregory74930bb2007-05-14 11:03:52 +0200203 /* disable the PLL */
Takashi Iwai140318a2009-10-01 08:40:32 +0200204 return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0, 0);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200205}
206
207static struct snd_soc_ops neo1973_voice_ops = {
208 .hw_params = neo1973_voice_hw_params,
209 .hw_free = neo1973_voice_hw_free,
210};
211
Graeme Gregory74930bb2007-05-14 11:03:52 +0200212static const struct snd_soc_dapm_widget wm8753_dapm_widgets[] = {
Graeme Gregory74930bb2007-05-14 11:03:52 +0200213 SND_SOC_DAPM_LINE("GSM Line Out", NULL),
214 SND_SOC_DAPM_LINE("GSM Line In", NULL),
215 SND_SOC_DAPM_MIC("Headset Mic", NULL),
216 SND_SOC_DAPM_MIC("Call Mic", NULL),
217};
218
219
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100220static const struct snd_soc_dapm_route neo1973_wm8753_routes[] = {
Graeme Gregory74930bb2007-05-14 11:03:52 +0200221 /* Connections to the GSM Module */
222 {"GSM Line Out", NULL, "MONO1"},
223 {"GSM Line Out", NULL, "MONO2"},
224 {"RXP", NULL, "GSM Line In"},
225 {"RXN", NULL, "GSM Line In"},
226
227 /* Connections to Headset */
228 {"MIC1", NULL, "Mic Bias"},
229 {"Mic Bias", NULL, "Headset Mic"},
230
231 /* Call Mic */
232 {"MIC2", NULL, "Mic Bias"},
233 {"MIC2N", NULL, "Mic Bias"},
234 {"Mic Bias", NULL, "Call Mic"},
235
236 /* Connect the ALC pins */
237 {"ACIN", NULL, "ACOP"},
Graeme Gregory74930bb2007-05-14 11:03:52 +0200238};
239
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100240static const struct snd_kcontrol_new neo1973_wm8753_controls[] = {
Lars-Peter Clausen004c52e2011-03-07 08:04:54 +0100241 SOC_DAPM_PIN_SWITCH("GSM Line Out"),
242 SOC_DAPM_PIN_SWITCH("GSM Line In"),
243 SOC_DAPM_PIN_SWITCH("Headset Mic"),
244 SOC_DAPM_PIN_SWITCH("Call Mic"),
Graeme Gregory74930bb2007-05-14 11:03:52 +0200245};
246
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100247
Graeme Gregory74930bb2007-05-14 11:03:52 +0200248/*
249 * This is an example machine initialisation for a wm8753 connected to a
250 * neo1973 II. It is missing logic to detect hp/mic insertions and logic
251 * to re-route the audio in such an event.
252 */
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000253static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd)
Graeme Gregory74930bb2007-05-14 11:03:52 +0200254{
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000255 struct snd_soc_codec *codec = rtd->codec;
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200256 struct snd_soc_dapm_context *dapm = &codec->dapm;
Philipp Zabeleb5f6d752009-03-12 11:07:54 +0100257 int err;
Graeme Gregory74930bb2007-05-14 11:03:52 +0200258
Mark Brownee7d4762009-03-06 18:04:34 +0000259 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +0200260
Graeme Gregory74930bb2007-05-14 11:03:52 +0200261 /* set up NC codec pins */
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200262 snd_soc_dapm_nc_pin(dapm, "LOUT2");
263 snd_soc_dapm_nc_pin(dapm, "ROUT2");
264 snd_soc_dapm_nc_pin(dapm, "OUT3");
265 snd_soc_dapm_nc_pin(dapm, "OUT4");
266 snd_soc_dapm_nc_pin(dapm, "LINE1");
267 snd_soc_dapm_nc_pin(dapm, "LINE2");
Graeme Gregory74930bb2007-05-14 11:03:52 +0200268
Graeme Gregory74930bb2007-05-14 11:03:52 +0200269 /* Add neo1973 specific widgets */
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200270 snd_soc_dapm_new_controls(dapm, wm8753_dapm_widgets,
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100271 ARRAY_SIZE(wm8753_dapm_widgets));
Graeme Gregory74930bb2007-05-14 11:03:52 +0200272
Jonas Bonne8089942008-10-01 18:17:12 +0100273 /* set endpoints to default mode */
Lars-Peter Clausen004c52e2011-03-07 08:04:54 +0100274 snd_soc_dapm_disable_pin(dapm, "GSM Line Out");
275 snd_soc_dapm_disable_pin(dapm, "GSM Line In");
276 snd_soc_dapm_disable_pin(dapm, "Headset Mic");
277 snd_soc_dapm_disable_pin(dapm, "Call Mic");
Jonas Bonne8089942008-10-01 18:17:12 +0100278
Graeme Gregory74930bb2007-05-14 11:03:52 +0200279 /* add neo1973 specific controls */
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100280 err = snd_soc_add_controls(codec, neo1973_wm8753_controls,
281 ARRAY_SIZE(neo1973_wm8753_controls));
Philipp Zabeleb5f6d752009-03-12 11:07:54 +0100282 if (err < 0)
283 return err;
Graeme Gregory74930bb2007-05-14 11:03:52 +0200284
Mark Brown8f3112d2008-05-13 14:58:03 +0200285 /* set up neo1973 specific audio routes */
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100286 err = snd_soc_dapm_add_routes(dapm, neo1973_wm8753_routes,
287 ARRAY_SIZE(neo1973_wm8753_routes));
Graeme Gregory74930bb2007-05-14 11:03:52 +0200288
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200289 snd_soc_dapm_sync(dapm);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200290 return 0;
291}
292
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100293static const struct snd_soc_dapm_route neo1973_lm4857_routes[] = {
294 {"Amp IN", NULL, "ROUT1"},
295 {"Amp IN", NULL, "LOUT1"},
296
297 {"Handset Spk", NULL, "Amp EP"},
298 {"Stereo Out", NULL, "Amp LS"},
299 {"Headphone", NULL, "Amp HP"},
300};
301
302static const struct snd_soc_dapm_widget neo1973_lm4857_dapm_widgets[] = {
303 SND_SOC_DAPM_SPK("Handset Spk", NULL),
304 SND_SOC_DAPM_SPK("Stereo Out", NULL),
305 SND_SOC_DAPM_HP("Headphone", NULL),
306};
307
308static int neo1973_lm4857_init(struct snd_soc_dapm_context *dapm)
309{
310 int ret;
311
312 ret = snd_soc_dapm_new_controls(dapm, neo1973_lm4857_dapm_widgets,
313 ARRAY_SIZE(neo1973_lm4857_dapm_widgets));
314 if (ret)
315 return ret;
316
317 ret = snd_soc_dapm_add_routes(dapm, neo1973_lm4857_routes,
318 ARRAY_SIZE(neo1973_lm4857_routes));
319 if (ret)
320 return ret;
321
322 snd_soc_dapm_ignore_suspend(dapm, "Stereo Out");
323 snd_soc_dapm_ignore_suspend(dapm, "Handset Spk");
324 snd_soc_dapm_ignore_suspend(dapm, "Headphone");
325
326 snd_soc_dapm_sync(dapm);
327
328 return 0;
329}
330
Graeme Gregory74930bb2007-05-14 11:03:52 +0200331/*
332 * BT Codec DAI
333 */
Liam Girdwood1992a6f2008-07-07 16:08:24 +0100334static struct snd_soc_dai bt_dai = {
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000335 .name = "bluetooth-dai",
Graeme Gregory74930bb2007-05-14 11:03:52 +0200336 .playback = {
337 .channels_min = 1,
338 .channels_max = 1,
339 .rates = SNDRV_PCM_RATE_8000,
340 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
341 .capture = {
342 .channels_min = 1,
343 .channels_max = 1,
344 .rates = SNDRV_PCM_RATE_8000,
345 .formats = SNDRV_PCM_FMTBIT_S16_LE,},
346};
347
348static struct snd_soc_dai_link neo1973_dai[] = {
349{ /* Hifi Playback - for similatious use with voice below */
350 .name = "WM8753",
351 .stream_name = "WM8753 HiFi",
Jassi Brar58bb4072010-11-22 15:35:50 +0900352 .platform_name = "samsung-audio",
Lars-Peter Clausen518aa592011-01-24 22:12:42 +0100353 .cpu_dai_name = "s3c24xx-iis",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000354 .codec_dai_name = "wm8753-hifi",
Lars-Peter Clausen81d7da52011-01-24 22:09:22 +0100355 .codec_name = "wm8753-codec.0-001a",
Graeme Gregory74930bb2007-05-14 11:03:52 +0200356 .init = neo1973_wm8753_init,
357 .ops = &neo1973_hifi_ops,
358},
359{ /* Voice via BT */
360 .name = "Bluetooth",
361 .stream_name = "Voice",
Jassi Brar58bb4072010-11-22 15:35:50 +0900362 .platform_name = "samsung-audio",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000363 .cpu_dai_name = "bluetooth-dai",
364 .codec_dai_name = "wm8753-voice",
Lars-Peter Clausen81d7da52011-01-24 22:09:22 +0100365 .codec_name = "wm8753-codec.0-001a",
Graeme Gregory74930bb2007-05-14 11:03:52 +0200366 .ops = &neo1973_voice_ops,
367},
368};
369
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100370static struct snd_soc_aux_dev neo1973_aux_devs[] = {
371 {
372 .name = "lm4857",
373 .codec_name = "lm4857.0-007c",
374 .init = neo1973_lm4857_init,
375 },
376};
377
378static struct snd_soc_codec_conf neo1973_codec_conf[] = {
379 {
380 .dev_name = "lm4857.0-007c",
381 .name_prefix = "Amp",
382 },
383};
384
Mark Brown87506542008-11-18 20:50:34 +0000385static struct snd_soc_card neo1973 = {
Graeme Gregory74930bb2007-05-14 11:03:52 +0200386 .name = "neo1973",
387 .dai_link = neo1973_dai,
388 .num_links = ARRAY_SIZE(neo1973_dai),
Lars-Peter Clausen9b0a25f2011-03-07 08:04:55 +0100389 .aux_dev = neo1973_aux_devs,
390 .num_aux_devs = ARRAY_SIZE(neo1973_aux_devs),
391 .codec_conf = neo1973_codec_conf,
392 .num_configs = ARRAY_SIZE(neo1973_codec_conf),
Graeme Gregory74930bb2007-05-14 11:03:52 +0200393};
394
395static struct platform_device *neo1973_snd_device;
396
397static int __init neo1973_init(void)
398{
399 int ret;
400
Mark Brownee7d4762009-03-06 18:04:34 +0000401 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +0200402
Mark Brownfb2aa072008-10-08 13:02:20 +0100403 if (!machine_is_neo1973_gta01()) {
404 printk(KERN_INFO
405 "Only GTA01 hardware supported by ASoC driver\n");
406 return -ENODEV;
407 }
408
Graeme Gregory74930bb2007-05-14 11:03:52 +0200409 neo1973_snd_device = platform_device_alloc("soc-audio", -1);
410 if (!neo1973_snd_device)
411 return -ENOMEM;
412
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000413 platform_set_drvdata(neo1973_snd_device, &neo1973);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200414 ret = platform_device_add(neo1973_snd_device);
415
Jean Delvared2802892008-09-01 17:44:05 +0200416 if (ret) {
Graeme Gregory74930bb2007-05-14 11:03:52 +0200417 platform_device_put(neo1973_snd_device);
Jean Delvared2802892008-09-01 17:44:05 +0200418 return ret;
419 }
Graeme Gregory74930bb2007-05-14 11:03:52 +0200420
Jean Delvareb6471302008-09-01 17:46:57 +0200421 if (ret != 0)
Jean Delvared2802892008-09-01 17:44:05 +0200422 platform_device_unregister(neo1973_snd_device);
Graeme Gregory74930bb2007-05-14 11:03:52 +0200423
424 return ret;
425}
426
427static void __exit neo1973_exit(void)
428{
Mark Brownee7d4762009-03-06 18:04:34 +0000429 pr_debug("Entered %s\n", __func__);
Tim Niemeyer1894c592008-05-05 14:16:12 +0200430
Graeme Gregory74930bb2007-05-14 11:03:52 +0200431 platform_device_unregister(neo1973_snd_device);
432}
433
434module_init(neo1973_init);
435module_exit(neo1973_exit);
436
437/* Module information */
Graeme Gregory443590e2008-04-30 20:25:23 +0200438MODULE_AUTHOR("Graeme Gregory, graeme@openmoko.org, www.openmoko.org");
Graeme Gregory74930bb2007-05-14 11:03:52 +0200439MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973");
440MODULE_LICENSE("GPL");