blob: c61511dc2e8e61e68e5a4870d0f8188327094c09 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/platform_device.h>
16#include <sound/core.h>
17#include <sound/soc.h>
18#include <sound/pcm.h>
19
20static struct snd_pcm_ops msm_pcm_hostless_ops = {};
21
22static struct snd_soc_platform_driver msm_soc_hostless_platform = {
23 .ops = &msm_pcm_hostless_ops,
24};
25
26static __devinit int msm_pcm_hostless_probe(struct platform_device *pdev)
27{
28 pr_debug("%s: dev name %s\n", __func__, dev_name(&pdev->dev));
29 return snd_soc_register_platform(&pdev->dev,
30 &msm_soc_hostless_platform);
31}
32
33static int msm_pcm_hostless_remove(struct platform_device *pdev)
34{
35 snd_soc_unregister_platform(&pdev->dev);
36 return 0;
37}
38
39static struct platform_driver msm_pcm_hostless_driver = {
40 .driver = {
41 .name = "msm-pcm-hostless",
42 .owner = THIS_MODULE,
43 },
44 .probe = msm_pcm_hostless_probe,
45 .remove = __devexit_p(msm_pcm_hostless_remove),
46};
47
48static int __init msm_soc_platform_init(void)
49{
50 return platform_driver_register(&msm_pcm_hostless_driver);
51}
52module_init(msm_soc_platform_init);
53
54static void __exit msm_soc_platform_exit(void)
55{
56 platform_driver_unregister(&msm_pcm_hostless_driver);
57}
58module_exit(msm_soc_platform_exit);
59
60MODULE_DESCRIPTION("Hostless platform driver");
61MODULE_LICENSE("GPL v2");