summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utils.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-03 02:26:33 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-03 02:26:33 -0400
commitc50e86ce7c2961a41f2f7aa6e4fd6c99229ba205 (patch)
tree4ea36009719bd8fc523239fe1bdccb90f0dce3ae /drivers/acpi/utils.c
parent14d33d384693eb6083396199de516fdef320f7af (diff)
parent4cbe5a555fa58a79b6ecbb6c531b8bab0650778d (diff)
Merge tag 'v3.6-rc4'
Merge 3.6-rc4 to get latest OMAP and device tree fixes.
Diffstat (limited to 'drivers/acpi/utils.c')
-rw-r--r--drivers/acpi/utils.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index adbbc1c80a26..3e87c9c538aa 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -412,3 +412,45 @@ out:
412 return status; 412 return status;
413} 413}
414EXPORT_SYMBOL(acpi_get_physical_device_location); 414EXPORT_SYMBOL(acpi_get_physical_device_location);
415
416/**
417 * acpi_evaluate_hotplug_ost: Evaluate _OST for hotplug operations
418 * @handle: ACPI device handle
419 * @source_event: source event code
420 * @status_code: status code
421 * @status_buf: optional detailed information (NULL if none)
422 *
423 * Evaluate _OST for hotplug operations. All ACPI hotplug handlers
424 * must call this function when evaluating _OST for hotplug operations.
425 * When the platform does not support _OST, this function has no effect.
426 */
427acpi_status
428acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
429 u32 status_code, struct acpi_buffer *status_buf)
430{
431#ifdef ACPI_HOTPLUG_OST
432 union acpi_object params[3] = {
433 {.type = ACPI_TYPE_INTEGER,},
434 {.type = ACPI_TYPE_INTEGER,},
435 {.type = ACPI_TYPE_BUFFER,}
436 };
437 struct acpi_object_list arg_list = {3, params};
438 acpi_status status;
439
440 params[0].integer.value = source_event;
441 params[1].integer.value = status_code;
442 if (status_buf != NULL) {
443 params[2].buffer.pointer = status_buf->pointer;
444 params[2].buffer.length = status_buf->length;
445 } else {
446 params[2].buffer.pointer = NULL;
447 params[2].buffer.length = 0;
448 }
449
450 status = acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
451 return status;
452#else
453 return AE_OK;
454#endif
455}
456EXPORT_SYMBOL(acpi_evaluate_hotplug_ost);