Skip to content

Commit

Permalink
leds: Add more product/board names for PC Engines APU2
Browse files Browse the repository at this point in the history
PC Engines "legacy" coreboot 4.0.8 changed the product/board name
from "APU2" to "apu2".
PC Engines "mainline" coreboot uses, instead, "PC Engines apu2" as
product/board name.

This commit adds the 2 variants ("apu2" and "PC Engines apu2") of
product/board name to be compatible with all the APU2 BIOSes.

Fixes: 3faee94 ("leds: Add driver for PC Engines APU/APU2 LEDs")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
  • Loading branch information
Timothy Redaelli authored and Jacek Anaszewski committed Feb 19, 2018
1 parent 386570d commit 2dd1ea5
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions drivers/leds/leds-apu.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,30 @@ static const struct dmi_system_id apu_led_dmi_table[] __initconst = {
DMI_MATCH(DMI_PRODUCT_NAME, "APU")
}
},
/* PC Engines APU2 with "Legacy" bios < 4.0.8 */
{
.ident = "apu2",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"),
DMI_MATCH(DMI_BOARD_NAME, "APU2")
}
},
/* PC Engines APU2 with "Legacy" bios >= 4.0.8 */
{
.ident = "apu2",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"),
DMI_MATCH(DMI_BOARD_NAME, "apu2")
}
},
/* PC Engines APU2 with "Mainline" bios */
{
.ident = "apu2",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"),
DMI_MATCH(DMI_BOARD_NAME, "PC Engines apu2")
}
},
{}
};
MODULE_DEVICE_TABLE(dmi, apu_led_dmi_table);
Expand Down Expand Up @@ -211,7 +228,9 @@ static int __init apu_led_probe(struct platform_device *pdev)
apu_led->platform = APU1_LED_PLATFORM;
apu_led->num_led_instances = ARRAY_SIZE(apu1_led_profile);
apu_led->iosize = APU1_IOSIZE;
} else if (dmi_match(DMI_BOARD_NAME, "APU2")) {
} else if (dmi_match(DMI_BOARD_NAME, "APU2") ||
dmi_match(DMI_BOARD_NAME, "apu2") ||
dmi_match(DMI_BOARD_NAME, "PC Engines apu2")) {
apu_led->profile = apu2_led_profile;
apu_led->platform = APU2_LED_PLATFORM;
apu_led->num_led_instances = ARRAY_SIZE(apu2_led_profile);
Expand All @@ -237,7 +256,10 @@ static int __init apu_led_init(void)
pr_err("No PC Engines board detected\n");
return -ENODEV;
}
if (!(dmi_match(DMI_PRODUCT_NAME, "APU") || dmi_match(DMI_PRODUCT_NAME, "APU2"))) {
if (!(dmi_match(DMI_PRODUCT_NAME, "APU") ||
dmi_match(DMI_PRODUCT_NAME, "APU2") ||
dmi_match(DMI_PRODUCT_NAME, "apu2") ||
dmi_match(DMI_PRODUCT_NAME, "PC Engines apu2"))) {
pr_err("Unknown PC Engines board: %s\n",
dmi_get_system_info(DMI_PRODUCT_NAME));
return -ENODEV;
Expand Down

0 comments on commit 2dd1ea5

Please sign in to comment.