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
= {
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
= {
34 .platform
= &fsi_soc_platform
,
35 .dai_link
= &fsi_da7210_dai
,
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)
50 fsi_da7210_snd_device
= platform_device_alloc("soc-audio", FSI_PORT_B
);
51 if (!fsi_da7210_snd_device
)
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
);
58 platform_device_put(fsi_da7210_snd_device
);
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");