aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-30 08:27:29 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-30 08:27:29 -0500
commitca589f9469641916f4f9bd6a820012a27102ef63 (patch)
tree2bce51955303a0d33e2c52d37f0052ac19c1d445 /include/acpi
parent8b4e2fa4ff72ba2c9f01af8def15d4c4eeeeed64 (diff)
ACPI / scan: Introduce struct acpi_scan_handler
Introduce struct acpi_scan_handler for representing objects that will do configuration tasks depending on ACPI device nodes' hardware IDs (HIDs). Currently, those tasks are done either directly by the ACPI namespace scanning code or by ACPI device drivers designed specifically for this purpose. None of the above is desirable, however, because doing that directly in the namespace scanning code makes that code overly complicated and difficult to follow and doing that in "special" device drivers leads to a great deal of confusion about their role and to confusing interactions with the driver core (for example, sysfs directories are created for those drivers, but they are completely unnecessary and only increase the kernel's memory footprint in vain). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_bus.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index ad0a86ac5cce..41850cb21730 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -84,6 +84,18 @@ struct acpi_driver;
84struct acpi_device; 84struct acpi_device;
85 85
86/* 86/*
87 * ACPI Scan Handler
88 * -----------------
89 */
90
91struct acpi_scan_handler {
92 const struct acpi_device_id *ids;
93 struct list_head list_node;
94 int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
95 void (*detach)(struct acpi_device *dev);
96};
97
98/*
87 * ACPI Driver 99 * ACPI Driver
88 * ----------- 100 * -----------
89 */ 101 */
@@ -269,6 +281,7 @@ struct acpi_device {
269 struct acpi_device_wakeup wakeup; 281 struct acpi_device_wakeup wakeup;
270 struct acpi_device_perf performance; 282 struct acpi_device_perf performance;
271 struct acpi_device_dir dir; 283 struct acpi_device_dir dir;
284 struct acpi_scan_handler *handler;
272 struct acpi_driver *driver; 285 struct acpi_driver *driver;
273 void *driver_data; 286 void *driver_data;
274 struct device dev; 287 struct device dev;
@@ -382,6 +395,7 @@ int acpi_bus_receive_event(struct acpi_bus_event *event);
382static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) 395static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
383 { return 0; } 396 { return 0; }
384#endif 397#endif
398int acpi_scan_add_handler(struct acpi_scan_handler *handler);
385int acpi_bus_register_driver(struct acpi_driver *driver); 399int acpi_bus_register_driver(struct acpi_driver *driver);
386void acpi_bus_unregister_driver(struct acpi_driver *driver); 400void acpi_bus_unregister_driver(struct acpi_driver *driver);
387int acpi_bus_scan(acpi_handle handle); 401int acpi_bus_scan(acpi_handle handle);