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