module: Convert symbol namespace to string literal
[linux.git] / sound / soc / sdw_utils / soc_sdw_rt_dmic.c
blob46d917a99c51dab90d28b12c4646ed7862dc0044
1 // SPDX-License-Identifier: GPL-2.0-only
2 // This file incorporates work covered by the following copyright notice:
3 // Copyright (c) 2024 Intel Corporation
4 // Copyright (c) 2024 Advanced Micro Devices, Inc.
6 /*
7 * soc_sdw_rt_dmic - Helpers to handle Realtek SDW DMIC from generic machine driver
8 */
10 #include <linux/device.h>
11 #include <linux/errno.h>
12 #include <sound/soc.h>
13 #include <sound/soc-acpi.h>
14 #include <sound/soc_sdw_utils.h>
16 int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
18 struct snd_soc_card *card = rtd->card;
19 struct snd_soc_component *component;
20 char *mic_name;
22 component = dai->component;
25 * rt715-sdca (aka rt714) is a special case that uses different name in card->components
26 * and component->name_prefix.
28 if (!strcmp(component->name_prefix, "rt714"))
29 mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "rt715-sdca");
30 else
31 mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s", component->name_prefix);
33 card->components = devm_kasprintf(card->dev, GFP_KERNEL,
34 "%s mic:%s", card->components,
35 mic_name);
36 if (!card->components)
37 return -ENOMEM;
39 dev_dbg(card->dev, "card->components: %s\n", card->components);
41 return 0;
43 EXPORT_SYMBOL_NS(asoc_sdw_rt_dmic_rtd_init, "SND_SOC_SDW_UTILS");