1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <linux/module.h>
25#include <sound/pcm.h>
26#include <sound/soc.h>
27#include <asm/mach-types.h>
28#include <video/omapdss.h>
29
30#define DRV_NAME "omap-hdmi-audio"
31
32static struct snd_soc_dai_link omap_hdmi_dai = {
33 .name = "HDMI",
34 .stream_name = "HDMI",
35 .cpu_dai_name = "omap-hdmi-audio-dai",
36 .platform_name = "omap-pcm-audio",
37 .codec_name = "hdmi-audio-codec",
38 .codec_dai_name = "hdmi-hifi",
39};
40
41static struct snd_soc_card snd_soc_omap_hdmi = {
42 .name = "OMAPHDMI",
43 .owner = THIS_MODULE,
44 .dai_link = &omap_hdmi_dai,
45 .num_links = 1,
46};
47
48static int omap_hdmi_probe(struct platform_device *pdev)
49{
50 struct snd_soc_card *card = &snd_soc_omap_hdmi;
51 int ret;
52
53 card->dev = &pdev->dev;
54
55 ret = snd_soc_register_card(card);
56 if (ret) {
57 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
58 card->dev = NULL;
59 return ret;
60 }
61 return 0;
62}
63
64static int omap_hdmi_remove(struct platform_device *pdev)
65{
66 struct snd_soc_card *card = platform_get_drvdata(pdev);
67
68 snd_soc_unregister_card(card);
69 card->dev = NULL;
70 return 0;
71}
72
73static struct platform_driver omap_hdmi_driver = {
74 .driver = {
75 .name = DRV_NAME,
76 .owner = THIS_MODULE,
77 },
78 .probe = omap_hdmi_probe,
79 .remove = omap_hdmi_remove,
80};
81
82module_platform_driver(omap_hdmi_driver);
83
84MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
85MODULE_DESCRIPTION("OMAP HDMI machine ASoC driver");
86MODULE_LICENSE("GPL");
87MODULE_ALIAS("platform:" DRV_NAME);
88