]>
Commit | Line | Data |
---|---|---|
142054a3 | 1 | /* |
eaaa5328 | 2 | * SoC audio driver for EM-X270, eXeda and CM-X300 |
142054a3 | 3 | * |
eaaa5328 | 4 | * Copyright 2007, 2009 CompuLab, Ltd. |
142054a3 MR |
5 | * |
6 | * Author: Mike Rapoport <mike@compulab.co.il> | |
7 | * | |
8 | * Copied from tosa.c: | |
9 | * Copyright 2005 Wolfson Microelectronics PLC. | |
10 | * Copyright 2005 Openedhand Ltd. | |
11 | * | |
d331124d | 12 | * Authors: Liam Girdwood <lrg@slimlogic.co.uk> |
142054a3 MR |
13 | * Richard Purdie <richard@openedhand.com> |
14 | * | |
15 | * This program is free software; you can redistribute it and/or modify it | |
16 | * under the terms of the GNU General Public License as published by the | |
17 | * Free Software Foundation; either version 2 of the License, or (at your | |
18 | * option) any later version. | |
19 | * | |
20 | */ | |
21 | ||
22 | #include <linux/module.h> | |
23 | #include <linux/moduleparam.h> | |
24 | #include <linux/device.h> | |
25 | ||
142054a3 MR |
26 | #include <sound/core.h> |
27 | #include <sound/pcm.h> | |
28 | #include <sound/soc.h> | |
142054a3 MR |
29 | |
30 | #include <asm/mach-types.h> | |
a09e64fb | 31 | #include <mach/audio.h> |
142054a3 | 32 | |
142054a3 MR |
33 | static struct snd_soc_dai_link em_x270_dai[] = { |
34 | { | |
35 | .name = "AC97", | |
36 | .stream_name = "AC97 HiFi", | |
4bfc4e25 | 37 | .cpu_dai_name = "pxa2xx-ac97", |
f0fba2ad LG |
38 | .codec_dai_name = "wm9712-hifi", |
39 | .platform_name = "pxa-pcm-audio", | |
40 | .codec_name = "wm9712-codec", | |
142054a3 MR |
41 | }, |
42 | { | |
43 | .name = "AC97 Aux", | |
44 | .stream_name = "AC97 Aux", | |
4bfc4e25 | 45 | .cpu_dai_name = "pxa2xx-ac97-aux", |
7be5c5fe | 46 | .codec_dai_name = "wm9712-aux", |
f0fba2ad LG |
47 | .platform_name = "pxa-pcm-audio", |
48 | .codec_name = "wm9712-codec", | |
142054a3 MR |
49 | }, |
50 | }; | |
51 | ||
87506549 | 52 | static struct snd_soc_card em_x270 = { |
142054a3 | 53 | .name = "EM-X270", |
561c6a17 | 54 | .owner = THIS_MODULE, |
142054a3 MR |
55 | .dai_link = em_x270_dai, |
56 | .num_links = ARRAY_SIZE(em_x270_dai), | |
57 | }; | |
58 | ||
142054a3 MR |
59 | static struct platform_device *em_x270_snd_device; |
60 | ||
61 | static int __init em_x270_init(void) | |
62 | { | |
63 | int ret; | |
64 | ||
eaaa5328 MR |
65 | if (!(machine_is_em_x270() || machine_is_exeda() |
66 | || machine_is_cm_x300())) | |
142054a3 MR |
67 | return -ENODEV; |
68 | ||
69 | em_x270_snd_device = platform_device_alloc("soc-audio", -1); | |
70 | if (!em_x270_snd_device) | |
71 | return -ENOMEM; | |
72 | ||
f0fba2ad | 73 | platform_set_drvdata(em_x270_snd_device, &em_x270); |
142054a3 MR |
74 | ret = platform_device_add(em_x270_snd_device); |
75 | ||
76 | if (ret) | |
77 | platform_device_put(em_x270_snd_device); | |
78 | ||
79 | return ret; | |
80 | } | |
81 | ||
82 | static void __exit em_x270_exit(void) | |
83 | { | |
84 | platform_device_unregister(em_x270_snd_device); | |
85 | } | |
86 | ||
87 | module_init(em_x270_init); | |
88 | module_exit(em_x270_exit); | |
89 | ||
90 | /* Module information */ | |
91 | MODULE_AUTHOR("Mike Rapoport"); | |
eaaa5328 | 92 | MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300"); |
142054a3 | 93 | MODULE_LICENSE("GPL"); |