]> bbs.cooldavid.org Git - net-next-2.6.git/blame - sound/soc/pxa/em-x270.c
ASoC: remove driver_data direct access of struct device
[net-next-2.6.git] / sound / soc / pxa / em-x270.c
CommitLineData
142054a3
MR
1/*
2 * em-x270.c -- SoC audio for EM-X270
3 *
4 * Copyright 2007 CompuLab, Ltd.
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"
35#include "pxa2xx-pcm.h"
36#include "pxa2xx-ac97.h"
37
38static struct snd_soc_dai_link em_x270_dai[] = {
39 {
40 .name = "AC97",
41 .stream_name = "AC97 HiFi",
42 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI],
43 .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI],
44 },
45 {
46 .name = "AC97 Aux",
47 .stream_name = "AC97 Aux",
48 .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX],
49 .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX],
50 },
51};
52
87506549 53static struct snd_soc_card em_x270 = {
142054a3 54 .name = "EM-X270",
87689d56 55 .platform = &pxa2xx_soc_platform,
142054a3
MR
56 .dai_link = em_x270_dai,
57 .num_links = ARRAY_SIZE(em_x270_dai),
58};
59
60static struct snd_soc_device em_x270_snd_devdata = {
87506549 61 .card = &em_x270,
142054a3
MR
62 .codec_dev = &soc_codec_dev_wm9712,
63};
64
65static struct platform_device *em_x270_snd_device;
66
67static int __init em_x270_init(void)
68{
69 int ret;
70
71 if (!machine_is_em_x270())
72 return -ENODEV;
73
74 em_x270_snd_device = platform_device_alloc("soc-audio", -1);
75 if (!em_x270_snd_device)
76 return -ENOMEM;
77
78 platform_set_drvdata(em_x270_snd_device, &em_x270_snd_devdata);
79 em_x270_snd_devdata.dev = &em_x270_snd_device->dev;
80 ret = platform_device_add(em_x270_snd_device);
81
82 if (ret)
83 platform_device_put(em_x270_snd_device);
84
85 return ret;
86}
87
88static void __exit em_x270_exit(void)
89{
90 platform_device_unregister(em_x270_snd_device);
91}
92
93module_init(em_x270_init);
94module_exit(em_x270_exit);
95
96/* Module information */
97MODULE_AUTHOR("Mike Rapoport");
98MODULE_DESCRIPTION("ALSA SoC EM-X270");
99MODULE_LICENSE("GPL");