summaryrefslogtreecommitdiff
path: root/include/linux/pnp.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-11-18 03:05:19 +0300
committerLen Brown <len.brown@intel.com>2009-12-16 01:35:26 +0300
commit9065ce4500085b9ca66b19d3c4d21a73cb410173 (patch)
treec487e3f9b3b56cc829ea2362a33b888a42d83f8f /include/linux/pnp.h
parentc4da6940a7a41c72781ff2d62ebd4b99f3749f14 (diff)
downloadlinux-9065ce4500085b9ca66b19d3c4d21a73cb410173.tar.xz
PNP: add interface to retrieve ACPI device from a PNPACPI device
Add pnp_acpi_device(pnp_dev), which takes a PNP device and returns the associated ACPI device (or NULL, if the device is not a PNPACPI device). This allows us to write a PNP driver that can manage both traditional PNPBIOS and ACPI devices, treating ACPI-only functionality as an optional extension. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/pnp.h')
-rw-r--r--include/linux/pnp.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index fddfafaed024..7c4193eb0072 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -334,6 +334,19 @@ extern struct pnp_protocol pnpbios_protocol;
#define pnp_device_is_pnpbios(dev) 0
#endif
+#ifdef CONFIG_PNPACPI
+extern struct pnp_protocol pnpacpi_protocol;
+
+static inline struct acpi_device *pnp_acpi_device(struct pnp_dev *dev)
+{
+ if (dev->protocol == &pnpacpi_protocol)
+ return dev->data;
+ return NULL;
+}
+#else
+#define pnp_acpi_device(dev) 0
+#endif
+
/* status */
#define PNP_READY 0x0000
#define PNP_ATTACHED 0x0001