Skip to content

Commit

Permalink
ASoC: Intel: sof_es8336: use NHLT information to set dmic and SSP
Browse files Browse the repository at this point in the history
This should help remove the need for additional quirks to determine
DMIC and SSP connections.

However we have no means to determine which GPIO might be used, in
that case a DMI quirk or kernel parameter quirk_override will be
required.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  • Loading branch information
plbossart committed Jan 10, 2022
1 parent fbe88e0 commit eef6c90
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions sound/soc/intel/boards/sof_es8336.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,23 @@ static int sof_es8336_probe(struct platform_device *pdev)
card = &sof_es8336_card;
card->dev = dev;

if (!dmi_check_system(sof_es8336_quirk_table))
if (!dmi_check_system(sof_es8336_quirk_table)) {
quirk = SOF_ES8336_SSP_CODEC(2);

if (quirk & SOF_ES8336_ENABLE_DMIC)
dmic_be_num = 2;
} else {
/*
* Set configuration based on platform NHLT.
* In this machine driver, we can only support one SSP for the
* ES8336 link, the else-if below are intentional
*/
if (mach->mach_params.i2s_link_mask & BIT(0))
quirk = SOF_ES8336_SSP_CODEC(0);
else if (mach->mach_params.i2s_link_mask & BIT(1))
quirk = SOF_ES8336_SSP_CODEC(1);
else if (mach->mach_params.i2s_link_mask & BIT(2))
quirk = SOF_ES8336_SSP_CODEC(2);
if (mach->mach_params.dmic_num)
quirk |= SOF_ES8336_ENABLE_DMIC;
}

if (quirk_override != -1) {
dev_info(dev, "Overriding quirk 0x%lx => 0x%x\n",
Expand All @@ -483,6 +495,9 @@ static int sof_es8336_probe(struct platform_device *pdev)
}
log_quirks(dev);

if (quirk & SOF_ES8336_ENABLE_DMIC)
dmic_be_num = 2;

sof_es8336_card.num_links += dmic_be_num + hdmi_num;
dai_links = sof_card_dai_links_create(dev,
SOF_ES8336_SSP_CODEC(quirk),
Expand Down

0 comments on commit eef6c90

Please sign in to comment.