All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: tiwai@suse.de, vinod.koul@intel.com, alsa-devel@alsa-project.org,
	broonie@kernel.org, liam.r.girdwood@linux.intel.com
Subject: Re: [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards
Date: Thu, 1 Nov 2018 16:11:49 +0200	[thread overview]
Message-ID: <20181101141149.GV10650@smile.fi.intel.com> (raw)
In-Reply-To: <20181101010718.2878-8-pierre-louis.bossart@linux.intel.com>

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

  parent reply	other threads:[~2018-11-01 14:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01  1:07 [PATCH 0/7] ASoC: Intel: cleanups Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 1/7] ASoC: acpi: define common interface for machine driver configuration Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 2/7] ASoC: Intel: use standard interface for Hdaudio machine driver Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 3/7] ASoC: Intel: use standard interface for Atom machine drivers Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 4/7] ASoC: Intel: boards: fix Skylake typo Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 5/7] ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 6/7] ASoC: Intel: common: add SOF information for APL RVP Pierre-Louis Bossart
2018-11-01  1:07 ` [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards Pierre-Louis Bossart
2018-11-01  2:35   ` Keyon Jie
2018-11-01 14:11   ` Andy Shevchenko [this message]
2018-11-01 15:08     ` Pierre-Louis Bossart
2018-11-01 14:12 ` [PATCH 0/7] ASoC: Intel: cleanups Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181101141149.GV10650@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.