diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /sound/soc/sh/fsi-da7210.c | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'sound/soc/sh/fsi-da7210.c')
-rw-r--r-- | sound/soc/sh/fsi-da7210.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/sound/soc/sh/fsi-da7210.c b/sound/soc/sh/fsi-da7210.c new file mode 100644 index 00000000000..59553fd8c2f --- /dev/null +++ b/sound/soc/sh/fsi-da7210.c | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * fsi-da7210.c | ||
3 | * | ||
4 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
5 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | ||
6 | * | ||
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. | ||
11 | */ | ||
12 | |||
13 | #include <linux/platform_device.h> | ||
14 | #include <sound/sh_fsi.h> | ||
15 | |||
16 | static int fsi_da7210_init(struct snd_soc_pcm_runtime *rtd) | ||
17 | { | ||
18 | struct snd_soc_dai *codec = rtd->codec_dai; | ||
19 | struct snd_soc_dai *cpu = rtd->cpu_dai; | ||
20 | int ret; | ||
21 | |||
22 | ret = snd_soc_dai_set_fmt(codec, | ||
23 | SND_SOC_DAIFMT_I2S | | ||
24 | SND_SOC_DAIFMT_CBM_CFM); | ||
25 | if (ret < 0) | ||
26 | return ret; | ||
27 | |||
28 | ret = snd_soc_dai_set_fmt(cpu, SND_SOC_DAIFMT_I2S | | ||
29 | SND_SOC_DAIFMT_CBS_CFS); | ||
30 | |||
31 | return ret; | ||
32 | } | ||
33 | |||
34 | static struct snd_soc_dai_link fsi_da7210_dai = { | ||
35 | .name = "DA7210", | ||
36 | .stream_name = "DA7210", | ||
37 | .cpu_dai_name = "fsib-dai", /* FSI B */ | ||
38 | .codec_dai_name = "da7210-hifi", | ||
39 | .platform_name = "sh_fsi.0", | ||
40 | .codec_name = "da7210-codec.0-001a", | ||
41 | .init = fsi_da7210_init, | ||
42 | }; | ||
43 | |||
44 | static struct snd_soc_card fsi_soc_card = { | ||
45 | .name = "FSI-DA7210", | ||
46 | .dai_link = &fsi_da7210_dai, | ||
47 | .num_links = 1, | ||
48 | }; | ||
49 | |||
50 | static struct platform_device *fsi_da7210_snd_device; | ||
51 | |||
52 | static int __init fsi_da7210_sound_init(void) | ||
53 | { | ||
54 | int ret; | ||
55 | |||
56 | fsi_da7210_snd_device = platform_device_alloc("soc-audio", FSI_PORT_B); | ||
57 | if (!fsi_da7210_snd_device) | ||
58 | return -ENOMEM; | ||
59 | |||
60 | platform_set_drvdata(fsi_da7210_snd_device, &fsi_soc_card); | ||
61 | ret = platform_device_add(fsi_da7210_snd_device); | ||
62 | if (ret) | ||
63 | platform_device_put(fsi_da7210_snd_device); | ||
64 | |||
65 | return ret; | ||
66 | } | ||
67 | |||
68 | static void __exit fsi_da7210_sound_exit(void) | ||
69 | { | ||
70 | platform_device_unregister(fsi_da7210_snd_device); | ||
71 | } | ||
72 | |||
73 | module_init(fsi_da7210_sound_init); | ||
74 | module_exit(fsi_da7210_sound_exit); | ||
75 | |||
76 | /* Module information */ | ||
77 | MODULE_DESCRIPTION("ALSA SoC FSI DA2710"); | ||
78 | MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>"); | ||
79 | MODULE_LICENSE("GPL"); | ||