Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* 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 | |
| 20 | static struct snd_pcm_ops msm_pcm_hostless_ops = {}; |
| 21 | |
| 22 | static struct snd_soc_platform_driver msm_soc_hostless_platform = { |
| 23 | .ops = &msm_pcm_hostless_ops, |
| 24 | }; |
| 25 | |
| 26 | static __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 | |
| 33 | static int msm_pcm_hostless_remove(struct platform_device *pdev) |
| 34 | { |
| 35 | snd_soc_unregister_platform(&pdev->dev); |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | static 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 | |
| 48 | static int __init msm_soc_platform_init(void) |
| 49 | { |
| 50 | return platform_driver_register(&msm_pcm_hostless_driver); |
| 51 | } |
| 52 | module_init(msm_soc_platform_init); |
| 53 | |
| 54 | static void __exit msm_soc_platform_exit(void) |
| 55 | { |
| 56 | platform_driver_unregister(&msm_pcm_hostless_driver); |
| 57 | } |
| 58 | module_exit(msm_soc_platform_exit); |
| 59 | |
| 60 | MODULE_DESCRIPTION("Hostless platform driver"); |
| 61 | MODULE_LICENSE("GPL v2"); |