Commit 6d1bfcc5 authored by Hans de Goede's avatar Hans de Goede Committed by Mark Brown

ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handling

Use dmi_first_match() instead of dmi_check_system() + callbacks, this
avoid the need to initialize dmi_system_id.callback for each
byt_rt5640_quirk_table entry.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3c0d0116
...@@ -395,16 +395,9 @@ static int byt_rt5640_aif1_hw_params(struct snd_pcm_substream *substream, ...@@ -395,16 +395,9 @@ static int byt_rt5640_aif1_hw_params(struct snd_pcm_substream *substream,
return byt_rt5640_prepare_and_enable_pll1(dai, params_rate(params)); return byt_rt5640_prepare_and_enable_pll1(dai, params_rate(params));
} }
static int byt_rt5640_quirk_cb(const struct dmi_system_id *id)
{
byt_rt5640_quirk = (unsigned long)id->driver_data;
return 1;
}
/* Please keep this list alphabetically sorted */ /* Please keep this list alphabetically sorted */
static const struct dmi_system_id byt_rt5640_quirk_table[] = { static const struct dmi_system_id byt_rt5640_quirk_table[] = {
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"), DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"), DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"),
...@@ -415,7 +408,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -415,7 +408,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
}, },
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
...@@ -427,7 +419,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -427,7 +419,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
BYT_RT5640_MCLK_EN), BYT_RT5640_MCLK_EN),
}, },
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TAF"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TAF"),
...@@ -439,7 +430,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -439,7 +430,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
BYT_RT5640_MCLK_EN), BYT_RT5640_MCLK_EN),
}, },
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"), DMI_MATCH(DMI_SYS_VENDOR, "Circuitco"),
DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max B3 PLATFORM"), DMI_MATCH(DMI_PRODUCT_NAME, "Minnowboard Max B3 PLATFORM"),
...@@ -447,7 +437,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -447,7 +437,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
.driver_data = (void *)(BYT_RT5640_DMIC1_MAP), .driver_data = (void *)(BYT_RT5640_DMIC1_MAP),
}, },
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Venue 8 Pro 5830"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Venue 8 Pro 5830"),
...@@ -460,7 +449,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -460,7 +449,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
BYT_RT5640_MCLK_EN), BYT_RT5640_MCLK_EN),
}, },
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ElitePad 1000 G2"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "HP ElitePad 1000 G2"),
...@@ -469,7 +457,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -469,7 +457,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
BYT_RT5640_MCLK_EN), BYT_RT5640_MCLK_EN),
}, },
{ {
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"), DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
DMI_MATCH(DMI_BOARD_NAME, "tPAD"), DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
...@@ -479,7 +466,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = { ...@@ -479,7 +466,6 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
BYT_RT5640_SSP0_AIF1), BYT_RT5640_SSP0_AIF1),
}, },
{ /* Catch-all for generic Insyde tablets, must be last */ { /* Catch-all for generic Insyde tablets, must be last */
.callback = byt_rt5640_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
}, },
...@@ -894,6 +880,7 @@ struct acpi_chan_package { /* ACPICA seems to require 64 bit integers */ ...@@ -894,6 +880,7 @@ struct acpi_chan_package { /* ACPICA seems to require 64 bit integers */
static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
{ {
const struct dmi_system_id *dmi_id;
struct byt_rt5640_private *priv; struct byt_rt5640_private *priv;
struct snd_soc_acpi_mach *mach; struct snd_soc_acpi_mach *mach;
const char *i2c_name = NULL; const char *i2c_name = NULL;
...@@ -996,7 +983,9 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) ...@@ -996,7 +983,9 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
} }
/* check quirks before creating card */ /* check quirks before creating card */
dmi_check_system(byt_rt5640_quirk_table); dmi_id = dmi_first_match(byt_rt5640_quirk_table);
if (dmi_id)
byt_rt5640_quirk = (unsigned long)dmi_id->driver_data;
if (quirk_override) { if (quirk_override) {
dev_info(&pdev->dev, "Overriding quirk 0x%x => 0x%x\n", dev_info(&pdev->dev, "Overriding quirk 0x%x => 0x%x\n",
(unsigned int)byt_rt5640_quirk, quirk_override); (unsigned int)byt_rt5640_quirk, quirk_override);
......
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