aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/bus.c26
-rw-r--r--include/linux/acpi.h7
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 12240be58f27..65f7e335f122 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -466,6 +466,30 @@ out_kfree:
466} 466}
467EXPORT_SYMBOL(acpi_run_osc); 467EXPORT_SYMBOL(acpi_run_osc);
468 468
469static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
470static void acpi_bus_osc_support(void)
471{
472 u32 capbuf[2];
473 struct acpi_osc_context context = {
474 .uuid_str = sb_uuid_str,
475 .rev = 1,
476 .cap.length = 8,
477 .cap.pointer = capbuf,
478 };
479 acpi_handle handle;
480
481 capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
482 capbuf[OSC_SUPPORT_TYPE] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */
483#ifdef CONFIG_ACPI_PROCESSOR_AGGREGATOR
484 capbuf[OSC_SUPPORT_TYPE] |= OSC_SB_PAD_SUPPORT;
485#endif
486 if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
487 return;
488 if (ACPI_SUCCESS(acpi_run_osc(handle, &context)))
489 kfree(context.ret.pointer);
490 /* do we need to check the returned cap? Sounds no */
491}
492
469/* -------------------------------------------------------------------------- 493/* --------------------------------------------------------------------------
470 Event Management 494 Event Management
471 -------------------------------------------------------------------------- */ 495 -------------------------------------------------------------------------- */
@@ -856,6 +880,8 @@ static int __init acpi_bus_init(void)
856 status = acpi_ec_ecdt_probe(); 880 status = acpi_ec_ecdt_probe();
857 /* Ignore result. Not having an ECDT is not fatal. */ 881 /* Ignore result. Not having an ECDT is not fatal. */
858 882
883 acpi_bus_osc_support();
884
859 status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION); 885 status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
860 if (ACPI_FAILURE(status)) { 886 if (ACPI_FAILURE(status)) {
861 printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n"); 887 printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 535beecc37cf..e11090d462d2 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -273,6 +273,13 @@ struct acpi_osc_context {
273 273
274acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); 274acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
275 275
276/* platform-wide _OSC bits */
277#define OSC_SB_PAD_SUPPORT 1
278#define OSC_SB_PPC_OST_SUPPORT 2
279#define OSC_SB_PR3_SUPPORT 4
280#define OSC_SB_CPUHP_OST_SUPPORT 8
281#define OSC_SB_APEI_SUPPORT 16
282
276/* PCI defined _OSC bits */ 283/* PCI defined _OSC bits */
277/* _OSC DW1 Definition (OS Support Fields) */ 284/* _OSC DW1 Definition (OS Support Fields) */
278#define OSC_EXT_PCI_CONFIG_SUPPORT 1 285#define OSC_EXT_PCI_CONFIG_SUPPORT 1