Skip to content

Commit 1ad1b54

Browse files
jwrdegoedelinusw
authored andcommitted
gpiolib: acpi: Turn dmi_system_id table into a generic quirk table
Turn the existing run_edge_events_on_boot_blacklist dmi_system_id table into a generic quirk table, storing the quirks in the driver_data ptr. This is a preparation patch for adding other types of (DMI based) quirks. Cc: [email protected] Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 36f2e72 commit 1ad1b54

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "gpiolib.h"
2222
#include "gpiolib-acpi.h"
2323

24+
#define QUIRK_NO_EDGE_EVENTS_ON_BOOT 0x01l
25+
2426
static int run_edge_events_on_boot = -1;
2527
module_param(run_edge_events_on_boot, int, 0444);
2628
MODULE_PARM_DESC(run_edge_events_on_boot,
@@ -1309,7 +1311,7 @@ static int acpi_gpio_handle_deferred_request_irqs(void)
13091311
/* We must use _sync so that this runs after the first deferred_probe run */
13101312
late_initcall_sync(acpi_gpio_handle_deferred_request_irqs);
13111313

1312-
static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
1314+
static const struct dmi_system_id gpiolib_acpi_quirks[] = {
13131315
{
13141316
/*
13151317
* The Minix Neo Z83-4 has a micro-USB-B id-pin handler for
@@ -1319,7 +1321,8 @@ static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
13191321
.matches = {
13201322
DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
13211323
DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
1322-
}
1324+
},
1325+
.driver_data = (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT,
13231326
},
13241327
{
13251328
/*
@@ -1331,15 +1334,23 @@ static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
13311334
.matches = {
13321335
DMI_MATCH(DMI_SYS_VENDOR, "Wortmann_AG"),
13331336
DMI_MATCH(DMI_PRODUCT_NAME, "TERRA_PAD_1061"),
1334-
}
1337+
},
1338+
.driver_data = (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT,
13351339
},
13361340
{} /* Terminating entry */
13371341
};
13381342

13391343
static int acpi_gpio_setup_params(void)
13401344
{
1345+
const struct dmi_system_id *id;
1346+
long quirks = 0;
1347+
1348+
id = dmi_first_match(gpiolib_acpi_quirks);
1349+
if (id)
1350+
quirks = (long)id->driver_data;
1351+
13411352
if (run_edge_events_on_boot < 0) {
1342-
if (dmi_check_system(run_edge_events_on_boot_blacklist))
1353+
if (quirks & QUIRK_NO_EDGE_EVENTS_ON_BOOT)
13431354
run_edge_events_on_boot = 0;
13441355
else
13451356
run_edge_events_on_boot = 1;

0 commit comments

Comments
 (0)