From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0AC3C43215 for ; Fri, 22 Nov 2019 19:23:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D5BA2071F for ; Fri, 22 Nov 2019 19:23:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cJcGCYcl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbfKVTXs (ORCPT ); Fri, 22 Nov 2019 14:23:48 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:25901 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726747AbfKVTXs (ORCPT ); Fri, 22 Nov 2019 14:23:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574450626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B0prvImqtBY2NgHE8spXeOl7Uw63z03nHrCNy0kOOwc=; b=cJcGCYclBHKqTXE9KXRxeoKr8mfwXhxjbdIa/RsLd1t4CMwqRarU9Tz9HUBvqYKUH3yN8f wizh+KHLNWodb4xASCtIkkzns6RZ6+cltbV68O+oB61dIBqZUg3i+3du4aFWwEDNPDoQpL WeGnEerixs87eJGSH/JY7+bPrcVcv+k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-ufeGOtLnMp2eukxObRgeiw-1; Fri, 22 Nov 2019 14:23:45 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BD95800054; Fri, 22 Nov 2019 19:23:44 +0000 (UTC) Received: from dhcp-44-196.space.revspace.nl (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CD3D1084192; Fri, 22 Nov 2019 19:23:42 +0000 (UTC) From: Hans de Goede To: Mika Westerberg , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski Cc: Hans de Goede , "Rafael J . Wysocki" , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH 1/2] gpiolib: acpi: Turn dmi_system_id table into a generic quirk table Date: Fri, 22 Nov 2019 20:23:33 +0100 Message-Id: <20191122192334.61490-2-hdegoede@redhat.com> In-Reply-To: <20191122192334.61490-1-hdegoede@redhat.com> References: <20191122192334.61490-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: ufeGOtLnMp2eukxObRgeiw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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. Signed-off-by: Hans de Goede --- drivers/gpio/gpiolib-acpi.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index d30e57dc755c..2b47d906d536 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -21,6 +21,8 @@ #include "gpiolib.h" #include "gpiolib-acpi.h" =20 +#define QUIRK_NO_EDGE_EVENTS_ON_BOOT=09=090x01l + static int run_edge_events_on_boot =3D -1; module_param(run_edge_events_on_boot, int, 0444); MODULE_PARM_DESC(run_edge_events_on_boot, @@ -1309,7 +1311,7 @@ static int acpi_gpio_handle_deferred_request_irqs(voi= d) /* We must use _sync so that this runs after the first deferred_probe run = */ late_initcall_sync(acpi_gpio_handle_deferred_request_irqs); =20 -static const struct dmi_system_id run_edge_events_on_boot_blacklist[] =3D = { +static const struct dmi_system_id gpiolib_acpi_quirks[] =3D { =09{ =09=09/* =09=09 * 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[] =3D { =09=09.matches =3D { =09=09=09DMI_MATCH(DMI_SYS_VENDOR, "MINIX"), =09=09=09DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"), -=09=09} +=09=09}, +=09=09.driver_data =3D (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT, =09}, =09{ =09=09/* @@ -1331,15 +1334,23 @@ static const struct dmi_system_id run_edge_events_o= n_boot_blacklist[] =3D { =09=09.matches =3D { =09=09=09DMI_MATCH(DMI_SYS_VENDOR, "Wortmann_AG"), =09=09=09DMI_MATCH(DMI_PRODUCT_NAME, "TERRA_PAD_1061"), -=09=09} +=09=09}, +=09=09.driver_data =3D (void *)QUIRK_NO_EDGE_EVENTS_ON_BOOT, =09}, =09{} /* Terminating entry */ }; =20 static int acpi_gpio_setup_params(void) { +=09const struct dmi_system_id *id; +=09long quirks =3D 0; + +=09id =3D dmi_first_match(gpiolib_acpi_quirks); +=09if (id) +=09=09quirks =3D (long)id->driver_data; + =09if (run_edge_events_on_boot < 0) { -=09=09if (dmi_check_system(run_edge_events_on_boot_blacklist)) +=09=09if (quirks & QUIRK_NO_EDGE_EVENTS_ON_BOOT) =09=09=09run_edge_events_on_boot =3D 0; =09=09else =09=09=09run_edge_events_on_boot =3D 1; --=20 2.23.0