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

ASoC: Intel: Unify the thinkpad10 and aegex10 byt-match quirks

There is no reason to have separate quirk-handlers / byt_machine_id-s
for these.

These are both cases of BYT devices with a 10EC5640 ACPI HID while using
a rt5672 codec.

The Dell Venue 10 Pro 5055 is another example of such a device, instead
of adding a third byt_machine_id definition for this Dell model, make
change the 2 existing cases into a generic BYT_RT5672 byt_machine_id
in preparation for adding a quirk for the Dell Venue 10 Pro 5055.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210402140747.174716-2-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 628166c3
...@@ -11,13 +11,12 @@ ...@@ -11,13 +11,12 @@
static unsigned long byt_machine_id; static unsigned long byt_machine_id;
#define BYT_THINKPAD_10 1 #define BYT_RT5672 1
#define BYT_POV_P1006W 2 #define BYT_POV_P1006W 2
#define BYT_AEGEX_10 3
static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id) static int byt_rt5672_quirk_cb(const struct dmi_system_id *id)
{ {
byt_machine_id = BYT_THINKPAD_10; byt_machine_id = BYT_RT5672;
return 1; return 1;
} }
...@@ -27,36 +26,30 @@ static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id) ...@@ -27,36 +26,30 @@ static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
return 1; return 1;
} }
static int byt_aegex10_quirk_cb(const struct dmi_system_id *id)
{
byt_machine_id = BYT_AEGEX_10;
return 1;
}
static const struct dmi_system_id byt_table[] = { static const struct dmi_system_id byt_table[] = {
{ {
.callback = byt_thinkpad10_quirk_cb, .callback = byt_rt5672_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"), DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 8"),
}, },
}, },
{ {
.callback = byt_thinkpad10_quirk_cb, .callback = byt_rt5672_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"), DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad 10"),
}, },
}, },
{ {
.callback = byt_thinkpad10_quirk_cb, .callback = byt_rt5672_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"), DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Tablet B"),
}, },
}, },
{ {
.callback = byt_thinkpad10_quirk_cb, .callback = byt_rt5672_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"), DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Miix 2 10"),
...@@ -75,7 +68,7 @@ static const struct dmi_system_id byt_table[] = { ...@@ -75,7 +68,7 @@ static const struct dmi_system_id byt_table[] = {
}, },
{ {
/* Aegex 10 tablet (RU2) */ /* Aegex 10 tablet (RU2) */
.callback = byt_aegex10_quirk_cb, .callback = byt_rt5672_quirk_cb,
.matches = { .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"), DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"), DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
...@@ -84,8 +77,8 @@ static const struct dmi_system_id byt_table[] = { ...@@ -84,8 +77,8 @@ static const struct dmi_system_id byt_table[] = {
{ } { }
}; };
/* The Thinkapd 10 and Aegex 10 tablets have the same ID problem */ /* Various devices use an ACPI id of 10EC5640 while using a rt5672 codec */
static struct snd_soc_acpi_mach byt_thinkpad_10 = { static struct snd_soc_acpi_mach byt_rt5672 = {
.id = "10EC5640", .id = "10EC5640",
.drv_name = "cht-bsw-rt5672", .drv_name = "cht-bsw-rt5672",
.fw_filename = "intel/fw_sst_0f28.bin", .fw_filename = "intel/fw_sst_0f28.bin",
...@@ -110,9 +103,8 @@ static struct snd_soc_acpi_mach *byt_quirk(void *arg) ...@@ -110,9 +103,8 @@ static struct snd_soc_acpi_mach *byt_quirk(void *arg)
dmi_check_system(byt_table); dmi_check_system(byt_table);
switch (byt_machine_id) { switch (byt_machine_id) {
case BYT_THINKPAD_10: case BYT_RT5672:
case BYT_AEGEX_10: return &byt_rt5672;
return &byt_thinkpad_10;
case BYT_POV_P1006W: case BYT_POV_P1006W:
return &byt_pov_p1006w; return &byt_pov_p1006w;
default: default:
......
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