ASoC: fsi-ak4642: Remove ak4642_add_i2c_device
[safe/jmp/linux-2.6] / sound / soc / sh / fsi-ak4642.c
1 /*
2  * FSI-AK464x sound support for ms7724se
3  *
4  * Copyright (C) 2009 Renesas Solutions Corp.
5  * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6  *
7  * This file is subject to the terms and conditions of the GNU General Public
8  * License.  See the file "COPYING" in the main directory of this archive
9  * for more details.
10  */
11
12 #include <linux/module.h>
13 #include <linux/moduleparam.h>
14 #include <linux/platform_device.h>
15 #include <linux/i2c.h>
16 #include <linux/io.h>
17 #include <sound/core.h>
18 #include <sound/pcm.h>
19 #include <sound/soc.h>
20 #include <sound/soc-dapm.h>
21
22 #include <sound/sh_fsi.h>
23 #include <../sound/soc/codecs/ak4642.h>
24
25 static struct snd_soc_dai_link fsi_dai_link = {
26         .name           = "AK4642",
27         .stream_name    = "AK4642",
28         .cpu_dai        = &fsi_soc_dai[0], /* fsi */
29         .codec_dai      = &ak4642_dai,
30         .ops            = NULL,
31 };
32
33 static struct snd_soc_card fsi_soc_card  = {
34         .name           = "FSI",
35         .platform       = &fsi_soc_platform,
36         .dai_link       = &fsi_dai_link,
37         .num_links      = 1,
38 };
39
40 static struct snd_soc_device fsi_snd_devdata = {
41         .card           = &fsi_soc_card,
42         .codec_dev      = &soc_codec_dev_ak4642,
43 };
44
45 static struct platform_device *fsi_snd_device;
46
47 static int __init fsi_ak4642_init(void)
48 {
49         int ret = -ENOMEM;
50
51         fsi_snd_device = platform_device_alloc("soc-audio", -1);
52         if (!fsi_snd_device)
53                 goto out;
54
55         platform_set_drvdata(fsi_snd_device,
56                              &fsi_snd_devdata);
57         fsi_snd_devdata.dev = &fsi_snd_device->dev;
58         ret = platform_device_add(fsi_snd_device);
59
60         if (ret)
61                 platform_device_put(fsi_snd_device);
62
63 out:
64         return ret;
65 }
66
67 static void __exit fsi_ak4642_exit(void)
68 {
69         platform_device_unregister(fsi_snd_device);
70 }
71
72 module_init(fsi_ak4642_init);
73 module_exit(fsi_ak4642_exit);
74
75 MODULE_LICENSE("GPL");
76 MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
77 MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");