diff options
Diffstat (limited to 'drivers/acpi/executer/exprep.c')
-rw-r--r-- | drivers/acpi/executer/exprep.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c index 3bde780c94cf..7719ae5d4f16 100644 --- a/drivers/acpi/executer/exprep.c +++ b/drivers/acpi/executer/exprep.c | |||
@@ -274,7 +274,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc, | |||
274 | default: | 274 | default: |
275 | /* Invalid field access type */ | 275 | /* Invalid field access type */ |
276 | 276 | ||
277 | ACPI_REPORT_ERROR(("Unknown field access type %X\n", access)); | 277 | ACPI_ERROR((AE_INFO, "Unknown field access type %X", access)); |
278 | return_UINT32(0); | 278 | return_UINT32(0); |
279 | } | 279 | } |
280 | 280 | ||
@@ -421,13 +421,15 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) | |||
421 | 421 | ||
422 | if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) { | 422 | if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) { |
423 | if (!info->region_node) { | 423 | if (!info->region_node) { |
424 | ACPI_REPORT_ERROR(("Null region_node\n")); | 424 | ACPI_ERROR((AE_INFO, "Null region_node")); |
425 | return_ACPI_STATUS(AE_AML_NO_OPERAND); | 425 | return_ACPI_STATUS(AE_AML_NO_OPERAND); |
426 | } | 426 | } |
427 | 427 | ||
428 | type = acpi_ns_get_type(info->region_node); | 428 | type = acpi_ns_get_type(info->region_node); |
429 | if (type != ACPI_TYPE_REGION) { | 429 | if (type != ACPI_TYPE_REGION) { |
430 | ACPI_REPORT_ERROR(("Needed Region, found type %X (%s)\n", type, acpi_ut_get_type_name(type))); | 430 | ACPI_ERROR((AE_INFO, |
431 | "Needed Region, found type %X (%s)", | ||
432 | type, acpi_ut_get_type_name(type))); | ||
431 | 433 | ||
432 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 434 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
433 | } | 435 | } |
@@ -496,17 +498,17 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) | |||
496 | 498 | ||
497 | case ACPI_TYPE_LOCAL_INDEX_FIELD: | 499 | case ACPI_TYPE_LOCAL_INDEX_FIELD: |
498 | 500 | ||
501 | /* Get the Index and Data registers */ | ||
502 | |||
499 | obj_desc->index_field.index_obj = | 503 | obj_desc->index_field.index_obj = |
500 | acpi_ns_get_attached_object(info->register_node); | 504 | acpi_ns_get_attached_object(info->register_node); |
501 | obj_desc->index_field.data_obj = | 505 | obj_desc->index_field.data_obj = |
502 | acpi_ns_get_attached_object(info->data_register_node); | 506 | acpi_ns_get_attached_object(info->data_register_node); |
503 | obj_desc->index_field.value = (u32) | ||
504 | (info->field_bit_position / | ||
505 | ACPI_MUL_8(obj_desc->field.access_byte_width)); | ||
506 | 507 | ||
507 | if (!obj_desc->index_field.data_obj | 508 | if (!obj_desc->index_field.data_obj |
508 | || !obj_desc->index_field.index_obj) { | 509 | || !obj_desc->index_field.index_obj) { |
509 | ACPI_REPORT_ERROR(("Null Index Object during field prep\n")); | 510 | ACPI_ERROR((AE_INFO, |
511 | "Null Index Object during field prep")); | ||
510 | acpi_ut_delete_object_desc(obj_desc); | 512 | acpi_ut_delete_object_desc(obj_desc); |
511 | return_ACPI_STATUS(AE_AML_INTERNAL); | 513 | return_ACPI_STATUS(AE_AML_INTERNAL); |
512 | } | 514 | } |
@@ -516,6 +518,15 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) | |||
516 | acpi_ut_add_reference(obj_desc->index_field.data_obj); | 518 | acpi_ut_add_reference(obj_desc->index_field.data_obj); |
517 | acpi_ut_add_reference(obj_desc->index_field.index_obj); | 519 | acpi_ut_add_reference(obj_desc->index_field.index_obj); |
518 | 520 | ||
521 | /* | ||
522 | * The value written to the Index register is the byte offset of the | ||
523 | * target field | ||
524 | * Note: may change code to: ACPI_DIV_8 (Info->field_bit_position) | ||
525 | */ | ||
526 | obj_desc->index_field.value = (u32) | ||
527 | (info->field_bit_position / | ||
528 | ACPI_MUL_8(obj_desc->field.access_byte_width)); | ||
529 | |||
519 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 530 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
520 | "index_field: bit_off %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n", | 531 | "index_field: bit_off %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n", |
521 | obj_desc->index_field.start_field_bit_offset, | 532 | obj_desc->index_field.start_field_bit_offset, |