aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acpi_bus.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 17:45:04 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 17:45:04 -0500
commit25d412d932fb3289ae5b510845d523330b80bb71 (patch)
tree7234bf9bf03af4b0f1f40830169cd7219ef586ed /include/acpi/acpi_bus.h
parent98feb7cc61c50fe0fa36eeb994d5db527ca9e103 (diff)
parentc713cd7f2d799c50a0721bf51d178ea9567215dd (diff)
Merge branch 'acpi-hotplug'
* acpi-hotplug: ACPI / scan: ACPI device object sysfs attribute for _STA evaluation ACPI / hotplug / driver core: Handle containers in a special way ACPI / hotplug: Add demand_offline hotplug profile flag ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c ACPI / bind: Pass struct acpi_device pointer to acpi_bind_one() ACPI / bind: Rework struct acpi_bus_type ACPI / bind: Redefine acpi_preset_companion() ACPI / bind: Redefine acpi_get_child() PCI / ACPI: Use acpi_find_child_device() for child devices lookup ACPI / bind: Simplify child device lookups ACPI / scan: Use direct recurrence for device hierarchy walks ACPI: Introduce acpi_set_device_status() ACPI / hotplug: Drop unfinished global notification handling routines ACPI / hotplug: Rework generic code to handle suprise removals ACPI / hotplug: Move container-specific code out of the core ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug() ACPI / hotplug: Do not fail bus and device checks for disabled hotplug ACPI / scan: Add acpi_device objects for all device nodes in the namespace ACPI / scan: Define non-empty device removal handler
Diffstat (limited to 'include/acpi/acpi_bus.h')
-rw-r--r--include/acpi/acpi_bus.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index fa42b45461ad..e4ab7be65637 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -89,17 +89,11 @@ struct acpi_device;
89 * ----------------- 89 * -----------------
90 */ 90 */
91 91
92enum acpi_hotplug_mode {
93 AHM_GENERIC = 0,
94 AHM_CONTAINER,
95 AHM_COUNT
96};
97
98struct acpi_hotplug_profile { 92struct acpi_hotplug_profile {
99 struct kobject kobj; 93 struct kobject kobj;
94 int (*scan_dependent)(struct acpi_device *adev);
100 bool enabled:1; 95 bool enabled:1;
101 bool ignore:1; 96 bool demand_offline:1;
102 enum acpi_hotplug_mode mode;
103}; 97};
104 98
105static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( 99static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
@@ -167,8 +161,10 @@ struct acpi_device_flags {
167 u32 ejectable:1; 161 u32 ejectable:1;
168 u32 power_manageable:1; 162 u32 power_manageable:1;
169 u32 match_driver:1; 163 u32 match_driver:1;
164 u32 initialized:1;
165 u32 visited:1;
170 u32 no_hotplug:1; 166 u32 no_hotplug:1;
171 u32 reserved:26; 167 u32 reserved:24;
172}; 168};
173 169
174/* File System */ 170/* File System */
@@ -298,6 +294,7 @@ struct acpi_device {
298 struct list_head children; 294 struct list_head children;
299 struct list_head node; 295 struct list_head node;
300 struct list_head wakeup_list; 296 struct list_head wakeup_list;
297 struct list_head del_list;
301 struct acpi_device_status status; 298 struct acpi_device_status status;
302 struct acpi_device_flags flags; 299 struct acpi_device_flags flags;
303 struct acpi_device_pnp pnp; 300 struct acpi_device_pnp pnp;
@@ -323,6 +320,11 @@ static inline void *acpi_driver_data(struct acpi_device *d)
323#define to_acpi_device(d) container_of(d, struct acpi_device, dev) 320#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
324#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) 321#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
325 322
323static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
324{
325 *((u32 *)&adev->status) = sta;
326}
327
326/* acpi_device.dev.bus == &acpi_bus_type */ 328/* acpi_device.dev.bus == &acpi_bus_type */
327extern struct bus_type acpi_bus_type; 329extern struct bus_type acpi_bus_type;
328 330
@@ -385,6 +387,11 @@ int acpi_match_device_ids(struct acpi_device *device,
385int acpi_create_dir(struct acpi_device *); 387int acpi_create_dir(struct acpi_device *);
386void acpi_remove_dir(struct acpi_device *); 388void acpi_remove_dir(struct acpi_device *);
387 389
390static inline bool acpi_device_enumerated(struct acpi_device *adev)
391{
392 return adev && adev->flags.initialized && adev->flags.visited;
393}
394
388typedef void (*acpi_hp_callback)(void *data, u32 src); 395typedef void (*acpi_hp_callback)(void *data, u32 src);
389 396
390acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src); 397acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src);
@@ -408,7 +415,7 @@ struct acpi_bus_type {
408 struct list_head list; 415 struct list_head list;
409 const char *name; 416 const char *name;
410 bool (*match)(struct device *dev); 417 bool (*match)(struct device *dev);
411 int (*find_device) (struct device *, acpi_handle *); 418 struct acpi_device * (*find_companion)(struct device *);
412 void (*setup)(struct device *); 419 void (*setup)(struct device *);
413 void (*cleanup)(struct device *); 420 void (*cleanup)(struct device *);
414}; 421};
@@ -427,12 +434,9 @@ struct acpi_pci_root {
427}; 434};
428 435
429/* helper */ 436/* helper */
430acpi_handle acpi_find_child(acpi_handle, u64, bool); 437
431static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr) 438struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
432{ 439 u64 address, bool check_children);
433 return acpi_find_child(handle, addr, false);
434}
435void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr);
436int acpi_is_root_bridge(acpi_handle); 440int acpi_is_root_bridge(acpi_handle);
437struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); 441struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
438 442