2 * phycore-ac97.c -- SoC audio for imx_phycore in AC97 mode
4 * Copyright 2009 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
13 #include <linux/module.h>
14 #include <linux/moduleparam.h>
15 #include <linux/device.h>
16 #include <linux/i2c.h>
17 #include <sound/core.h>
18 #include <sound/pcm.h>
19 #include <sound/soc.h>
20 #include <sound/soc-dapm.h>
21 #include <asm/mach-types.h>
23 static struct snd_soc_card imx_phycore
;
25 static struct snd_soc_ops imx_phycore_hifi_ops
= {
28 static struct snd_soc_dai_link imx_phycore_dai_ac97
[] = {
31 .stream_name
= "HiFi",
32 .codec_dai_name
= "wm9712-hifi",
33 .codec_name
= "wm9712-codec",
34 .cpu_dai_name
= "imx-ssi.0",
35 .platform_name
= "imx-fiq-pcm-audio.0",
36 .ops
= &imx_phycore_hifi_ops
,
40 static struct snd_soc_card imx_phycore
= {
41 .name
= "PhyCORE-ac97-audio",
42 .dai_link
= imx_phycore_dai_ac97
,
43 .num_links
= ARRAY_SIZE(imx_phycore_dai_ac97
),
46 static struct platform_device
*imx_phycore_snd_device
;
48 static int __init
imx_phycore_init(void)
52 if (!machine_is_pcm043() && !machine_is_pca100())
53 /* return happy. We might run on a totally different machine */
56 imx_phycore_snd_device
= platform_device_alloc("soc-audio", -1);
57 if (!imx_phycore_snd_device
)
60 platform_set_drvdata(imx_phycore_snd_device
, &imx_phycore
);
61 ret
= platform_device_add(imx_phycore_snd_device
);
63 imx_phycore_snd_device
= platform_device_alloc("wm9712-codec", -1);
64 if (!imx_phycore_snd_device
)
66 ret
= platform_device_add(imx_phycore_snd_device
);
69 printk(KERN_ERR
"ASoC: Platform device allocation failed\n");
70 platform_device_put(imx_phycore_snd_device
);
76 static void __exit
imx_phycore_exit(void)
78 platform_device_unregister(imx_phycore_snd_device
);
81 late_initcall(imx_phycore_init
);
82 module_exit(imx_phycore_exit
);
84 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
85 MODULE_DESCRIPTION("PhyCORE ALSA SoC driver");
86 MODULE_LICENSE("GPL");