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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SDCA: Initial support for Cirrus Logic CS47L47

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

The CS47L47 is a SDCA smart codec with UAJ (headset, jack detect) and DMIC.
This series adds the initial support for the Cirrus Logic CS47L47 codec.

+120
+2
include/sound/soc_sdw_utils.h
··· 259 259 int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 260 260 int asoc_sdw_cs42l45_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 261 261 int asoc_sdw_cs42l45_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 262 + int asoc_sdw_cs47l47_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 263 + int asoc_sdw_cs47l47_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 262 264 int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 263 265 int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); 264 266 /* TI */
+1
sound/soc/sdca/sdca_class.c
··· 317 317 318 318 static const struct sdw_device_id class_sdw_id[] = { 319 319 SDW_SLAVE_ENTRY(0x01FA, 0x4245, 0), 320 + SDW_SLAVE_ENTRY(0x01FA, 0x4747, 0), 320 321 {} 321 322 }; 322 323 MODULE_DEVICE_TABLE(sdw, class_sdw_id);
+1
sound/soc/sdw_utils/Makefile
··· 6 6 soc_sdw_bridge_cs35l56.o \ 7 7 soc_sdw_cs42l42.o soc_sdw_cs42l43.o \ 8 8 soc_sdw_cs42l45.o \ 9 + soc_sdw_cs47l47.o \ 9 10 soc_sdw_cs_amp.o \ 10 11 soc_sdw_maxim.o \ 11 12 soc_sdw_ti_amp.o
+80
sound/soc/sdw_utils/soc_sdw_cs47l47.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // Based on sof_sdw_cs42l45.c 3 + // This file incorporates work covered by the following copyright notice: 4 + // Copyright (c) 2023 Intel Corporation 5 + // Copyright (c) 2024 Advanced Micro Devices, Inc. 6 + 7 + /* 8 + * soc_sdw_cs47l47 - Helpers to handle CS47L47 from generic machine driver 9 + */ 10 + #include <linux/device.h> 11 + #include <linux/errno.h> 12 + #include <sound/jack.h> 13 + #include <sound/soc.h> 14 + #include <sound/soc-card.h> 15 + #include <sound/soc-component.h> 16 + #include <sound/soc-dai.h> 17 + #include <sound/soc_sdw_utils.h> 18 + 19 + static struct snd_soc_jack_pin soc_jack_pins[] = { 20 + { 21 + .pin = "cs47l47 OT 43 Headphone", 22 + .mask = SND_JACK_HEADPHONE, 23 + }, 24 + { 25 + .pin = "cs47l47 OT 45 Headset", 26 + .mask = SND_JACK_HEADPHONE, 27 + }, 28 + { 29 + .pin = "cs47l47 IT 31 Microphone", 30 + .mask = SND_JACK_MICROPHONE, 31 + }, 32 + { 33 + .pin = "cs47l47 IT 33 Headset", 34 + .mask = SND_JACK_MICROPHONE, 35 + }, 36 + }; 37 + 38 + int asoc_sdw_cs47l47_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 39 + { 40 + struct snd_soc_card *card = rtd->card; 41 + struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; 42 + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); 43 + struct snd_soc_jack *jack = &ctx->sdw_headset; 44 + int ret; 45 + 46 + card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s hs:cs47l47", 47 + card->components); 48 + if (!card->components) 49 + return -ENOMEM; 50 + 51 + ret = snd_soc_card_jack_new_pins(card, "Jack", SND_JACK_MECHANICAL | 52 + SND_JACK_HEADSET | SND_JACK_LINEOUT, jack, 53 + soc_jack_pins, ARRAY_SIZE(soc_jack_pins)); 54 + if (ret) { 55 + dev_err(card->dev, "Failed to create jack: %d\n", ret); 56 + return ret; 57 + } 58 + 59 + ret = snd_soc_component_set_jack(component, jack, NULL); 60 + if (ret) { 61 + dev_err(card->dev, "Failed to register jack: %d\n", ret); 62 + return ret; 63 + } 64 + 65 + return 0; 66 + } 67 + EXPORT_SYMBOL_NS(asoc_sdw_cs47l47_hs_rtd_init, "SND_SOC_SDW_UTILS"); 68 + 69 + int asoc_sdw_cs47l47_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 70 + { 71 + struct snd_soc_card *card = rtd->card; 72 + 73 + card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s mic:cs47l47-dmic", 74 + card->components); 75 + if (!card->components) 76 + return -ENOMEM; 77 + 78 + return 0; 79 + } 80 + EXPORT_SYMBOL_NS(asoc_sdw_cs47l47_dmic_rtd_init, "SND_SOC_SDW_UTILS");
+36
sound/soc/sdw_utils/soc_sdw_utils.c
··· 760 760 .aux_num = 1, 761 761 }, 762 762 { 763 + .part_id = 0x4747, 764 + .name_prefix = "cs47l47", 765 + .dais = { 766 + { 767 + .direction = {true, false}, 768 + .codec_name = "snd_soc_sdca.UAJ.1", 769 + .dai_name = "IT 41", 770 + .dai_type = SOC_SDW_DAI_TYPE_JACK, 771 + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, 772 + .rtd_init = asoc_sdw_cs47l47_hs_rtd_init, 773 + }, 774 + { 775 + .direction = {false, true}, 776 + .codec_name = "snd_soc_sdca.SmartMic.0", 777 + .dai_name = "OT 113", 778 + .dai_type = SOC_SDW_DAI_TYPE_MIC, 779 + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, 780 + .rtd_init = asoc_sdw_cs47l47_dmic_rtd_init, 781 + }, 782 + { 783 + .direction = {false, true}, 784 + .codec_name = "snd_soc_sdca.UAJ.1", 785 + .dai_name = "OT 36", 786 + .dai_type = SOC_SDW_DAI_TYPE_JACK, 787 + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, 788 + }, 789 + }, 790 + .dai_num = 3, 791 + .auxs = { 792 + { 793 + .codec_name = "snd_soc_sdca.HID.2", 794 + }, 795 + }, 796 + .aux_num = 1, 797 + }, 798 + { 763 799 .part_id = 0xaaaa, /* generic codec mockup */ 764 800 .name_prefix = "sdw_mockup_mmulti-function", 765 801 .version_id = 0,