Commit | Line | Data |
---|---|---|
e24805dd AN |
1 | /* |
2 | * Generic TXx9 ACLC machine driver | |
3 | * | |
4 | * Copyright (C) 2009 Atsushi Nemoto | |
5 | * | |
6 | * Based on RBTX49xx patch from CELF patch archive. | |
7 | * (C) Copyright TOSHIBA CORPORATION 2004-2006 | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License version 2 as | |
11 | * published by the Free Software Foundation. | |
12 | * | |
13 | * This is a very generic AC97 sound machine driver for boards which | |
14 | * have (AC97) audio at ACLC (e.g. RBTX49XX boards). | |
15 | */ | |
16 | ||
17 | #include <linux/module.h> | |
18 | #include <linux/platform_device.h> | |
19 | #include <sound/core.h> | |
20 | #include <sound/pcm.h> | |
21 | #include <sound/soc.h> | |
e24805dd AN |
22 | #include "txx9aclc.h" |
23 | ||
24 | static struct snd_soc_dai_link txx9aclc_generic_dai = { | |
25 | .name = "AC97", | |
26 | .stream_name = "AC97 HiFi", | |
f0fba2ad LG |
27 | .cpu_dai_name = "txx9aclc-ac97", |
28 | .codec_dai_name = "ac97-hifi", | |
29 | .platform_name = "txx9aclc-pcm-audio", | |
30 | .codec_name = "ac97-codec", | |
e24805dd AN |
31 | }; |
32 | ||
33 | static struct snd_soc_card txx9aclc_generic_card = { | |
34 | .name = "Generic TXx9 ACLC Audio", | |
e24805dd AN |
35 | .dai_link = &txx9aclc_generic_dai, |
36 | .num_links = 1, | |
37 | }; | |
38 | ||
f0fba2ad | 39 | static struct platform_device *soc_pdev; |
e24805dd AN |
40 | |
41 | static int __init txx9aclc_generic_probe(struct platform_device *pdev) | |
42 | { | |
e24805dd AN |
43 | int ret; |
44 | ||
45 | soc_pdev = platform_device_alloc("soc-audio", -1); | |
46 | if (!soc_pdev) | |
47 | return -ENOMEM; | |
f0fba2ad | 48 | platform_set_drvdata(soc_pdev, &txx9aclc_generic_card); |
e24805dd AN |
49 | ret = platform_device_add(soc_pdev); |
50 | if (ret) { | |
51 | platform_device_put(soc_pdev); | |
52 | return ret; | |
53 | } | |
f0fba2ad | 54 | |
e24805dd AN |
55 | return 0; |
56 | } | |
57 | ||
58 | static int __exit txx9aclc_generic_remove(struct platform_device *pdev) | |
59 | { | |
e24805dd AN |
60 | platform_device_unregister(soc_pdev); |
61 | return 0; | |
62 | } | |
63 | ||
64 | static struct platform_driver txx9aclc_generic_driver = { | |
f6a74ced | 65 | .remove = __exit_p(txx9aclc_generic_remove), |
e24805dd AN |
66 | .driver = { |
67 | .name = "txx9aclc-generic", | |
68 | .owner = THIS_MODULE, | |
69 | }, | |
70 | }; | |
71 | ||
72 | static int __init txx9aclc_generic_init(void) | |
73 | { | |
74 | return platform_driver_probe(&txx9aclc_generic_driver, | |
75 | txx9aclc_generic_probe); | |
76 | } | |
77 | ||
78 | static void __exit txx9aclc_generic_exit(void) | |
79 | { | |
80 | platform_driver_unregister(&txx9aclc_generic_driver); | |
81 | } | |
82 | ||
83 | module_init(txx9aclc_generic_init); | |
84 | module_exit(txx9aclc_generic_exit); | |
85 | ||
86 | MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>"); | |
87 | MODULE_DESCRIPTION("Generic TXx9 ACLC ALSA SoC audio driver"); | |
88 | MODULE_LICENSE("GPL"); | |
b0b4ce38 | 89 | MODULE_ALIAS("platform:txx9aclc-generic"); |