writeback: split writeback_inodes_wb
[linux-2.6/next.git] / sound / soc / sh / fsi-ak4642.c
blobbe018542314e6d340e1285ad6851ef58f30bbd55
1 /*
2 * FSI-AK464x sound support for ms7724se
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
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.
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>
22 #include <sound/sh_fsi.h>
23 #include <../sound/soc/codecs/ak4642.h>
25 static int fsi_ak4642_dai_init(struct snd_soc_codec *codec)
27 int ret;
29 ret = snd_soc_dai_set_fmt(&ak4642_dai, SND_SOC_DAIFMT_CBM_CFM);
30 if (ret < 0)
31 return ret;
33 ret = snd_soc_dai_set_sysclk(&ak4642_dai, 0, 11289600, 0);
35 return ret;
38 static struct snd_soc_dai_link fsi_dai_link = {
39 .name = "AK4642",
40 .stream_name = "AK4642",
41 .cpu_dai = &fsi_soc_dai[0], /* fsi */
42 .codec_dai = &ak4642_dai,
43 .init = fsi_ak4642_dai_init,
44 .ops = NULL,
47 static struct snd_soc_card fsi_soc_card = {
48 .name = "FSI",
49 .platform = &fsi_soc_platform,
50 .dai_link = &fsi_dai_link,
51 .num_links = 1,
54 static struct snd_soc_device fsi_snd_devdata = {
55 .card = &fsi_soc_card,
56 .codec_dev = &soc_codec_dev_ak4642,
59 static struct platform_device *fsi_snd_device;
61 static int __init fsi_ak4642_init(void)
63 int ret = -ENOMEM;
65 fsi_snd_device = platform_device_alloc("soc-audio", -1);
66 if (!fsi_snd_device)
67 goto out;
69 platform_set_drvdata(fsi_snd_device,
70 &fsi_snd_devdata);
71 fsi_snd_devdata.dev = &fsi_snd_device->dev;
72 ret = platform_device_add(fsi_snd_device);
74 if (ret)
75 platform_device_put(fsi_snd_device);
77 out:
78 return ret;
81 static void __exit fsi_ak4642_exit(void)
83 platform_device_unregister(fsi_snd_device);
86 module_init(fsi_ak4642_init);
87 module_exit(fsi_ak4642_exit);
89 MODULE_LICENSE("GPL");
90 MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card");
91 MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");