blob: 21691dfbe1485ab1092ae59ea7c8f4c375c9d554 [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#include <linux/platform_device.h>
13#include <linux/slab.h>
14#include <sound/core.h>
15#include <sound/pcm.h>
16#include <sound/soc.h>
17
18/* A dummy driver useful only to advertise hardware parameters */
19static struct snd_soc_dai_driver msm_stub_dais[] = {
20 {
21 .name = "msm-stub-rx",
22 .playback = { /* Support maximum range */
23 .stream_name = "Playback",
24 .channels_min = 1,
25 .channels_max = 8,
26 .rates = SNDRV_PCM_RATE_8000_48000,
27 .formats = SNDRV_PCM_FMTBIT_S16_LE,
28 },
29 },
30 {
31 .name = "msm-stub-tx",
32 .capture = { /* Support maximum range */
33 .stream_name = "Record",
34 .channels_min = 1,
35 .channels_max = 4,
36 .rates = SNDRV_PCM_RATE_8000_48000,
37 .formats = SNDRV_PCM_FMTBIT_S16_LE,
38 },
39 }
40};
41
42static struct snd_soc_codec_driver soc_msm_stub = {};
43
44static int __devinit msm_stub_dev_probe(struct platform_device *pdev)
45{
46 return snd_soc_register_codec(&pdev->dev,
47 &soc_msm_stub, msm_stub_dais, ARRAY_SIZE(msm_stub_dais));
48}
49
50static int __devexit msm_stub_dev_remove(struct platform_device *pdev)
51{
52 snd_soc_unregister_codec(&pdev->dev);
53 return 0;
54}
55
56static struct platform_driver msm_stub_driver = {
57 .driver = {
58 .name = "msm-stub-codec",
59 .owner = THIS_MODULE,
60 },
61 .probe = msm_stub_dev_probe,
62 .remove = __devexit_p(msm_stub_dev_remove),
63};
64
65static int __init msm_stub_init(void)
66{
67 return platform_driver_register(&msm_stub_driver);
68}
69module_init(msm_stub_init);
70
71static void __exit msm_stub_exit(void)
72{
73 platform_driver_unregister(&msm_stub_driver);
74}
75module_exit(msm_stub_exit);
76
77MODULE_DESCRIPTION("Generic MSM CODEC driver");
78MODULE_VERSION("1.0");
79MODULE_LICENSE("GPL v2");