1 // SPDX-License-Identifier: GPL-2.0-only
3 * I2S MEMS microphone driver for InvenSense ICS-43432
6 * - I2S interface, 64 BCLs per frame, 32 bits per channel, 24 bit data
8 * Copyright (c) 2015 Axis Communications AB
11 #include <linux/module.h>
12 #include <linux/init.h>
13 #include <linux/slab.h>
14 #include <sound/core.h>
15 #include <sound/pcm.h>
16 #include <sound/pcm_params.h>
17 #include <sound/soc.h>
18 #include <sound/initval.h>
19 #include <sound/tlv.h>
21 #define ICS43432_RATE_MIN 7190 /* Hz, from data sheet */
22 #define ICS43432_RATE_MAX 52800 /* Hz, from data sheet */
24 #define ICS43432_FORMATS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32)
26 static struct snd_soc_dai_driver ics43432_dai
= {
27 .name
= "ics43432-hifi",
29 .stream_name
= "Capture",
32 .rate_min
= ICS43432_RATE_MIN
,
33 .rate_max
= ICS43432_RATE_MAX
,
34 .rates
= SNDRV_PCM_RATE_CONTINUOUS
,
35 .formats
= ICS43432_FORMATS
,
39 static const struct snd_soc_component_driver ics43432_component_driver
= {
43 .non_legacy_dai_naming
= 1,
46 static int ics43432_probe(struct platform_device
*pdev
)
48 return devm_snd_soc_register_component(&pdev
->dev
,
49 &ics43432_component_driver
,
54 static const struct of_device_id ics43432_ids
[] = {
55 { .compatible
= "invensense,ics43432", },
58 MODULE_DEVICE_TABLE(of
, ics43432_ids
);
61 static struct platform_driver ics43432_driver
= {
64 .of_match_table
= of_match_ptr(ics43432_ids
),
66 .probe
= ics43432_probe
,
69 module_platform_driver(ics43432_driver
);
71 MODULE_DESCRIPTION("ASoC ICS43432 driver");
72 MODULE_AUTHOR("Ricard Wanderlof <ricardw@axis.com>");
73 MODULE_LICENSE("GPL v2");