2 * dmic.c -- SoC audio for Generic Digital MICs
4 * Author: Liam Girdwood <lrg@slimlogic.co.uk>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 #include <linux/platform_device.h>
23 #include <linux/slab.h>
24 #include <sound/core.h>
25 #include <sound/pcm.h>
26 #include <sound/soc.h>
27 #include <sound/soc-dapm.h>
29 static struct snd_soc_dai_driver dmic_dai
= {
32 .stream_name
= "Capture",
35 .rates
= SNDRV_PCM_RATE_CONTINUOUS
,
36 .formats
= SNDRV_PCM_FMTBIT_S32_LE
37 | SNDRV_PCM_FMTBIT_S24_LE
38 | SNDRV_PCM_FMTBIT_S16_LE
,
42 static struct snd_soc_codec_driver soc_dmic
= {};
44 static int __devinit
dmic_dev_probe(struct platform_device
*pdev
)
46 return snd_soc_register_codec(&pdev
->dev
,
47 &soc_dmic
, &dmic_dai
, 1);
50 static int __devexit
dmic_dev_remove(struct platform_device
*pdev
)
52 snd_soc_unregister_codec(&pdev
->dev
);
56 MODULE_ALIAS("platform:dmic-codec");
58 static struct platform_driver dmic_driver
= {
63 .probe
= dmic_dev_probe
,
64 .remove
= __devexit_p(dmic_dev_remove
),
67 static int __init
dmic_init(void)
69 return platform_driver_register(&dmic_driver
);
71 module_init(dmic_init
);
73 static void __exit
dmic_exit(void)
75 platform_driver_unregister(&dmic_driver
);
77 module_exit(dmic_exit
);
79 MODULE_DESCRIPTION("Generic DMIC driver");
80 MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>");
81 MODULE_LICENSE("GPL");