Commit 9f47c9c8 authored by Hans de Goede's avatar Hans de Goede Committed by Mark Brown

ASoC: Intel: bytcr_rt5640: Add used AIF to the components string

Depending on which AIF is used the UCM profile needs to setup
a different path through the rt5640's "Digital Mixer Path" graph.

ATM the UCM profiles solve this by just enabling paths to the outputs /
from the input from both AIF1 and AIF2 and then relying on the DAPM
framework to power-down the parts of the graph connected to the
unused AIF.

But in order to be able to use hardware-volumecontrol and to use
the hardware mute controls, which are necessary for mute LED control,
the UCM profiles need to know which AIF is actually being used.

Add a new "aif:1" or "aif:2" part to the component string to provide
info about the used AIF to userspace / to the UCM profiles.

Note the size of byt_rt5640_components is not increased because the
size of 32 chars already is big enough.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307150503.34906-3-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 40e40469
...@@ -1255,6 +1255,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) ...@@ -1255,6 +1255,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
int ret_val = 0; int ret_val = 0;
int dai_index = 0; int dai_index = 0;
int i, cfg_spk; int i, cfg_spk;
int aif;
is_bytcr = false; is_bytcr = false;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
...@@ -1366,8 +1367,12 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) ...@@ -1366,8 +1367,12 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
log_quirks(&pdev->dev); log_quirks(&pdev->dev);
if ((byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2) || if ((byt_rt5640_quirk & BYT_RT5640_SSP2_AIF2) ||
(byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2)) (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2)) {
byt_rt5640_dais[dai_index].codecs->dai_name = "rt5640-aif2"; byt_rt5640_dais[dai_index].codecs->dai_name = "rt5640-aif2";
aif = 2;
} else {
aif = 1;
}
if ((byt_rt5640_quirk & BYT_RT5640_SSP0_AIF1) || if ((byt_rt5640_quirk & BYT_RT5640_SSP0_AIF1) ||
(byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2)) (byt_rt5640_quirk & BYT_RT5640_SSP0_AIF2))
...@@ -1405,8 +1410,8 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) ...@@ -1405,8 +1410,8 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
} }
snprintf(byt_rt5640_components, sizeof(byt_rt5640_components), snprintf(byt_rt5640_components, sizeof(byt_rt5640_components),
"cfg-spk:%d cfg-mic:%s", cfg_spk, "cfg-spk:%d cfg-mic:%s aif:%d", cfg_spk,
map_name[BYT_RT5640_MAP(byt_rt5640_quirk)]); map_name[BYT_RT5640_MAP(byt_rt5640_quirk)], aif);
byt_rt5640_card.components = byt_rt5640_components; byt_rt5640_card.components = byt_rt5640_components;
#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES) #if !IS_ENABLED(CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES)
snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name), snprintf(byt_rt5640_long_name, sizeof(byt_rt5640_long_name),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment