From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 From: kovalev@altlinux.org To: devel-kernel@lists.altlinux.org Date: Wed, 6 Dec 2023 19:44:07 +0300 Message-Id: <20231206164413.126554-2-kovalev@altlinux.org> X-Mailer: git-send-email 2.33.8 In-Reply-To: <20231206164413.126554-1-kovalev@altlinux.org> References: <20231206164413.126554-1-kovalev@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [d-kernel] [PATCH 1/7] ASoC: Intel: update strategy UCM components for es8336 driver X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2023 16:44:38 -0000 Archived-At: List-Archive: List-Post: From: Vasiliy Kovalev UCM configuration files differ for the sof-essx8336 driver (es8316 and es8326 codecs are serviced) and to select the desired config, add a component to the driver. Signed-off-by: Vasiliy Kovalev --- sound/soc/intel/boards/sof_es8336.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c index 6b8b4596e62e92..ee52004e88d329 100644 --- a/sound/soc/intel/boards/sof_es8336.c +++ b/sound/soc/intel/boards/sof_es8336.c @@ -658,8 +658,10 @@ static int sof_es8336_probe(struct platform_device *pdev) } log_quirks(dev); - if (quirk & SOF_ES8336_ENABLE_DMIC) + if (quirk & SOF_ES8336_ENABLE_DMIC) { dmic_be_num = 2; + mach->mach_params.dmic_num = 2; + } /* compute number of dai links */ sof_es8336_card.num_links = 1 + dmic_be_num + hdmi_num; @@ -687,11 +689,9 @@ static int sof_es8336_probe(struct platform_device *pdev) return -ENXIO; } - card->components = devm_kasprintf(dev, GFP_KERNEL, "spk:es83%d6", - strstr(codec_name, "ESSX8326") - ? 1 : 2); - if (!card->components) - return -ENOMEM; + /* add component for alsa UCM */ + snprintf(soc_components, sizeof(soc_components), "spk:ES83%d6", + strstr(codec_name, "ESSX8326")? 2 : 1); codec_dev = acpi_get_first_physical_node(adev); acpi_dev_put(adev); @@ -762,11 +762,16 @@ static int sof_es8336_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(card, priv); if (mach->mach_params.dmic_num > 0) { - snprintf(soc_components, sizeof(soc_components), - "cfg-dmics:%d", mach->mach_params.dmic_num); - card->components = soc_components; + char dmic_component[15]; + snprintf(dmic_component, sizeof(dmic_component), + " cfg-dmics:%d", mach->mach_params.dmic_num); + strcat(soc_components,dmic_component); } + card->components = soc_components; + if (!card->components) + return -ENOMEM; + ret = devm_snd_soc_register_card(dev, card); if (ret) { gpiod_put(priv->gpio_speakers); -- 2.33.8