aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2008-08-27 22:03:26 -0400
committerLen Brown <len.brown@intel.com>2008-09-23 22:59:29 -0400
commit406f692d0803d73acd3984c1e11719d3a913fd5e (patch)
treea1c0b1c5e6f9478e9b3fff91561f2173bd789023 /drivers/acpi
parent82545394e0690aaef446cb262aa5dac0f9c7156e (diff)
dock: add _LCK support
support _LCK method, which is a optional method for hotplug lenb: we have not seen _LCK used in the field yet Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/dock.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 78d27cef573f..7bdf93b74690 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -452,6 +452,25 @@ static inline void complete_undock(struct dock_station *ds)
452 ds->flags &= ~(DOCK_UNDOCKING); 452 ds->flags &= ~(DOCK_UNDOCKING);
453} 453}
454 454
455static void dock_lock(struct dock_station *ds, int lock)
456{
457 struct acpi_object_list arg_list;
458 union acpi_object arg;
459 acpi_status status;
460
461 arg_list.count = 1;
462 arg_list.pointer = &arg;
463 arg.type = ACPI_TYPE_INTEGER;
464 arg.integer.value = !!lock;
465 status = acpi_evaluate_object(ds->handle, "_LCK", &arg_list, NULL);
466 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
467 if (lock)
468 printk(KERN_WARNING PREFIX "Locking device failed\n");
469 else
470 printk(KERN_WARNING PREFIX "Unlocking device failed\n");
471 }
472}
473
455/** 474/**
456 * dock_in_progress - see if we are in the middle of handling a dock event 475 * dock_in_progress - see if we are in the middle of handling a dock event
457 * @ds: the dock station 476 * @ds: the dock station
@@ -577,6 +596,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
577 596
578 hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST); 597 hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
579 undock(ds); 598 undock(ds);
599 dock_lock(ds, 0);
580 eject_dock(ds); 600 eject_dock(ds);
581 if (dock_present(ds)) { 601 if (dock_present(ds)) {
582 printk(KERN_ERR PREFIX "Unable to undock!\n"); 602 printk(KERN_ERR PREFIX "Unable to undock!\n");
@@ -617,6 +637,7 @@ static void dock_notify(acpi_handle handle, u32 event, void *data)
617 hotplug_dock_devices(ds, event); 637 hotplug_dock_devices(ds, event);
618 complete_dock(ds); 638 complete_dock(ds);
619 dock_event(ds, event, DOCK_EVENT); 639 dock_event(ds, event, DOCK_EVENT);
640 dock_lock(ds, 1);
620 } 641 }
621 break; 642 break;
622 case ACPI_NOTIFY_DEVICE_CHECK: 643 case ACPI_NOTIFY_DEVICE_CHECK: