From patchwork Wed Dec 8 21:36:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 392192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB8LbXKR022691 for ; Wed, 8 Dec 2010 21:37:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755806Ab0LHVgZ (ORCPT ); Wed, 8 Dec 2010 16:36:25 -0500 Received: from g4t0017.houston.hp.com ([15.201.24.20]:40756 "EHLO g4t0017.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755724Ab0LHVgW (ORCPT ); Wed, 8 Dec 2010 16:36:22 -0500 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0017.houston.hp.com (Postfix) with ESMTP id 8E63D38310; Wed, 8 Dec 2010 21:36:22 +0000 (UTC) Received: from ldl (ldl.usa.hp.com [16.125.112.222]) by g4t0009.houston.hp.com (Postfix) with ESMTP id 5CD62C170; Wed, 8 Dec 2010 21:36:22 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 4C07ACF002A; Wed, 8 Dec 2010 14:36:22 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ur8Ln+eqg7TD; Wed, 8 Dec 2010 14:36:22 -0700 (MST) Received: from eh.fc.hp.com (bob.lnx.usa.hp.com [16.125.112.218]) by ldl (Postfix) with ESMTP id 33C95CF0029; Wed, 8 Dec 2010 14:36:22 -0700 (MST) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 178C426200; Wed, 8 Dec 2010 14:36:22 -0700 (MST) Subject: [PATCH 4/5] PNP: add framework for platform PNP quirks To: Jesse Barnes , Len Brown From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, "H. Peter Anvin" , Thomas Gleixner , Linus Torvalds , Ingo Molnar , Adam Belay Date: Wed, 08 Dec 2010 14:36:22 -0700 Message-ID: <20101208213621.13026.87155.stgit@bob.kio> In-Reply-To: <20101208213606.13026.47657.stgit@bob.kio> References: <20101208213606.13026.47657.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 08 Dec 2010 21:37:34 +0000 (UTC) diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 19bc736..dca301e 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h @@ -7,6 +7,8 @@ extern spinlock_t pnp_lock; extern struct device_attribute pnp_interface_attrs[]; void *pnp_alloc(long size); +void platform_pnp_fixups(void); + int pnp_register_protocol(struct pnp_protocol *protocol); void pnp_unregister_protocol(struct pnp_protocol *protocol); diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 0f34d96..5076493 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -212,7 +212,14 @@ void __pnp_remove_device(struct pnp_dev *dev) static int __init pnp_init(void) { - return bus_register(&pnp_bus_type); + int ret; + + ret = bus_register(&pnp_bus_type); + if (ret) + return ret; + + platform_pnp_fixups(); + return 0; } subsys_initcall(pnp_init); diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index dfbd5a6..f18bb69 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -337,3 +338,17 @@ void pnp_fixup_device(struct pnp_dev *dev) f->quirk_function(dev); } } + +static struct pnp_protocol pnp_fixup_protocol = { + .name = "Plug and Play fixup", +}; + +static const struct dmi_system_id pnp_fixup_table[] __initconst = { + {} +}; + +void __init platform_pnp_fixups(void) +{ + pnp_register_protocol(&pnp_fixup_protocol); + dmi_check_system(pnp_fixup_table); +}