1
2
3
4
5
6
7
8
9
10#include <linux/init.h>
11#include <linux/module.h>
12#include <linux/platform_device.h>
13#include <linux/soc/cirrus/ep93xx.h>
14
15#include <sound/core.h>
16#include <sound/pcm.h>
17#include <sound/soc.h>
18
19#include <asm/mach-types.h>
20
21static struct snd_soc_dai_link simone_dai = {
22 .name = "AC97",
23 .stream_name = "AC97 HiFi",
24 .cpu_dai_name = "ep93xx-ac97",
25 .codec_dai_name = "ac97-hifi",
26 .codec_name = "ac97-codec",
27 .platform_name = "ep93xx-ac97",
28};
29
30static struct snd_soc_card snd_soc_simone = {
31 .name = "Sim.One",
32 .owner = THIS_MODULE,
33 .dai_link = &simone_dai,
34 .num_links = 1,
35};
36
37static struct platform_device *simone_snd_ac97_device;
38
39static int simone_probe(struct platform_device *pdev)
40{
41 struct snd_soc_card *card = &snd_soc_simone;
42 int ret;
43
44 simone_snd_ac97_device = platform_device_register_simple("ac97-codec",
45 -1, NULL, 0);
46 if (IS_ERR(simone_snd_ac97_device))
47 return PTR_ERR(simone_snd_ac97_device);
48
49 card->dev = &pdev->dev;
50
51 ret = snd_soc_register_card(card);
52 if (ret) {
53 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
54 ret);
55 platform_device_unregister(simone_snd_ac97_device);
56 }
57
58 return ret;
59}
60
61static int simone_remove(struct platform_device *pdev)
62{
63 struct snd_soc_card *card = platform_get_drvdata(pdev);
64
65 snd_soc_unregister_card(card);
66 platform_device_unregister(simone_snd_ac97_device);
67
68 return 0;
69}
70
71static struct platform_driver simone_driver = {
72 .driver = {
73 .name = "simone-audio",
74 },
75 .probe = simone_probe,
76 .remove = simone_remove,
77};
78
79module_platform_driver(simone_driver);
80
81MODULE_DESCRIPTION("ALSA SoC Simplemachines Sim.One");
82MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>");
83MODULE_LICENSE("GPL");
84MODULE_ALIAS("platform:simone-audio");
85