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

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

Version: ~ [ linux-5.11 ] ~ [ linux-5.10.17 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.99 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.176 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.221 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.257 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.257 ] ~ [ 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.85 ] ~ [ 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-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  * This is a simple driver for the GTM601 Voice PCM interface
  3  *
  4  * Copyright (C) 2015 Goldelico GmbH
  5  *
  6  * Author: Marek Belisko <marek@goldelico.com>
  7  *
  8  * Based on wm8727.c driver
  9  *
 10  * This program is free software; you can redistribute it and/or modify
 11  * it under the terms of the GNU General Public License version 2 as
 12  * published by the Free Software Foundation.
 13  */
 14 
 15 #include <linux/init.h>
 16 #include <linux/slab.h>
 17 #include <linux/module.h>
 18 #include <linux/kernel.h>
 19 #include <linux/device.h>
 20 #include <sound/core.h>
 21 #include <sound/pcm.h>
 22 #include <sound/ac97_codec.h>
 23 #include <sound/initval.h>
 24 #include <sound/soc.h>
 25 
 26 static const struct snd_soc_dapm_widget gtm601_dapm_widgets[] = {
 27         SND_SOC_DAPM_OUTPUT("AOUT"),
 28         SND_SOC_DAPM_INPUT("AIN"),
 29 };
 30 
 31 static const struct snd_soc_dapm_route gtm601_dapm_routes[] = {
 32         { "AOUT", NULL, "Playback" },
 33         { "Capture", NULL, "AIN" },
 34 };
 35 
 36 static struct snd_soc_dai_driver gtm601_dai = {
 37         .name = "gtm601",
 38         .playback = {
 39                 .stream_name = "Playback",
 40                 .channels_min = 1,
 41                 .channels_max = 1,
 42                 .rates = SNDRV_PCM_RATE_8000,
 43                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 44                 },
 45         .capture = {
 46                 .stream_name = "Capture",
 47                 .channels_min = 1,
 48                 .channels_max = 1,
 49                 .rates = SNDRV_PCM_RATE_8000,
 50                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 51         },
 52 };
 53 
 54 static const struct snd_soc_codec_driver soc_codec_dev_gtm601 = {
 55         .component_driver = {
 56                 .dapm_widgets           = gtm601_dapm_widgets,
 57                 .num_dapm_widgets       = ARRAY_SIZE(gtm601_dapm_widgets),
 58                 .dapm_routes            = gtm601_dapm_routes,
 59                 .num_dapm_routes        = ARRAY_SIZE(gtm601_dapm_routes),
 60         },
 61 };
 62 
 63 static int gtm601_platform_probe(struct platform_device *pdev)
 64 {
 65         return snd_soc_register_codec(&pdev->dev,
 66                         &soc_codec_dev_gtm601, &gtm601_dai, 1);
 67 }
 68 
 69 static int gtm601_platform_remove(struct platform_device *pdev)
 70 {
 71         snd_soc_unregister_codec(&pdev->dev);
 72         return 0;
 73 }
 74 
 75 #if defined(CONFIG_OF)
 76 static const struct of_device_id gtm601_codec_of_match[] = {
 77         { .compatible = "option,gtm601", },
 78         {},
 79 };
 80 MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);
 81 #endif
 82 
 83 static struct platform_driver gtm601_codec_driver = {
 84         .driver = {
 85                 .name = "gtm601",
 86                 .of_match_table = of_match_ptr(gtm601_codec_of_match),
 87         },
 88         .probe = gtm601_platform_probe,
 89         .remove = gtm601_platform_remove,
 90 };
 91 
 92 module_platform_driver(gtm601_codec_driver);
 93 
 94 MODULE_DESCRIPTION("ASoC gtm601 driver");
 95 MODULE_AUTHOR("Marek Belisko <marek@goldelico.com>");
 96 MODULE_LICENSE("GPL");
 97 MODULE_ALIAS("platform:gtm601");
 98 

~ [ 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