diff options
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acpi_bus.h | 38 | ||||
-rw-r--r-- | include/acpi/acpi_drivers.h | 3 | ||||
-rw-r--r-- | include/acpi/acpi_io.h | 17 |
3 files changed, 37 insertions, 21 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index ddabed1f51c2..e4ab7be65637 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -28,8 +28,6 @@ #include <linux/device.h> -#include <acpi/acpi.h> - /* TBD: Make dynamic */ #define ACPI_MAX_HANDLES 10 struct acpi_handle_list { @@ -91,17 +89,11 @@ struct acpi_device; * ----------------- */ -enum acpi_hotplug_mode { - AHM_GENERIC = 0, - AHM_CONTAINER, - AHM_COUNT -}; - struct acpi_hotplug_profile { struct kobject kobj; + int (*scan_dependent)(struct acpi_device *adev); bool enabled:1; - bool ignore:1; - enum acpi_hotplug_mode mode; + bool demand_offline:1; }; static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( @@ -169,8 +161,10 @@ struct acpi_device_flags { u32 ejectable:1; u32 power_manageable:1; u32 match_driver:1; + u32 initialized:1; + u32 visited:1; u32 no_hotplug:1; - u32 reserved:26; + u32 reserved:24; }; /* File System */ @@ -300,6 +294,7 @@ struct acpi_device { struct list_head children; struct list_head node; struct list_head wakeup_list; + struct list_head del_list; struct acpi_device_status status; struct acpi_device_flags flags; struct acpi_device_pnp pnp; @@ -325,6 +320,11 @@ static inline void *acpi_driver_data(struct acpi_device *d) #define to_acpi_device(d) container_of(d, struct acpi_device, dev) #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) +static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) +{ + *((u32 *)&adev->status) = sta; +} + /* acpi_device.dev.bus == &acpi_bus_type */ extern struct bus_type acpi_bus_type; @@ -387,6 +387,11 @@ int acpi_match_device_ids(struct acpi_device *device, int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); +static inline bool acpi_device_enumerated(struct acpi_device *adev) +{ + return adev && adev->flags.initialized && adev->flags.visited; +} + typedef void (*acpi_hp_callback)(void *data, u32 src); acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src); @@ -410,7 +415,7 @@ struct acpi_bus_type { struct list_head list; const char *name; bool (*match)(struct device *dev); - int (*find_device) (struct device *, acpi_handle *); + struct acpi_device * (*find_companion)(struct device *); void (*setup)(struct device *); void (*cleanup)(struct device *); }; @@ -429,12 +434,9 @@ struct acpi_pci_root { }; /* helper */ -acpi_handle acpi_find_child(acpi_handle, u64, bool); -static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr) -{ - return acpi_find_child(handle, addr, false); -} -void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr); + +struct acpi_device *acpi_find_child_device(struct acpi_device *parent, + u64 address, bool check_children); int acpi_is_root_bridge(acpi_handle); struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 1cedfcb1bd88..b124fdb26046 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -26,9 +26,6 @@ #ifndef __ACPI_DRIVERS_H__ #define __ACPI_DRIVERS_H__ -#include <linux/acpi.h> -#include <acpi/acpi_bus.h> - #define ACPI_MAX_STRING 80 /* diff --git a/include/acpi/acpi_io.h b/include/acpi/acpi_io.h new file mode 100644 index 000000000000..2be858018c7f --- /dev/null +++ b/include/acpi/acpi_io.h @@ -0,0 +1,17 @@ +#ifndef _ACPI_IO_H_ +#define _ACPI_IO_H_ + +#include <linux/io.h> + +static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, + acpi_size size) +{ + return ioremap_cache(phys, size); +} + +void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); + +int acpi_os_map_generic_address(struct acpi_generic_address *addr); +void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); + +#endif |