1 From: Shaohua Li <shaohua.li@intel.com>
2 Subject: add _LCK support for dock
3 Patch-mainline: submitted 2008-08-28
4 References: fate#304731,bnc#401740
6 support _LCK method, which is a optional method for hotplug
8 Signed-off-by: Shaohua Li <shaohua.li@intel.com>
9 Signed-off-by: Holger Macht <hmacht@suse.de>
12 diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
13 index 78d27ce..7bdf93b 100644
14 --- a/drivers/acpi/dock.c
15 +++ b/drivers/acpi/dock.c
16 @@ -452,6 +452,25 @@ static inline void complete_undock(struct dock_station *ds)
17 ds->flags &= ~(DOCK_UNDOCKING);
20 +static void dock_lock(struct dock_station *ds, int lock)
22 + struct acpi_object_list arg_list;
23 + union acpi_object arg;
27 + arg_list.pointer = &arg;
28 + arg.type = ACPI_TYPE_INTEGER;
29 + arg.integer.value = !!lock;
30 + status = acpi_evaluate_object(ds->handle, "_LCK", &arg_list, NULL);
31 + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
33 + printk(KERN_WARNING PREFIX "Locking device failed\n");
35 + printk(KERN_WARNING PREFIX "Unlocking device failed\n");
40 * dock_in_progress - see if we are in the middle of handling a dock event
41 * @ds: the dock station
42 @@ -577,6 +596,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
44 hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
48 if (dock_present(ds)) {
49 printk(KERN_ERR PREFIX "Unable to undock!\n");
50 @@ -617,6 +637,7 @@ static void dock_notify(acpi_handle handle, u32 event, void *data)
51 hotplug_dock_devices(ds, event);
53 dock_event(ds, event, DOCK_EVENT);
57 case ACPI_NOTIFY_DEVICE_CHECK: