29 #include <linux/kernel.h>
30 #include <linux/module.h>
32 #include <linux/slab.h>
33 #include <linux/types.h>
39 #define PREFIX "ACPI: "
41 #define ACPI_CONTAINER_DEVICE_NAME "ACPI container device"
42 #define ACPI_CONTAINER_CLASS "container"
44 #define INSTALL_NOTIFY_HANDLER 1
45 #define UNINSTALL_NOTIFY_HANDLER 2
47 #define _COMPONENT ACPI_CONTAINER_COMPONENT
54 static int acpi_container_add(
struct acpi_device *
device);
55 static int acpi_container_remove(
struct acpi_device *
device,
int type);
65 static struct acpi_driver acpi_container_driver = {
68 .ids = container_device_ids,
70 .add = acpi_container_add,
71 .remove = acpi_container_remove,
81 unsigned long long sta;
96 static int acpi_container_add(
struct acpi_device *
device)
110 container->
handle = device->handle;
113 device->driver_data = container;
116 acpi_device_name(device), acpi_device_bid(device)));
121 static int acpi_container_remove(
struct acpi_device *device,
int type)
126 pc = acpi_driver_data(device);
131 static int container_device_add(
struct acpi_device **device,
acpi_handle handle)
134 struct acpi_device *
pdev;
146 if (
acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
157 struct acpi_device *device =
NULL;
161 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
169 "ACPI_NOTIFY_BUS_CHECK" :
"ACPI_NOTIFY_DEVICE_CHECK");
171 present = is_device_present(handle);
176 device->flags.eject_pending = 1;
186 result = container_device_add(&device, handle);
193 ost_code = ACPI_OST_SC_SUCCESS;
198 device->flags.eject_pending = 1;
216 u32 lvl,
void *context,
void **rv)
235 if (
strcmp(hid,
"ACPI0004") &&
strcmp(hid,
"PNP0A05") &&
244 container_notify_cb,
NULL);
249 container_notify_cb);
261 static int __init acpi_container_init(
void)
275 container_walk_namespace_cb,
NULL, &action,
NULL);
280 static void __exit acpi_container_exit(
void)
288 container_walk_namespace_cb,
NULL, &action,
NULL);