sh_eth: fix EESIPR values for SH77{34|63}
[linux/fpc-iii.git] / sound / soc / codecs / ics43432.c
blobdd850b93938d53737fe222e3e8c3b0dfee834280
1 /*
2 * I2S MEMS microphone driver for InvenSense ICS-43432
4 * - Non configurable.
5 * - I2S interface, 64 BCLs per frame, 32 bits per channel, 24 bit data
7 * Copyright (c) 2015 Axis Communications AB
9 * Licensed under GPL v2.
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>
22 #define ICS43432_RATE_MIN 7190 /* Hz, from data sheet */
23 #define ICS43432_RATE_MAX 52800 /* Hz, from data sheet */
25 #define ICS43432_FORMATS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32)
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,
40 static struct snd_soc_codec_driver ics43432_codec_driver = {
43 static int ics43432_probe(struct platform_device *pdev)
45 return snd_soc_register_codec(&pdev->dev, &ics43432_codec_driver,
46 &ics43432_dai, 1);
49 static int ics43432_remove(struct platform_device *pdev)
51 snd_soc_unregister_codec(&pdev->dev);
52 return 0;
55 #ifdef CONFIG_OF
56 static const struct of_device_id ics43432_ids[] = {
57 { .compatible = "invensense,ics43432", },
58 { }
60 MODULE_DEVICE_TABLE(of, ics43432_ids);
61 #endif
63 static struct platform_driver ics43432_driver = {
64 .driver = {
65 .name = "ics43432",
66 .of_match_table = of_match_ptr(ics43432_ids),
68 .probe = ics43432_probe,
69 .remove = ics43432_remove,
72 module_platform_driver(ics43432_driver);
74 MODULE_DESCRIPTION("ASoC ICS43432 driver");
75 MODULE_AUTHOR("Ricard Wanderlof <ricardw@axis.com>");
76 MODULE_LICENSE("GPL v2");