~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/codecs/dmic.c

Version: ~ [ linux-5.6-rc1 ] ~ [ linux-5.5.2 ] ~ [ linux-5.4.17 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.102 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.170 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.213 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.213 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * dmic.c  --  SoC audio for Generic Digital MICs
  3  *
  4  * Author: Liam Girdwood <lrg@slimlogic.co.uk>
  5  *
  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.
  9  *
 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.
 14  *
 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
 18  * 02110-1301 USA
 19  *
 20  */
 21 
 22 #include <linux/platform_device.h>
 23 #include <linux/slab.h>
 24 #include <linux/module.h>
 25 #include <sound/core.h>
 26 #include <sound/pcm.h>
 27 #include <sound/soc.h>
 28 #include <sound/soc-dapm.h>
 29 
 30 static struct snd_soc_dai_driver dmic_dai = {
 31         .name = "dmic-hifi",
 32         .capture = {
 33                 .stream_name = "Capture",
 34                 .channels_min = 1,
 35                 .channels_max = 8,
 36                 .rates = SNDRV_PCM_RATE_CONTINUOUS,
 37                 .formats = SNDRV_PCM_FMTBIT_S32_LE
 38                         | SNDRV_PCM_FMTBIT_S24_LE
 39                         | SNDRV_PCM_FMTBIT_S16_LE,
 40         },
 41 };
 42 
 43 static const struct snd_soc_dapm_widget dmic_dapm_widgets[] = {
 44         SND_SOC_DAPM_AIF_OUT("DMIC AIF", "Capture", 0,
 45                              SND_SOC_NOPM, 0, 0),
 46         SND_SOC_DAPM_INPUT("DMic"),
 47 };
 48 
 49 static const struct snd_soc_dapm_route intercon[] = {
 50         {"DMIC AIF", NULL, "DMic"},
 51 };
 52 
 53 static struct snd_soc_codec_driver soc_dmic = {
 54         .dapm_widgets = dmic_dapm_widgets,
 55         .num_dapm_widgets = ARRAY_SIZE(dmic_dapm_widgets),
 56         .dapm_routes = intercon,
 57         .num_dapm_routes = ARRAY_SIZE(intercon),
 58 };
 59 
 60 static int dmic_dev_probe(struct platform_device *pdev)
 61 {
 62         return snd_soc_register_codec(&pdev->dev,
 63                         &soc_dmic, &dmic_dai, 1);
 64 }
 65 
 66 static int dmic_dev_remove(struct platform_device *pdev)
 67 {
 68         snd_soc_unregister_codec(&pdev->dev);
 69         return 0;
 70 }
 71 
 72 MODULE_ALIAS("platform:dmic-codec");
 73 
 74 static struct platform_driver dmic_driver = {
 75         .driver = {
 76                 .name = "dmic-codec",
 77         },
 78         .probe = dmic_dev_probe,
 79         .remove = dmic_dev_remove,
 80 };
 81 
 82 module_platform_driver(dmic_driver);
 83 
 84 MODULE_DESCRIPTION("Generic DMIC driver");
 85 MODULE_AUTHOR("Liam Girdwood <lrg@slimlogic.co.uk>");
 86 MODULE_LICENSE("GPL");
 87 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp