aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-21 08:10:56 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-21 08:10:56 -0400
commit082c119da469ae3f68740d7866776c1bd4a9dda7 (patch)
tree160cdfda1435953a95f0da6ef0986d1440ee8899
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
parent9fc3d1d09cf7f81d5775712dc64c3db4862ee59d (diff)
Merge branch 'acpica'
* acpica: ACPICA: Update version to 20140926. ACPICA: acpiexec: Do not put STDIN into raw mode unless it is a terminal. ACPICA: iASL/Disassembler: Add support for hardware summary mapfiles. ACPICA: Events: Reduce source code difference for the ACPI_EVENT_FLAG_HANDLE renaming. ACPICA: Events: Reduce source code difference for the ACPI_EVENT_FLAG_HANDLE support. ACPICA: Events: Update GPE handler removal, match behavior of handler install. ACPICA: Events: Reduce source code difference in acpi_install_gpe_handler(). ACPICA: Events: Reduce indent divergences of events files. ACPICA: acpidump: Add ACPI 1.0 RSDP support. ACPICA: Add string for _DDN method name.
-rw-r--r--drivers/acpi/acpica/achware.h2
-rw-r--r--drivers/acpi/acpica/aclocal.h4
-rw-r--r--drivers/acpi/acpica/actables.h2
-rw-r--r--drivers/acpi/acpica/amlresrc.h34
-rw-r--r--drivers/acpi/acpica/evgpe.c23
-rw-r--r--drivers/acpi/acpica/evgpeinit.c1
-rw-r--r--drivers/acpi/acpica/evxface.c27
-rw-r--r--drivers/acpi/acpica/evxfevnt.c40
-rw-r--r--drivers/acpi/acpica/evxfgpe.c12
-rw-r--r--drivers/acpi/acpica/hwgpe.c9
-rw-r--r--drivers/acpi/acpica/tbxfroot.c33
-rw-r--r--drivers/acpi/scan.c2
-rw-r--r--drivers/acpi/sysfs.c4
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/actypes.h4
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixxf.c8
-rw-r--r--tools/power/acpi/tools/acpidump/apdump.c2
18 files changed, 156 insertions, 54 deletions
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
index 2ad2351a9833..c318d3e27893 100644
--- a/drivers/acpi/acpica/achware.h
+++ b/drivers/acpi/acpica/achware.h
@@ -127,7 +127,7 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
127 127
128acpi_status 128acpi_status
129acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, 129acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
130 acpi_event_status * event_status); 130 acpi_event_status *event_status);
131 131
132acpi_status acpi_hw_disable_all_gpes(void); 132acpi_status acpi_hw_disable_all_gpes(void);
133 133
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 2747279fbe3c..c00e7e41ad75 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -413,8 +413,8 @@ struct acpi_gpe_handler_info {
413 acpi_gpe_handler address; /* Address of handler, if any */ 413 acpi_gpe_handler address; /* Address of handler, if any */
414 void *context; /* Context to be passed to handler */ 414 void *context; /* Context to be passed to handler */
415 struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ 415 struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
416 u8 original_flags; /* Original (pre-handler) GPE info */ 416 u8 original_flags; /* Original (pre-handler) GPE info */
417 u8 originally_enabled; /* True if GPE was originally enabled */ 417 u8 originally_enabled; /* True if GPE was originally enabled */
418}; 418};
419 419
420/* Notify info for implicit notify, multiple device objects */ 420/* Notify info for implicit notify, multiple device objects */
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index f14882788eee..1afe46e44dac 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -49,6 +49,8 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count);
49/* 49/*
50 * tbxfroot - Root pointer utilities 50 * tbxfroot - Root pointer utilities
51 */ 51 */
52u32 acpi_tb_get_rsdp_length(struct acpi_table_rsdp *rsdp);
53
52acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp); 54acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
53 55
54u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length); 56u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length);
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index f3f834408441..3a0beeb86ba5 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -117,6 +117,12 @@ struct asl_resource_node {
117 struct asl_resource_node *next; 117 struct asl_resource_node *next;
118}; 118};
119 119
120struct asl_resource_info {
121 union acpi_parse_object *descriptor_type_op; /* Resource descriptor parse node */
122 union acpi_parse_object *mapping_op; /* Used for mapfile support */
123 u32 current_byte_offset; /* Offset in resource template */
124};
125
120/* Macros used to generate AML resource length fields */ 126/* Macros used to generate AML resource length fields */
121 127
122#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (struct aml_resource_large_header)) 128#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (struct aml_resource_large_header))
@@ -449,4 +455,32 @@ union aml_resource {
449 u8 byte_item; 455 u8 byte_item;
450}; 456};
451 457
458/* Interfaces used by both the disassembler and compiler */
459
460void
461mp_save_gpio_info(union acpi_parse_object *op,
462 union aml_resource *resource,
463 u32 pin_count, u16 *pin_list, char *device_name);
464
465void
466mp_save_serial_info(union acpi_parse_object *op,
467 union aml_resource *resource, char *device_name);
468
469char *mp_get_hid_from_parse_tree(struct acpi_namespace_node *hid_node);
470
471char *mp_get_hid_via_namestring(char *device_name);
472
473char *mp_get_connection_info(union acpi_parse_object *op,
474 u32 pin_index,
475 struct acpi_namespace_node **target_node,
476 char **target_name);
477
478char *mp_get_parent_device_hid(union acpi_parse_object *op,
479 struct acpi_namespace_node **target_node,
480 char **parent_device_name);
481
482char *mp_get_ddn_value(char *device_name);
483
484char *mp_get_hid_value(struct acpi_namespace_node *device_node);
485
452#endif 486#endif
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index e4ba4dec86af..2095dfb72bcb 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -100,13 +100,14 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
100 * 100 *
101 * FUNCTION: acpi_ev_enable_gpe 101 * FUNCTION: acpi_ev_enable_gpe
102 * 102 *
103 * PARAMETERS: gpe_event_info - GPE to enable 103 * PARAMETERS: gpe_event_info - GPE to enable
104 * 104 *
105 * RETURN: Status 105 * RETURN: Status
106 * 106 *
107 * DESCRIPTION: Clear a GPE of stale events and enable it. 107 * DESCRIPTION: Clear a GPE of stale events and enable it.
108 * 108 *
109 ******************************************************************************/ 109 ******************************************************************************/
110
110acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info) 111acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
111{ 112{
112 acpi_status status; 113 acpi_status status;
@@ -125,6 +126,7 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
125 } 126 }
126 127
127 /* Clear the GPE (of stale events) */ 128 /* Clear the GPE (of stale events) */
129
128 status = acpi_hw_clear_gpe(gpe_event_info); 130 status = acpi_hw_clear_gpe(gpe_event_info);
129 if (ACPI_FAILURE(status)) { 131 if (ACPI_FAILURE(status)) {
130 return_ACPI_STATUS(status); 132 return_ACPI_STATUS(status);
@@ -136,7 +138,6 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
136 return_ACPI_STATUS(status); 138 return_ACPI_STATUS(status);
137} 139}
138 140
139
140/******************************************************************************* 141/*******************************************************************************
141 * 142 *
142 * FUNCTION: acpi_ev_add_gpe_reference 143 * FUNCTION: acpi_ev_add_gpe_reference
@@ -212,7 +213,7 @@ acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
212 if (ACPI_SUCCESS(status)) { 213 if (ACPI_SUCCESS(status)) {
213 status = 214 status =
214 acpi_hw_low_set_gpe(gpe_event_info, 215 acpi_hw_low_set_gpe(gpe_event_info,
215 ACPI_GPE_DISABLE); 216 ACPI_GPE_DISABLE);
216 } 217 }
217 218
218 if (ACPI_FAILURE(status)) { 219 if (ACPI_FAILURE(status)) {
@@ -334,7 +335,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
334 * 335 *
335 ******************************************************************************/ 336 ******************************************************************************/
336 337
337u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) 338u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
338{ 339{
339 acpi_status status; 340 acpi_status status;
340 struct acpi_gpe_block_info *gpe_block; 341 struct acpi_gpe_block_info *gpe_block;
@@ -427,7 +428,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
427 428
428 /* Check if there is anything active at all in this register */ 429 /* Check if there is anything active at all in this register */
429 430
430 enabled_status_byte = (u8) (status_reg & enable_reg); 431 enabled_status_byte = (u8)(status_reg & enable_reg);
431 if (!enabled_status_byte) { 432 if (!enabled_status_byte) {
432 433
433 /* No active GPEs in this register, move on */ 434 /* No active GPEs in this register, move on */
@@ -450,7 +451,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
450 acpi_ev_gpe_dispatch(gpe_block-> 451 acpi_ev_gpe_dispatch(gpe_block->
451 node, 452 node,
452 &gpe_block-> 453 &gpe_block->
453 event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number); 454 event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number);
454 } 455 }
455 } 456 }
456 } 457 }
@@ -636,7 +637,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_enable_gpe(void *context)
636 * 637 *
637 ******************************************************************************/ 638 ******************************************************************************/
638 639
639acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info *gpe_event_info) 640acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info * gpe_event_info)
640{ 641{
641 acpi_status status; 642 acpi_status status;
642 643
@@ -666,9 +667,9 @@ acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info *gpe_event_info)
666 * 667 *
667 * FUNCTION: acpi_ev_gpe_dispatch 668 * FUNCTION: acpi_ev_gpe_dispatch
668 * 669 *
669 * PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1 670 * PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1
670 * gpe_event_info - Info for this GPE 671 * gpe_event_info - Info for this GPE
671 * gpe_number - Number relative to the parent GPE block 672 * gpe_number - Number relative to the parent GPE block
672 * 673 *
673 * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED 674 * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
674 * 675 *
@@ -681,7 +682,7 @@ acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info *gpe_event_info)
681 682
682u32 683u32
683acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, 684acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
684 struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) 685 struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
685{ 686{
686 acpi_status status; 687 acpi_status status;
687 u32 return_value; 688 u32 return_value;
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 49fc7effd961..7be928379879 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -424,6 +424,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
424 } 424 }
425 425
426 /* Disable the GPE in case it's been enabled already. */ 426 /* Disable the GPE in case it's been enabled already. */
427
427 (void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE); 428 (void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
428 429
429 /* 430 /*
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 11e5803b8b41..55a58f3ec8df 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -786,18 +786,26 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
786 handler->method_node = gpe_event_info->dispatch.method_node; 786 handler->method_node = gpe_event_info->dispatch.method_node;
787 handler->original_flags = (u8)(gpe_event_info->flags & 787 handler->original_flags = (u8)(gpe_event_info->flags &
788 (ACPI_GPE_XRUPT_TYPE_MASK | 788 (ACPI_GPE_XRUPT_TYPE_MASK |
789 ACPI_GPE_DISPATCH_MASK)); 789 ACPI_GPE_DISPATCH_MASK));
790 790
791 /* 791 /*
792 * If the GPE is associated with a method, it may have been enabled 792 * If the GPE is associated with a method, it may have been enabled
793 * automatically during initialization, in which case it has to be 793 * automatically during initialization, in which case it has to be
794 * disabled now to avoid spurious execution of the handler. 794 * disabled now to avoid spurious execution of the handler.
795 */ 795 */
796 796 if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) ||
797 if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) 797 (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) &&
798 && gpe_event_info->runtime_count) { 798 gpe_event_info->runtime_count) {
799 handler->originally_enabled = 1; 799 handler->originally_enabled = TRUE;
800 (void)acpi_ev_remove_gpe_reference(gpe_event_info); 800 (void)acpi_ev_remove_gpe_reference(gpe_event_info);
801
802 /* Sanity check of original type against new type */
803
804 if (type !=
805 (u32)(gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK)) {
806 ACPI_WARNING((AE_INFO,
807 "GPE type mismatch (level/edge)"));
808 }
801 } 809 }
802 810
803 /* Install the handler */ 811 /* Install the handler */
@@ -808,7 +816,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
808 816
809 gpe_event_info->flags &= 817 gpe_event_info->flags &=
810 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 818 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
811 gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER); 819 gpe_event_info->flags |= (u8)(type | ACPI_GPE_DISPATCH_HANDLER);
812 820
813 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 821 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
814 822
@@ -893,7 +901,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
893 901
894 gpe_event_info->dispatch.method_node = handler->method_node; 902 gpe_event_info->dispatch.method_node = handler->method_node;
895 gpe_event_info->flags &= 903 gpe_event_info->flags &=
896 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 904 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
897 gpe_event_info->flags |= handler->original_flags; 905 gpe_event_info->flags |= handler->original_flags;
898 906
899 /* 907 /*
@@ -901,7 +909,8 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
901 * enabled, it should be enabled at this point to restore the 909 * enabled, it should be enabled at this point to restore the
902 * post-initialization configuration. 910 * post-initialization configuration.
903 */ 911 */
904 if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) && 912 if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) ||
913 (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) &&
905 handler->originally_enabled) { 914 handler->originally_enabled) {
906 (void)acpi_ev_add_gpe_reference(gpe_event_info); 915 (void)acpi_ev_add_gpe_reference(gpe_event_info);
907 } 916 }
@@ -946,7 +955,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler)
946 * handle is returned. 955 * handle is returned.
947 * 956 *
948 ******************************************************************************/ 957 ******************************************************************************/
949acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle) 958acpi_status acpi_acquire_global_lock(u16 timeout, u32 *handle)
950{ 959{
951 acpi_status status; 960 acpi_status status;
952 961
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index e286640ad4ff..bb8cbf5961bf 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -324,8 +324,9 @@ ACPI_EXPORT_SYMBOL(acpi_clear_event)
324 ******************************************************************************/ 324 ******************************************************************************/
325acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status) 325acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
326{ 326{
327 acpi_status status = AE_OK; 327 acpi_status status;
328 u32 value; 328 acpi_event_status local_event_status = 0;
329 u32 in_byte;
329 330
330 ACPI_FUNCTION_TRACE(acpi_get_event_status); 331 ACPI_FUNCTION_TRACE(acpi_get_event_status);
331 332
@@ -339,29 +340,40 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
339 return_ACPI_STATUS(AE_BAD_PARAMETER); 340 return_ACPI_STATUS(AE_BAD_PARAMETER);
340 } 341 }
341 342
342 /* Get the status of the requested fixed event */ 343 /* Fixed event currently can be dispatched? */
344
345 if (acpi_gbl_fixed_event_handlers[event].handler) {
346 local_event_status |= ACPI_EVENT_FLAG_HAS_HANDLER;
347 }
348
349 /* Fixed event currently enabled? */
343 350
344 status = 351 status =
345 acpi_read_bit_register(acpi_gbl_fixed_event_info[event]. 352 acpi_read_bit_register(acpi_gbl_fixed_event_info[event].
346 enable_register_id, &value); 353 enable_register_id, &in_byte);
347 if (ACPI_FAILURE(status)) 354 if (ACPI_FAILURE(status)) {
348 return_ACPI_STATUS(status); 355 return_ACPI_STATUS(status);
356 }
349 357
350 *event_status = value; 358 if (in_byte) {
359 local_event_status |= ACPI_EVENT_FLAG_ENABLED;
360 }
361
362 /* Fixed event currently active? */
351 363
352 status = 364 status =
353 acpi_read_bit_register(acpi_gbl_fixed_event_info[event]. 365 acpi_read_bit_register(acpi_gbl_fixed_event_info[event].
354 status_register_id, &value); 366 status_register_id, &in_byte);
355 if (ACPI_FAILURE(status)) 367 if (ACPI_FAILURE(status)) {
356 return_ACPI_STATUS(status); 368 return_ACPI_STATUS(status);
369 }
357 370
358 if (value) 371 if (in_byte) {
359 *event_status |= ACPI_EVENT_FLAG_SET; 372 local_event_status |= ACPI_EVENT_FLAG_SET;
360 373 }
361 if (acpi_gbl_fixed_event_handlers[event].handler)
362 *event_status |= ACPI_EVENT_FLAG_HANDLE;
363 374
364 return_ACPI_STATUS(status); 375 (*event_status) = local_event_status;
376 return_ACPI_STATUS(AE_OK);
365} 377}
366 378
367ACPI_EXPORT_SYMBOL(acpi_get_event_status) 379ACPI_EXPORT_SYMBOL(acpi_get_event_status)
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 56710a03c9b0..e889a5304abd 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -106,8 +106,8 @@ ACPI_EXPORT_SYMBOL(acpi_update_all_gpes)
106 * 106 *
107 * FUNCTION: acpi_enable_gpe 107 * FUNCTION: acpi_enable_gpe
108 * 108 *
109 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 109 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
110 * gpe_number - GPE level within the GPE block 110 * gpe_number - GPE level within the GPE block
111 * 111 *
112 * RETURN: Status 112 * RETURN: Status
113 * 113 *
@@ -115,7 +115,6 @@ ACPI_EXPORT_SYMBOL(acpi_update_all_gpes)
115 * hardware-enabled. 115 * hardware-enabled.
116 * 116 *
117 ******************************************************************************/ 117 ******************************************************************************/
118
119acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number) 118acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
120{ 119{
121 acpi_status status = AE_BAD_PARAMETER; 120 acpi_status status = AE_BAD_PARAMETER;
@@ -490,8 +489,8 @@ ACPI_EXPORT_SYMBOL(acpi_clear_gpe)
490 * 489 *
491 * FUNCTION: acpi_get_gpe_status 490 * FUNCTION: acpi_get_gpe_status
492 * 491 *
493 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 492 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
494 * gpe_number - GPE level within the GPE block 493 * gpe_number - GPE level within the GPE block
495 * event_status - Where the current status of the event 494 * event_status - Where the current status of the event
496 * will be returned 495 * will be returned
497 * 496 *
@@ -524,9 +523,6 @@ acpi_get_gpe_status(acpi_handle gpe_device,
524 523
525 status = acpi_hw_get_gpe_status(gpe_event_info, event_status); 524 status = acpi_hw_get_gpe_status(gpe_event_info, event_status);
526 525
527 if (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)
528 *event_status |= ACPI_EVENT_FLAG_HANDLE;
529
530unlock_and_exit: 526unlock_and_exit:
531 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 527 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
532 return_ACPI_STATUS(status); 528 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index ea62d40fd161..48ac7b7b59cd 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -202,7 +202,7 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
202 202
203acpi_status 203acpi_status
204acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info, 204acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
205 acpi_event_status * event_status) 205 acpi_event_status *event_status)
206{ 206{
207 u32 in_byte; 207 u32 in_byte;
208 u32 register_bit; 208 u32 register_bit;
@@ -216,6 +216,13 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
216 return (AE_BAD_PARAMETER); 216 return (AE_BAD_PARAMETER);
217 } 217 }
218 218
219 /* GPE currently handled? */
220
221 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) !=
222 ACPI_GPE_DISPATCH_NONE) {
223 local_event_status |= ACPI_EVENT_FLAG_HAS_HANDLER;
224 }
225
219 /* Get the info block for the entire GPE register */ 226 /* Get the info block for the entire GPE register */
220 227
221 gpe_register_info = gpe_event_info->register_info; 228 gpe_register_info = gpe_event_info->register_info;
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 65ab8fed3d5e..43a54af2b548 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -50,6 +50,36 @@ ACPI_MODULE_NAME("tbxfroot")
50 50
51/******************************************************************************* 51/*******************************************************************************
52 * 52 *
53 * FUNCTION: acpi_tb_get_rsdp_length
54 *
55 * PARAMETERS: rsdp - Pointer to RSDP
56 *
57 * RETURN: Table length
58 *
59 * DESCRIPTION: Get the length of the RSDP
60 *
61 ******************************************************************************/
62u32 acpi_tb_get_rsdp_length(struct acpi_table_rsdp *rsdp)
63{
64
65 if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) {
66
67 /* BAD Signature */
68
69 return (0);
70 }
71
72 /* "Length" field is available if table version >= 2 */
73
74 if (rsdp->revision >= 2) {
75 return (rsdp->length);
76 } else {
77 return (ACPI_RSDP_CHECKSUM_LENGTH);
78 }
79}
80
81/*******************************************************************************
82 *
53 * FUNCTION: acpi_tb_validate_rsdp 83 * FUNCTION: acpi_tb_validate_rsdp
54 * 84 *
55 * PARAMETERS: rsdp - Pointer to unvalidated RSDP 85 * PARAMETERS: rsdp - Pointer to unvalidated RSDP
@@ -59,7 +89,8 @@ ACPI_MODULE_NAME("tbxfroot")
59 * DESCRIPTION: Validate the RSDP (ptr) 89 * DESCRIPTION: Validate the RSDP (ptr)
60 * 90 *
61 ******************************************************************************/ 91 ******************************************************************************/
62acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) 92
93acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp * rsdp)
63{ 94{
64 95
65 /* 96 /*
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index ae44d8654c82..f1d96e7519cb 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1470,7 +1470,7 @@ static void acpi_wakeup_gpe_init(struct acpi_device *device)
1470 if (ACPI_FAILURE(status)) 1470 if (ACPI_FAILURE(status))
1471 return; 1471 return;
1472 1472
1473 wakeup->flags.run_wake = !!(event_status & ACPI_EVENT_FLAG_HANDLE); 1473 wakeup->flags.run_wake = !!(event_status & ACPI_EVENT_FLAG_HAS_HANDLER);
1474} 1474}
1475 1475
1476static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device) 1476static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 38cb9782d4b8..13e577c80201 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -537,7 +537,7 @@ static ssize_t counter_show(struct kobject *kobj,
537 if (result) 537 if (result)
538 goto end; 538 goto end;
539 539
540 if (!(status & ACPI_EVENT_FLAG_HANDLE)) 540 if (!(status & ACPI_EVENT_FLAG_HAS_HANDLER))
541 size += sprintf(buf + size, " invalid"); 541 size += sprintf(buf + size, " invalid");
542 else if (status & ACPI_EVENT_FLAG_ENABLED) 542 else if (status & ACPI_EVENT_FLAG_ENABLED)
543 size += sprintf(buf + size, " enabled"); 543 size += sprintf(buf + size, " enabled");
@@ -581,7 +581,7 @@ static ssize_t counter_set(struct kobject *kobj,
581 if (result) 581 if (result)
582 goto end; 582 goto end;
583 583
584 if (!(status & ACPI_EVENT_FLAG_HANDLE)) { 584 if (!(status & ACPI_EVENT_FLAG_HAS_HANDLER)) {
585 printk(KERN_WARNING PREFIX 585 printk(KERN_WARNING PREFIX
586 "Can not change Invalid GPE/Fixed Event status\n"); 586 "Can not change Invalid GPE/Fixed Event status\n");
587 return -EINVAL; 587 return -EINVAL;
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index f97804bdf1ff..7461327e14e4 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -52,6 +52,7 @@
52#define METHOD_NAME__CBA "_CBA" 52#define METHOD_NAME__CBA "_CBA"
53#define METHOD_NAME__CID "_CID" 53#define METHOD_NAME__CID "_CID"
54#define METHOD_NAME__CRS "_CRS" 54#define METHOD_NAME__CRS "_CRS"
55#define METHOD_NAME__DDN "_DDN"
55#define METHOD_NAME__HID "_HID" 56#define METHOD_NAME__HID "_HID"
56#define METHOD_NAME__INI "_INI" 57#define METHOD_NAME__INI "_INI"
57#define METHOD_NAME__PLD "_PLD" 58#define METHOD_NAME__PLD "_PLD"
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 9fc1d71c82bc..ab2acf629a64 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20140828 49#define ACPI_CA_VERSION 0x20140926
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index ac03ec81d342..7000e66f768e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -721,7 +721,7 @@ typedef u32 acpi_event_type;
721 * | | | +--- Enabled for wake? 721 * | | | +--- Enabled for wake?
722 * | | +----- Set? 722 * | | +----- Set?
723 * | +------- Has a handler? 723 * | +------- Has a handler?
724 * +----------- <Reserved> 724 * +------------- <Reserved>
725 */ 725 */
726typedef u32 acpi_event_status; 726typedef u32 acpi_event_status;
727 727
@@ -729,7 +729,7 @@ typedef u32 acpi_event_status;
729#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 729#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01
730#define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02 730#define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02
731#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 731#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04
732#define ACPI_EVENT_FLAG_HANDLE (acpi_event_status) 0x08 732#define ACPI_EVENT_FLAG_HAS_HANDLER (acpi_event_status) 0x08
733 733
734/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ 734/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
735 735
diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c
index 60b58cd18410..7ccb073f8316 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixxf.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c
@@ -122,6 +122,14 @@ static void os_enter_line_edit_mode(void)
122{ 122{
123 struct termios local_term_attributes; 123 struct termios local_term_attributes;
124 124
125 term_attributes_were_set = 0;
126
127 /* STDIN must be a terminal */
128
129 if (!isatty(STDIN_FILENO)) {
130 return;
131 }
132
125 /* Get and keep the original attributes */ 133 /* Get and keep the original attributes */
126 134
127 if (tcgetattr(STDIN_FILENO, &original_term_attributes)) { 135 if (tcgetattr(STDIN_FILENO, &original_term_attributes)) {
diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c
index 53cee781e24e..24d32968802d 100644
--- a/tools/power/acpi/tools/acpidump/apdump.c
+++ b/tools/power/acpi/tools/acpidump/apdump.c
@@ -146,7 +146,7 @@ u32 ap_get_table_length(struct acpi_table_header *table)
146 146
147 if (ACPI_VALIDATE_RSDP_SIG(table->signature)) { 147 if (ACPI_VALIDATE_RSDP_SIG(table->signature)) {
148 rsdp = ACPI_CAST_PTR(struct acpi_table_rsdp, table); 148 rsdp = ACPI_CAST_PTR(struct acpi_table_rsdp, table);
149 return (rsdp->length); 149 return (acpi_tb_get_rsdp_length(rsdp));
150 } 150 }
151 151
152 /* Normal ACPI table */ 152 /* Normal ACPI table */