RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / sound / soc / sh / fsi-da7210.c
blob121bbb07bb03b7677280dcf7f8e9316c686de332
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/platform_device.h>
14 #include <sound/sh_fsi.h>
15 #include "../codecs/da7210.h"
17 static int fsi_da7210_init(struct snd_soc_codec *codec)
19 return snd_soc_dai_set_fmt(&da7210_dai,
20 SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
21 SND_SOC_DAIFMT_CBM_CFM);
24 static struct snd_soc_dai_link fsi_da7210_dai = {
25 .name = "DA7210",
26 .stream_name = "DA7210",
27 .cpu_dai = &fsi_soc_dai[FSI_PORT_B],
28 .codec_dai = &da7210_dai,
29 .init = fsi_da7210_init,
32 static struct snd_soc_card fsi_soc_card = {
33 .name = "FSI",
34 .platform = &fsi_soc_platform,
35 .dai_link = &fsi_da7210_dai,
36 .num_links = 1,
39 static struct snd_soc_device fsi_da7210_snd_devdata = {
40 .card = &fsi_soc_card,
41 .codec_dev = &soc_codec_dev_da7210,
44 static struct platform_device *fsi_da7210_snd_device;
46 static int __init fsi_da7210_sound_init(void)
48 int ret;
50 fsi_da7210_snd_device = platform_device_alloc("soc-audio", FSI_PORT_B);
51 if (!fsi_da7210_snd_device)
52 return -ENOMEM;
54 platform_set_drvdata(fsi_da7210_snd_device, &fsi_da7210_snd_devdata);
55 fsi_da7210_snd_devdata.dev = &fsi_da7210_snd_device->dev;
56 ret = platform_device_add(fsi_da7210_snd_device);
57 if (ret)
58 platform_device_put(fsi_da7210_snd_device);
60 return ret;
63 static void __exit fsi_da7210_sound_exit(void)
65 platform_device_unregister(fsi_da7210_snd_device);
68 module_init(fsi_da7210_sound_init);
69 module_exit(fsi_da7210_sound_exit);
71 /* Module information */
72 MODULE_DESCRIPTION("ALSA SoC FSI DA2710");
73 MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>");
74 MODULE_LICENSE("GPL");