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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  * This is a simple driver for the GTM601 Voice PCM interface
  4  *
  5  * Copyright (C) 2015 Goldelico GmbH
  6  *
  7  * Author: Marek Belisko <marek@goldelico.com>
  8  *
  9  * Based on wm8727.c driver
 10  */
 11 
 12 #include <linux/init.h>
 13 #include <linux/slab.h>
 14 #include <linux/module.h>
 15 #include <linux/kernel.h>
 16 #include <linux/of.h>
 17 #include <sound/core.h>
 18 #include <sound/pcm.h>
 19 #include <sound/initval.h>
 20 #include <sound/soc.h>
 21 
 22 static const struct snd_soc_dapm_widget gtm601_dapm_widgets[] = {
 23         SND_SOC_DAPM_OUTPUT("AOUT"),
 24         SND_SOC_DAPM_INPUT("AIN"),
 25 };
 26 
 27 static const struct snd_soc_dapm_route gtm601_dapm_routes[] = {
 28         { "AOUT", NULL, "Playback" },
 29         { "Capture", NULL, "AIN" },
 30 };
 31 
 32 static struct snd_soc_dai_driver gtm601_dai = {
 33         .name = "gtm601",
 34         .playback = {
 35                 .stream_name = "Playback",
 36                 .channels_min = 1,
 37                 .channels_max = 1,
 38                 .rates = SNDRV_PCM_RATE_8000,
 39                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 40                 },
 41         .capture = {
 42                 .stream_name = "Capture",
 43                 .channels_min = 1,
 44                 .channels_max = 1,
 45                 .rates = SNDRV_PCM_RATE_8000,
 46                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 47         },
 48 };
 49 
 50 static struct snd_soc_dai_driver bm818_dai = {
 51         .name = "bm818",
 52         .playback = {
 53                 .stream_name = "Playback",
 54                 .channels_min = 2,
 55                 .channels_max = 2,
 56                 .rates = SNDRV_PCM_RATE_48000,
 57                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 58         },
 59         .capture = {
 60                 .stream_name = "Capture",
 61                 .channels_min = 2,
 62                 .channels_max = 2,
 63                 .rates = SNDRV_PCM_RATE_48000,
 64                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 65         },
 66 };
 67 
 68 static const struct snd_soc_component_driver soc_component_dev_gtm601 = {
 69         .dapm_widgets           = gtm601_dapm_widgets,
 70         .num_dapm_widgets       = ARRAY_SIZE(gtm601_dapm_widgets),
 71         .dapm_routes            = gtm601_dapm_routes,
 72         .num_dapm_routes        = ARRAY_SIZE(gtm601_dapm_routes),
 73         .idle_bias_on           = 1,
 74         .use_pmdown_time        = 1,
 75         .endianness             = 1,
 76 };
 77 
 78 static int gtm601_platform_probe(struct platform_device *pdev)
 79 {
 80         const struct snd_soc_dai_driver *dai_driver;
 81 
 82         dai_driver = of_device_get_match_data(&pdev->dev);
 83 
 84         return devm_snd_soc_register_component(&pdev->dev,
 85                         &soc_component_dev_gtm601,
 86                         (struct snd_soc_dai_driver *)dai_driver, 1);
 87 }
 88 
 89 static const struct of_device_id gtm601_codec_of_match[] __maybe_unused = {
 90         { .compatible = "option,gtm601", .data = (void *)&gtm601_dai },
 91         { .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai },
 92         {},
 93 };
 94 MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);
 95 
 96 static struct platform_driver gtm601_codec_driver = {
 97         .driver = {
 98                 .name = "gtm601",
 99                 .of_match_table = of_match_ptr(gtm601_codec_of_match),
100         },
101         .probe = gtm601_platform_probe,
102 };
103 
104 module_platform_driver(gtm601_codec_driver);
105 
106 MODULE_DESCRIPTION("ASoC gtm601 driver");
107 MODULE_AUTHOR("Marek Belisko <marek@goldelico.com>");
108 MODULE_LICENSE("GPL");
109 MODULE_ALIAS("platform:gtm601");
110 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php