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

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

Version: ~ [ linux-5.7-rc7 ] ~ [ linux-5.6.14 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.42 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.124 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.181 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.224 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.224 ] ~ [ 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.84 ] ~ [ 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  * ADAU7002 Stereo PDM-to-I2S/TDM converter driver
  3  *
  4  * Copyright 2014-2016 Analog Devices
  5  *  Author: Lars-Peter Clausen <lars@metafoo.de>
  6  *
  7  * Licensed under the GPL-2.
  8  */
  9 
 10 #include <linux/acpi.h>
 11 #include <linux/init.h>
 12 #include <linux/module.h>
 13 #include <linux/of.h>
 14 #include <linux/platform_device.h>
 15 
 16 #include <sound/soc.h>
 17 
 18 static const struct snd_soc_dapm_widget adau7002_widgets[] = {
 19         SND_SOC_DAPM_INPUT("PDM_DAT"),
 20         SND_SOC_DAPM_REGULATOR_SUPPLY("IOVDD", 0, 0),
 21 };
 22 
 23 static const struct snd_soc_dapm_route adau7002_routes[] = {
 24         { "Capture", NULL, "PDM_DAT" },
 25         { "Capture", NULL, "IOVDD" },
 26 };
 27 
 28 static struct snd_soc_dai_driver adau7002_dai = {
 29         .name = "adau7002-hifi",
 30         .capture = {
 31                 .stream_name = "Capture",
 32                 .channels_min = 2,
 33                 .channels_max = 2,
 34                 .rates = SNDRV_PCM_RATE_8000_96000,
 35                 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE |
 36                         SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE |
 37                         SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE,
 38                 .sig_bits = 20,
 39         },
 40 };
 41 
 42 static const struct snd_soc_component_driver adau7002_component_driver = {
 43         .dapm_widgets           = adau7002_widgets,
 44         .num_dapm_widgets       = ARRAY_SIZE(adau7002_widgets),
 45         .dapm_routes            = adau7002_routes,
 46         .num_dapm_routes        = ARRAY_SIZE(adau7002_routes),
 47         .idle_bias_on           = 1,
 48         .use_pmdown_time        = 1,
 49         .endianness             = 1,
 50         .non_legacy_dai_naming  = 1,
 51 };
 52 
 53 static int adau7002_probe(struct platform_device *pdev)
 54 {
 55         return devm_snd_soc_register_component(&pdev->dev,
 56                         &adau7002_component_driver,
 57                         &adau7002_dai, 1);
 58 }
 59 
 60 static int adau7002_remove(struct platform_device *pdev)
 61 {
 62         return 0;
 63 }
 64 
 65 #ifdef CONFIG_OF
 66 static const struct of_device_id adau7002_dt_ids[] = {
 67         { .compatible = "adi,adau7002", },
 68         { }
 69 };
 70 MODULE_DEVICE_TABLE(of, adau7002_dt_ids);
 71 #endif
 72 
 73 #ifdef CONFIG_ACPI
 74 static const struct acpi_device_id adau7002_acpi_match[] = {
 75         { "ADAU7002", 0 },
 76         {},
 77 };
 78 MODULE_DEVICE_TABLE(acpi, adau7002_acpi_match);
 79 #endif
 80 
 81 static struct platform_driver adau7002_driver = {
 82         .driver = {
 83                 .name = "adau7002",
 84                 .of_match_table = of_match_ptr(adau7002_dt_ids),
 85                 .acpi_match_table = ACPI_PTR(adau7002_acpi_match),
 86         },
 87         .probe = adau7002_probe,
 88         .remove = adau7002_remove,
 89 };
 90 module_platform_driver(adau7002_driver);
 91 
 92 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
 93 MODULE_DESCRIPTION("ADAU7002 Stereo PDM-to-I2S/TDM Converter driver");
 94 MODULE_LICENSE("GPL v2");
 95 

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