forked from Minki/linux
ASoC: Intel: sof-rt5682: correct naming for dmic16k
Change the link name to be "dmic16k", the cpu_dai_name to be "DMIC16k Pin", to be aligned with other machine drivers. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
1eed6bc03f
commit
e711223ad3
@ -377,7 +377,7 @@ static struct snd_soc_dai_link_component max98357a_component[] = {
|
|||||||
static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
|
static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
|
||||||
int ssp_codec,
|
int ssp_codec,
|
||||||
int ssp_amp,
|
int ssp_amp,
|
||||||
int dmic_num,
|
int dmic_be_num,
|
||||||
int hdmi_num)
|
int hdmi_num)
|
||||||
{
|
{
|
||||||
struct snd_soc_dai_link_component *idisp_components;
|
struct snd_soc_dai_link_component *idisp_components;
|
||||||
@ -437,20 +437,23 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
|
|||||||
id++;
|
id++;
|
||||||
|
|
||||||
/* dmic */
|
/* dmic */
|
||||||
for (i = 1; i <= dmic_num; i++) {
|
if (dmic_be_num > 0) {
|
||||||
links[id].name = devm_kasprintf(dev, GFP_KERNEL,
|
/* at least we have dmic01 */
|
||||||
"dmic%02d", i);
|
links[id].name = "dmic01";
|
||||||
if (!links[id].name)
|
|
||||||
goto devm_err;
|
|
||||||
|
|
||||||
links[id].id = id;
|
|
||||||
links[id].cpus = &cpus[id];
|
links[id].cpus = &cpus[id];
|
||||||
links[id].num_cpus = 1;
|
links[id].cpus->dai_name = "DMIC01 Pin";
|
||||||
links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL,
|
if (dmic_be_num > 1) {
|
||||||
"DMIC%02d Pin", i);
|
/* set up 2 BE links at most */
|
||||||
if (!links[id].cpus->dai_name)
|
links[id + 1].name = "dmic16k";
|
||||||
goto devm_err;
|
links[id + 1].cpus = &cpus[id + 1];
|
||||||
|
links[id + 1].cpus->dai_name = "DMIC16k Pin";
|
||||||
|
dmic_be_num = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < dmic_be_num; i++) {
|
||||||
|
links[id].id = id;
|
||||||
|
links[id].num_cpus = 1;
|
||||||
links[id].codecs = dmic_component;
|
links[id].codecs = dmic_component;
|
||||||
links[id].num_codecs = ARRAY_SIZE(dmic_component);
|
links[id].num_codecs = ARRAY_SIZE(dmic_component);
|
||||||
links[id].platforms = platform_component;
|
links[id].platforms = platform_component;
|
||||||
@ -545,7 +548,7 @@ static int sof_audio_probe(struct platform_device *pdev)
|
|||||||
struct snd_soc_dai_link *dai_links;
|
struct snd_soc_dai_link *dai_links;
|
||||||
struct snd_soc_acpi_mach *mach;
|
struct snd_soc_acpi_mach *mach;
|
||||||
struct sof_card_private *ctx;
|
struct sof_card_private *ctx;
|
||||||
int dmic_num, hdmi_num;
|
int dmic_be_num, hdmi_num;
|
||||||
int ret, ssp_amp, ssp_codec;
|
int ret, ssp_amp, ssp_codec;
|
||||||
|
|
||||||
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_ATOMIC);
|
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_ATOMIC);
|
||||||
@ -554,14 +557,14 @@ static int sof_audio_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
if (soc_intel_is_byt() || soc_intel_is_cht()) {
|
if (soc_intel_is_byt() || soc_intel_is_cht()) {
|
||||||
is_legacy_cpu = 1;
|
is_legacy_cpu = 1;
|
||||||
dmic_num = 0;
|
dmic_be_num = 0;
|
||||||
hdmi_num = 0;
|
hdmi_num = 0;
|
||||||
/* default quirk for legacy cpu */
|
/* default quirk for legacy cpu */
|
||||||
sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
|
sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
|
||||||
SOF_RT5682_MCLK_BYTCHT_EN |
|
SOF_RT5682_MCLK_BYTCHT_EN |
|
||||||
SOF_RT5682_SSP_CODEC(2);
|
SOF_RT5682_SSP_CODEC(2);
|
||||||
} else {
|
} else {
|
||||||
dmic_num = 1;
|
dmic_be_num = 2;
|
||||||
hdmi_num = 3;
|
hdmi_num = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,13 +589,13 @@ static int sof_audio_probe(struct platform_device *pdev)
|
|||||||
ssp_codec = sof_rt5682_quirk & SOF_RT5682_SSP_CODEC_MASK;
|
ssp_codec = sof_rt5682_quirk & SOF_RT5682_SSP_CODEC_MASK;
|
||||||
|
|
||||||
/* compute number of dai links */
|
/* compute number of dai links */
|
||||||
sof_audio_card_rt5682.num_links = 1 + dmic_num + hdmi_num;
|
sof_audio_card_rt5682.num_links = 1 + dmic_be_num + hdmi_num;
|
||||||
|
|
||||||
if (sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT)
|
if (sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT)
|
||||||
sof_audio_card_rt5682.num_links++;
|
sof_audio_card_rt5682.num_links++;
|
||||||
|
|
||||||
dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp,
|
dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp,
|
||||||
dmic_num, hdmi_num);
|
dmic_be_num, hdmi_num);
|
||||||
if (!dai_links)
|
if (!dai_links)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user