Merge branches 'acpi-scan' and 'acpi-tables'
[linux-2.6-block.git] / include / acpi / acpi_bus.h
index e3cbf92da3700d440540d6b13c60698e81ecdc40..50a07d134506f16d463b56cb4480875328386ccb 100644 (file)
@@ -9,8 +9,13 @@
 #ifndef __ACPI_BUS_H__
 #define __ACPI_BUS_H__
 
+#include <linux/completion.h>
+#include <linux/container_of.h>
 #include <linux/device.h>
+#include <linux/kobject.h>
+#include <linux/mutex.h>
 #include <linux/property.h>
+#include <linux/types.h>
 
 struct acpi_handle_list {
        u32 count;
@@ -124,8 +129,8 @@ static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
 }
 
 struct acpi_scan_handler {
-       const struct acpi_device_id *ids;
        struct list_head list_node;
+       const struct acpi_device_id *ids;
        bool (*match)(const char *idstr, const struct acpi_device_id **matchid);
        int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
        void (*detach)(struct acpi_device *dev);
@@ -139,11 +144,15 @@ struct acpi_scan_handler {
  * --------------------
  */
 
+typedef int (*acpi_hp_notify) (struct acpi_device *, u32);
+typedef void (*acpi_hp_uevent) (struct acpi_device *, u32);
+typedef void (*acpi_hp_fixup) (struct acpi_device *);
+
 struct acpi_hotplug_context {
        struct acpi_device *self;
-       int (*notify)(struct acpi_device *, u32);
-       void (*uevent)(struct acpi_device *, u32);
-       void (*fixup)(struct acpi_device *);
+       acpi_hp_notify notify;
+       acpi_hp_uevent uevent;
+       acpi_hp_fixup fixup;
 };
 
 /*
@@ -268,6 +277,7 @@ struct acpi_device_power_flags {
 };
 
 struct acpi_device_power_state {
+       struct list_head resources;     /* Power resources referenced */
        struct {
                u8 valid:1;
                u8 explicit_set:1;      /* _PSx present? */
@@ -275,7 +285,6 @@ struct acpi_device_power_state {
        } flags;
        int power;              /* % Power (compared to D0) */
        int latency;            /* Dx->D0 time (microseconds) */
-       struct list_head resources;     /* Power resources referenced */
 };
 
 struct acpi_device_power {
@@ -341,16 +350,16 @@ struct acpi_device_wakeup {
 };
 
 struct acpi_device_physical_node {
-       unsigned int node_id;
        struct list_head node;
        struct device *dev;
+       unsigned int node_id;
        bool put_online:1;
 };
 
 struct acpi_device_properties {
+       struct list_head list;
        const guid_t *guid;
        union acpi_object *properties;
-       struct list_head list;
        void **bufs;
 };
 
@@ -487,12 +496,12 @@ struct acpi_device {
 
 /* Non-device subnode */
 struct acpi_data_node {
+       struct list_head sibling;
        const char *name;
        acpi_handle handle;
        struct fwnode_handle fwnode;
        struct fwnode_handle *parent;
        struct acpi_device_data data;
-       struct list_head sibling;
        struct kobject kobj;
        struct completion kobj_done;
 };
@@ -577,8 +586,7 @@ static inline void acpi_set_hp_context(struct acpi_device *adev,
 
 void acpi_initialize_hp_context(struct acpi_device *adev,
                                struct acpi_hotplug_context *hp,
-                               int (*notify)(struct acpi_device *, u32),
-                               void (*uevent)(struct acpi_device *, u32));
+                               acpi_hp_notify notify, acpi_hp_uevent uevent);
 
 /* acpi_device.dev.bus == &acpi_bus_type */
 extern const struct bus_type acpi_bus_type;