2 * simone.c -- ASoC audio for Simplemachines Sim.One board
4 * Copyright (c) 2010 Mika Westerberg
6 * Based on snappercl15 machine driver by Ryan Mallon.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/init.h>
14 #include <linux/module.h>
15 #include <linux/platform_device.h>
16 #include <linux/soc/cirrus/ep93xx.h>
18 #include <sound/core.h>
19 #include <sound/pcm.h>
20 #include <sound/soc.h>
22 #include <asm/mach-types.h>
24 static struct snd_soc_dai_link simone_dai = {
26 .stream_name = "AC97 HiFi",
27 .cpu_dai_name = "ep93xx-ac97",
28 .codec_dai_name = "ac97-hifi",
29 .codec_name = "ac97-codec",
30 .platform_name = "ep93xx-ac97",
33 static struct snd_soc_card snd_soc_simone = {
36 .dai_link = &simone_dai,
40 static struct platform_device *simone_snd_ac97_device;
42 static int simone_probe(struct platform_device *pdev)
44 struct snd_soc_card *card = &snd_soc_simone;
47 simone_snd_ac97_device = platform_device_register_simple("ac97-codec",
49 if (IS_ERR(simone_snd_ac97_device))
50 return PTR_ERR(simone_snd_ac97_device);
52 card->dev = &pdev->dev;
54 ret = snd_soc_register_card(card);
56 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
58 platform_device_unregister(simone_snd_ac97_device);
64 static int simone_remove(struct platform_device *pdev)
66 struct snd_soc_card *card = platform_get_drvdata(pdev);
68 snd_soc_unregister_card(card);
69 platform_device_unregister(simone_snd_ac97_device);
74 static struct platform_driver simone_driver = {
76 .name = "simone-audio",
78 .probe = simone_probe,
79 .remove = simone_remove,
82 module_platform_driver(simone_driver);
84 MODULE_DESCRIPTION("ALSA SoC Simplemachines Sim.One");
86 MODULE_LICENSE("GPL");
87 MODULE_ALIAS("platform:simone-audio");