writeback: split writeback_inodes_wb
[linux-2.6/next.git] / sound / soc / sh / fsi-da7210.c
blob33b4d177f46616f10278e6a9cf448f1d9e21ed06
1 /*
2 * fsi-da7210.c
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #include <linux/interrupt.h>
14 #include <linux/platform_device.h>
15 #include <linux/io.h>
16 #include <linux/i2c.h>
17 #include <sound/core.h>
18 #include <sound/pcm.h>
19 #include <sound/pcm_params.h>
20 #include <sound/soc.h>
21 #include <sound/soc-dapm.h>
23 #include <sound/sh_fsi.h>
24 #include "../codecs/da7210.h"
26 static int fsi_da7210_init(struct snd_soc_codec *codec)
28 return snd_soc_dai_set_fmt(&da7210_dai,
29 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
30 SND_SOC_DAIFMT_CBM_CFM);
33 static struct snd_soc_dai_link fsi_da7210_dai = {
34 .name = "DA7210",
35 .stream_name = "DA7210",
36 .cpu_dai = &fsi_soc_dai[1], /* FSI B */
37 .codec_dai = &da7210_dai,
38 .init = fsi_da7210_init,
41 static struct snd_soc_card fsi_soc_card = {
42 .name = "FSI",
43 .platform = &fsi_soc_platform,
44 .dai_link = &fsi_da7210_dai,
45 .num_links = 1,
48 static struct snd_soc_device fsi_da7210_snd_devdata = {
49 .card = &fsi_soc_card,
50 .codec_dev = &soc_codec_dev_da7210,
53 static struct platform_device *fsi_da7210_snd_device;
55 static int __init fsi_da7210_sound_init(void)
57 int ret;
59 fsi_da7210_snd_device = platform_device_alloc("soc-audio", -1);
60 if (!fsi_da7210_snd_device)
61 return -ENOMEM;
63 platform_set_drvdata(fsi_da7210_snd_device, &fsi_da7210_snd_devdata);
64 fsi_da7210_snd_devdata.dev = &fsi_da7210_snd_device->dev;
65 ret = platform_device_add(fsi_da7210_snd_device);
66 if (ret)
67 platform_device_put(fsi_da7210_snd_device);
69 return ret;
72 static void __exit fsi_da7210_sound_exit(void)
74 platform_device_unregister(fsi_da7210_snd_device);
77 module_init(fsi_da7210_sound_init);
78 module_exit(fsi_da7210_sound_exit);
80 /* Module information */
81 MODULE_DESCRIPTION("ALSA SoC FSI DA2710");
82 MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");
83 MODULE_LICENSE("GPL");