summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/chv3-codec.c
diff options
context:
space:
mode:
authorPaweł Anikiel <pan@semihalf.com>2023-05-08 14:30:32 +0300
committerMark Brown <broonie@kernel.org>2023-05-17 04:37:08 +0300
commit61ed303496eb7e18491ee617dec2403f75d5168c (patch)
tree5798d46a2a8e96803db206e01e5798c8a9e29197 /sound/soc/codecs/chv3-codec.c
parent702648721db590b3425c31ade294000e18808345 (diff)
downloadlinux-61ed303496eb7e18491ee617dec2403f75d5168c.tar.xz
ASoC: Add Google Chameleon v3 codec driver
Add driver for the codec IP present on Google Chameleon v3 Signed-off-by: Paweł Anikiel <pan@semihalf.com Link: https://lore.kernel.org/r/20230508113037.137627-3-pan@semihalf.com Signed-off-by: Mark Brown <broonie@kernel.org
Diffstat (limited to 'sound/soc/codecs/chv3-codec.c')
-rw-r--r--sound/soc/codecs/chv3-codec.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/sound/soc/codecs/chv3-codec.c b/sound/soc/codecs/chv3-codec.c
new file mode 100644
index 000000000000..ab99effa6874
--- /dev/null
+++ b/sound/soc/codecs/chv3-codec.c
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/module.h>
+#include <sound/soc.h>
+
+static struct snd_soc_dai_driver chv3_codec_dai = {
+ .name = "chv3-codec-hifi",
+ .capture = {
+ .stream_name = "Capture",
+ .channels_min = 8,
+ .channels_max = 8,
+ .rates = SNDRV_PCM_RATE_CONTINUOUS,
+ .formats = SNDRV_PCM_FMTBIT_S32_LE,
+ },
+};
+
+static const struct snd_soc_component_driver soc_component_dev_chv3_codec = {
+};
+
+static int chv3_codec_probe(struct platform_device *pdev)
+{
+ return devm_snd_soc_register_component(&pdev->dev,
+ &soc_component_dev_chv3_codec, &chv3_codec_dai, 1);
+}
+
+static const struct of_device_id chv3_codec_of_match[] = {
+ { .compatible = "google,chv3-codec", },
+ { }
+};
+
+static struct platform_driver chv3_codec_platform_driver = {
+ .driver = {
+ .name = "chv3-codec",
+ .of_match_table = chv3_codec_of_match,
+ },
+ .probe = chv3_codec_probe,
+};
+module_platform_driver(chv3_codec_platform_driver);
+
+MODULE_DESCRIPTION("ASoC Chameleon v3 codec driver");
+MODULE_AUTHOR("Pawel Anikiel <pan@semihalf.com>");
+MODULE_LICENSE("GPL");