[alsa-devel] [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Thu Nov 1 15:11:49 CET 2018
On Wed, Oct 31, 2018 at 08:07:18PM -0500, Pierre-Louis Bossart wrote:
> For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is
> used on other boards to point to the TDF8532 amplifier. Yay BIOS.
>
> Add a DMI-quirk to ignore this ID and check for other valid machine
> driver descriptors.
> +static unsigned long apl_machine_id;
> +
> +#define APL_RVP 1
> +
> +static int apl_rvp_quirk_cb(const struct dmi_system_id *id)
> +{
> + apl_machine_id = APL_RVP;
> + return 1;
> +}
> +
> +static const struct dmi_system_id apl_table[] = {
> + {
> + .callback = apl_rvp_quirk_cb,
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
> + DMI_MATCH(DMI_BOARD_NAME, "Apollolake RVP1A"),
> + },
> + },
> + {},
Terminator entry doesn't need a comma. It would prevent from (unlikely)
mistakes when extending the list.
> +};
> +
> +static struct snd_soc_acpi_mach *apl_quirk(void *arg)
> +{
> + struct snd_soc_acpi_mach *mach = arg;
> +
> + dmi_check_system(apl_table);
Can't we just use driver_data of the table above and get rid of at least global variable?
> +
> + if (apl_machine_id == APL_RVP)
> + return NULL;
> + else
> + return mach;
> +}
--
With Best Regards,
Andy Shevchenko
More information about the Alsa-devel
mailing list