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

TOMOYO Linux Cross Reference
Linux/sound/soc/codecs/ics43432.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  * I2S MEMS microphone driver for InvenSense ICS-43432 and similar
  4  * MEMS-based microphones.
  5  *
  6  * - Non configurable.
  7  * - I2S interface, 64 BCLs per frame, 32 bits per channel, 24 bit data
  8  *
  9  * Copyright (c) 2015 Axis Communications AB
 10  */
 11 
 12 #include <linux/module.h>
 13 #include <linux/init.h>
 14 #include <linux/slab.h>
 15 #include <sound/core.h>
 16 #include <sound/pcm.h>
 17 #include <sound/pcm_params.h>
 18 #include <sound/soc.h>
 19 #include <sound/initval.h>
 20 #include <sound/tlv.h>
 21 
 22 #define ICS43432_RATE_MIN 7190 /* Hz, from data sheet */
 23 #define ICS43432_RATE_MAX 52800  /* Hz, from data sheet */
 24 
 25 #define ICS43432_FORMATS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32)
 26 
 27 static struct snd_soc_dai_driver ics43432_dai = {
 28         .name = "ics43432-hifi",
 29         .capture = {
 30                 .stream_name = "Capture",
 31                 .channels_min = 1,
 32                 .channels_max = 2,
 33                 .rate_min = ICS43432_RATE_MIN,
 34                 .rate_max = ICS43432_RATE_MAX,
 35                 .rates = SNDRV_PCM_RATE_CONTINUOUS,
 36                 .formats = ICS43432_FORMATS,
 37         },
 38 };
 39 
 40 static const struct snd_soc_component_driver ics43432_component_driver = {
 41         .idle_bias_on           = 1,
 42         .use_pmdown_time        = 1,
 43         .endianness             = 1,
 44 };
 45 
 46 static int ics43432_probe(struct platform_device *pdev)
 47 {
 48         return devm_snd_soc_register_component(&pdev->dev,
 49                         &ics43432_component_driver,
 50                         &ics43432_dai, 1);
 51 }
 52 
 53 #ifdef CONFIG_OF
 54 static const struct of_device_id ics43432_ids[] = {
 55         { .compatible = "invensense,ics43432", },
 56         { .compatible = "cui,cmm-4030d-261", },
 57         { }
 58 };
 59 MODULE_DEVICE_TABLE(of, ics43432_ids);
 60 #endif
 61 
 62 static struct platform_driver ics43432_driver = {
 63         .driver = {
 64                 .name = "ics43432",
 65                 .of_match_table = of_match_ptr(ics43432_ids),
 66         },
 67         .probe = ics43432_probe,
 68 };
 69 
 70 module_platform_driver(ics43432_driver);
 71 
 72 MODULE_DESCRIPTION("ASoC ICS43432 driver");
 73 MODULE_AUTHOR("Ricard Wanderlof <ricardw@axis.com>");
 74 MODULE_LICENSE("GPL v2");
 75 

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