diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-03 17:08:16 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-04 08:25:32 -0500 |
commit | 3f8055c3583640ed3e4c81864dd76e06a7faa505 (patch) | |
tree | c77ae4121942fc43be57cd603435f1a9dcb78b3d /include/acpi | |
parent | 4b59cc1fd6fd1dac1d4468b4f327ae9f59d1c0aa (diff) |
ACPI / hotplug: Introduce user space interface for hotplug profiles
Introduce user space interface for manipulating hotplug profiles
associated with ACPI scan handlers.
The interface consists of sysfs directories under
/sys/firmware/acpi/hotplug/, one for each hotplug profile, containing
an attribute allowing user space to manipulate the enabled field of
the corresponding profile. Namely, switching the enabled attribute
from '0' to '1' will cause the common hotplug notify handler to be
installed for all ACPI namespace objects representing devices matching
the scan handler associated with the given hotplug profile (and
analogously for the converse switch).
Drivers willing to use the new user space interface should add their
ACPI scan handlers with the help of new funtion
acpi_scan_add_handler_with_hotplug().
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acpi_bus.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index f2c1d08a4798..533ef039c5e0 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -95,10 +95,17 @@ enum acpi_hotplug_mode { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct acpi_hotplug_profile { | 97 | struct acpi_hotplug_profile { |
98 | struct kobject kobj; | ||
98 | bool enabled:1; | 99 | bool enabled:1; |
99 | enum acpi_hotplug_mode mode; | 100 | enum acpi_hotplug_mode mode; |
100 | }; | 101 | }; |
101 | 102 | ||
103 | static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( | ||
104 | struct kobject *kobj) | ||
105 | { | ||
106 | return container_of(kobj, struct acpi_hotplug_profile, kobj); | ||
107 | } | ||
108 | |||
102 | struct acpi_scan_handler { | 109 | struct acpi_scan_handler { |
103 | const struct acpi_device_id *ids; | 110 | const struct acpi_device_id *ids; |
104 | struct list_head list_node; | 111 | struct list_head list_node; |