Skip to content

Commit

Permalink
ASoC: Intel: sof_sdw_rt_sdca_jack_common: remove -sdca for new codecs
Browse files Browse the repository at this point in the history
Realtek new SoundWire codecs are all -sdca version. No need to add
-sdca to distinguish the non-sdca version. To be consistent with "spk:"
and "mic:" components string, remove "-sdca" suffix from "hs:"
components string.

Signed-off-by: Bard Liao <[email protected]>
  • Loading branch information
bardliao committed Apr 25, 2024
1 parent 9379468 commit ed7f2d9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ static const char * const jack_codecs[] = {
"rt711", "rt712", "rt713", "rt722"
};

static const char * const need_sdca_suffix[] = {
"rt711", "rt713"
};

int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
Expand All @@ -103,11 +107,20 @@ int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd)

component = codec_dai->component;
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s hs:%s-sdca",
"%s hs:%s",
card->components, component->name_prefix);
if (!card->components)
return -ENOMEM;

codec_dai = get_codec_dai_by_name(rtd, need_sdca_suffix, ARRAY_SIZE(need_sdca_suffix));
if (codec_dai) {
/* Add -sdca suffix for existing UCMs */
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s-sdca", card->components);
if (!card->components)
return -ENOMEM;
}

ret = snd_soc_add_card_controls(card, rt_sdca_jack_controls,
ARRAY_SIZE(rt_sdca_jack_controls));
if (ret) {
Expand Down

0 comments on commit ed7f2d9

Please sign in to comment.