diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2009-12-13 23:22:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-12-16 12:31:05 -0500 |
commit | 038494059f795849012a96adba2ab73e65b94ba5 (patch) | |
tree | e3d65e8ce655c15367317d19857316acc4dd1489 | |
parent | 98615454f66175e923f239ab1d1bd85cd618363e (diff) |
ASoC: Add FSI-DA7210 sound support for SuperH
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/sh/Kconfig | 8 | ||||
-rw-r--r-- | sound/soc/sh/Makefile | 2 | ||||
-rw-r--r-- | sound/soc/sh/fsi-da7210.c | 83 |
3 files changed, 93 insertions, 0 deletions
diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index 9e6976586554..8072a6d1c4db 100644 --- a/sound/soc/sh/Kconfig +++ b/sound/soc/sh/Kconfig | |||
@@ -47,4 +47,12 @@ config SND_FSI_AK4642 | |||
47 | This option enables generic sound support for the | 47 | This option enables generic sound support for the |
48 | FSI - AK4642 unit | 48 | FSI - AK4642 unit |
49 | 49 | ||
50 | config SND_FSI_DA7210 | ||
51 | bool "FSI-DA7210 sound support" | ||
52 | depends on SND_SOC_SH4_FSI | ||
53 | select SND_SOC_DA7210 | ||
54 | help | ||
55 | This option enables generic sound support for the | ||
56 | FSI - DA7210 unit | ||
57 | |||
50 | endmenu | 58 | endmenu |
diff --git a/sound/soc/sh/Makefile b/sound/soc/sh/Makefile index a6997872f24e..1d0ec0af74b7 100644 --- a/sound/soc/sh/Makefile +++ b/sound/soc/sh/Makefile | |||
@@ -13,6 +13,8 @@ obj-$(CONFIG_SND_SOC_SH4_FSI) += snd-soc-fsi.o | |||
13 | ## boards | 13 | ## boards |
14 | snd-soc-sh7760-ac97-objs := sh7760-ac97.o | 14 | snd-soc-sh7760-ac97-objs := sh7760-ac97.o |
15 | snd-soc-fsi-ak4642-objs := fsi-ak4642.o | 15 | snd-soc-fsi-ak4642-objs := fsi-ak4642.o |
16 | snd-soc-fsi-da7210-objs := fsi-da7210.o | ||
16 | 17 | ||
17 | obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o | 18 | obj-$(CONFIG_SND_SH7760_AC97) += snd-soc-sh7760-ac97.o |
18 | obj-$(CONFIG_SND_FSI_AK4642) += snd-soc-fsi-ak4642.o | 19 | obj-$(CONFIG_SND_FSI_AK4642) += snd-soc-fsi-ak4642.o |
20 | obj-$(CONFIG_SND_FSI_DA7210) += snd-soc-fsi-da7210.o | ||
diff --git a/sound/soc/sh/fsi-da7210.c b/sound/soc/sh/fsi-da7210.c new file mode 100644 index 000000000000..33b4d177f466 --- /dev/null +++ b/sound/soc/sh/fsi-da7210.c | |||
@@ -0,0 +1,83 @@ | |||
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/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> | ||
22 | |||
23 | #include <sound/sh_fsi.h> | ||
24 | #include "../codecs/da7210.h" | ||
25 | |||
26 | static int fsi_da7210_init(struct snd_soc_codec *codec) | ||
27 | { | ||
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); | ||
31 | } | ||
32 | |||
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, | ||
39 | }; | ||
40 | |||
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, | ||
46 | }; | ||
47 | |||
48 | static struct snd_soc_device fsi_da7210_snd_devdata = { | ||
49 | .card = &fsi_soc_card, | ||
50 | .codec_dev = &soc_codec_dev_da7210, | ||
51 | }; | ||
52 | |||
53 | static struct platform_device *fsi_da7210_snd_device; | ||
54 | |||
55 | static int __init fsi_da7210_sound_init(void) | ||
56 | { | ||
57 | int ret; | ||
58 | |||
59 | fsi_da7210_snd_device = platform_device_alloc("soc-audio", -1); | ||
60 | if (!fsi_da7210_snd_device) | ||
61 | return -ENOMEM; | ||
62 | |||
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); | ||
68 | |||
69 | return ret; | ||
70 | } | ||
71 | |||
72 | static void __exit fsi_da7210_sound_exit(void) | ||
73 | { | ||
74 | platform_device_unregister(fsi_da7210_snd_device); | ||
75 | } | ||
76 | |||
77 | module_init(fsi_da7210_sound_init); | ||
78 | module_exit(fsi_da7210_sound_exit); | ||
79 | |||
80 | /* Module information */ | ||
81 | MODULE_DESCRIPTION("ALSA SoC FSI DA2710"); | ||
82 | MODULE_AUTHOR("Kuninori Morimoto <morimoto.kuninori@renesas.com>"); | ||
83 | MODULE_LICENSE("GPL"); | ||