]> bbs.cooldavid.org Git - net-next-2.6.git/blame - sound/soc/pxa/em-x270.c
ASoC: Fix a few more PXA build errors
[net-next-2.6.git] / sound / soc / pxa / em-x270.c
CommitLineData
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>
29#include <sound/soc-dapm.h>
30
31#include <asm/mach-types.h>
a09e64fb 32#include <mach/audio.h>
142054a3
MR
33
34#include "../codecs/wm9712.h"
142054a3
MR
35#include "pxa2xx-ac97.h"
36
37static struct snd_soc_dai_link em_x270_dai[] = {
38 {
39 .name = "AC97",
40 .stream_name = "AC97 HiFi",
f0fba2ad
LG
41 .cpu_dai_name = "pxa-ac97.0",
42 .codec_dai_name = "wm9712-hifi",
43 .platform_name = "pxa-pcm-audio",
44 .codec_name = "wm9712-codec",
142054a3
MR
45 },
46 {
47 .name = "AC97 Aux",
48 .stream_name = "AC97 Aux",
f0fba2ad
LG
49 .cpu_dai_name = "pxa-ac97.1",
50 .codec_dai_name ="wm9712-aux",
51 .platform_name = "pxa-pcm-audio",
52 .codec_name = "wm9712-codec",
142054a3
MR
53 },
54};
55
87506549 56static struct snd_soc_card em_x270 = {
142054a3
MR
57 .name = "EM-X270",
58 .dai_link = em_x270_dai,
59 .num_links = ARRAY_SIZE(em_x270_dai),
60};
61
142054a3
MR
62static struct platform_device *em_x270_snd_device;
63
64static int __init em_x270_init(void)
65{
66 int ret;
67
eaaa5328
MR
68 if (!(machine_is_em_x270() || machine_is_exeda()
69 || machine_is_cm_x300()))
142054a3
MR
70 return -ENODEV;
71
72 em_x270_snd_device = platform_device_alloc("soc-audio", -1);
73 if (!em_x270_snd_device)
74 return -ENOMEM;
75
f0fba2ad 76 platform_set_drvdata(em_x270_snd_device, &em_x270);
142054a3
MR
77 ret = platform_device_add(em_x270_snd_device);
78
79 if (ret)
80 platform_device_put(em_x270_snd_device);
81
82 return ret;
83}
84
85static void __exit em_x270_exit(void)
86{
87 platform_device_unregister(em_x270_snd_device);
88}
89
90module_init(em_x270_init);
91module_exit(em_x270_exit);
92
93/* Module information */
94MODULE_AUTHOR("Mike Rapoport");
eaaa5328 95MODULE_DESCRIPTION("ALSA SoC EM-X270, eXeda and CM-X300");
142054a3 96MODULE_LICENSE("GPL");