Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Paweł Anikiel and committed by
Mark Brown
61ed3034 70264872

+51
+8
sound/soc/codecs/Kconfig
··· 57 57 imply SND_SOC_AW88395 58 58 imply SND_SOC_BT_SCO 59 59 imply SND_SOC_BD28623 60 + imply SND_SOC_CHV3_CODEC 60 61 imply SND_SOC_CQ0093VC 61 62 imply SND_SOC_CROS_EC_CODEC 62 63 imply SND_SOC_CS35L32 ··· 644 643 645 644 config SND_SOC_BT_SCO 646 645 tristate "Dummy BT SCO codec driver" 646 + 647 + config SND_SOC_CHV3_CODEC 648 + tristate "Google Chameleon v3 codec driver" 649 + help 650 + Enable support for the Google Chameleon v3 audio codec. 651 + This codec does not have a control interface, it always outputs 652 + 8 channel S32_LE audio. 647 653 648 654 config SND_SOC_CPCAP 649 655 tristate "Motorola CPCAP codec"
+2
sound/soc/codecs/Makefile
··· 51 51 aw88395/aw88395_device.o 52 52 snd-soc-bd28623-objs := bd28623.o 53 53 snd-soc-bt-sco-objs := bt-sco.o 54 + snd-soc-chv3-codec-objs := chv3-codec.o 54 55 snd-soc-cpcap-objs := cpcap.o 55 56 snd-soc-cq93vc-objs := cq93vc.o 56 57 snd-soc-cros-ec-codec-objs := cros_ec_codec.o ··· 428 427 obj-$(CONFIG_SND_SOC_AW88395) +=snd-soc-aw88395.o 429 428 obj-$(CONFIG_SND_SOC_BD28623) += snd-soc-bd28623.o 430 429 obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o 430 + obj-$(CONFIG_SND_SOC_CHV3_CODEC) += snd-soc-chv3-codec.o 431 431 obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o 432 432 obj-$(CONFIG_SND_SOC_CPCAP) += snd-soc-cpcap.o 433 433 obj-$(CONFIG_SND_SOC_CROS_EC_CODEC) += snd-soc-cros-ec-codec.o
+41
sound/soc/codecs/chv3-codec.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include <linux/module.h> 3 + #include <sound/soc.h> 4 + 5 + static struct snd_soc_dai_driver chv3_codec_dai = { 6 + .name = "chv3-codec-hifi", 7 + .capture = { 8 + .stream_name = "Capture", 9 + .channels_min = 8, 10 + .channels_max = 8, 11 + .rates = SNDRV_PCM_RATE_CONTINUOUS, 12 + .formats = SNDRV_PCM_FMTBIT_S32_LE, 13 + }, 14 + }; 15 + 16 + static const struct snd_soc_component_driver soc_component_dev_chv3_codec = { 17 + }; 18 + 19 + static int chv3_codec_probe(struct platform_device *pdev) 20 + { 21 + return devm_snd_soc_register_component(&pdev->dev, 22 + &soc_component_dev_chv3_codec, &chv3_codec_dai, 1); 23 + } 24 + 25 + static const struct of_device_id chv3_codec_of_match[] = { 26 + { .compatible = "google,chv3-codec", }, 27 + { } 28 + }; 29 + 30 + static struct platform_driver chv3_codec_platform_driver = { 31 + .driver = { 32 + .name = "chv3-codec", 33 + .of_match_table = chv3_codec_of_match, 34 + }, 35 + .probe = chv3_codec_probe, 36 + }; 37 + module_platform_driver(chv3_codec_platform_driver); 38 + 39 + MODULE_DESCRIPTION("ASoC Chameleon v3 codec driver"); 40 + MODULE_AUTHOR("Pawel Anikiel <pan@semihalf.com>"); 41 + MODULE_LICENSE("GPL");