Pull sony into release branch
[pandora-kernel.git] / drivers / acpi / dispatcher / dsfield.c
index 76bc046..f049639 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2007, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
        union acpi_operand_object *second_desc = NULL;
        u32 flags;
 
-       ACPI_FUNCTION_TRACE("ds_create_buffer_field");
+       ACPI_FUNCTION_TRACE(ds_create_buffer_field);
 
        /* Get the name_string argument */
 
@@ -133,7 +133,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
                }
        }
 
-       /* We could put the returned object (Node) on the object stack for later,
+       /*
+        * We could put the returned object (Node) on the object stack for later,
         * but for now, we will put it in the "op" object that the parser uses,
         * so we can get it again at the end of this scope
         */
@@ -210,7 +211,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
        acpi_status status;
        acpi_integer position;
 
-       ACPI_FUNCTION_TRACE_PTR("ds_get_field_names", info);
+       ACPI_FUNCTION_TRACE_PTR(ds_get_field_names, info);
 
        /* First field starts at bit zero */
 
@@ -342,7 +343,7 @@ acpi_ds_create_field(union acpi_parse_object *op,
        union acpi_parse_object *arg;
        struct acpi_create_field_info info;
 
-       ACPI_FUNCTION_TRACE_PTR("ds_create_field", op);
+       ACPI_FUNCTION_TRACE_PTR(ds_create_field, op);
 
        /* First arg is the name of the parent op_region (must already exist) */
 
@@ -399,7 +400,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
        struct acpi_namespace_node *node;
        u8 type = 0;
 
-       ACPI_FUNCTION_TRACE_PTR("ds_init_field_objects", op);
+       ACPI_FUNCTION_TRACE_PTR(ds_init_field_objects, op);
 
        switch (walk_state->opcode) {
        case AML_FIELD_OP:
@@ -425,6 +426,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
         * Walk the list of entries in the field_list
         */
        while (arg) {
+
                /* Ignore OFFSET and ACCESSAS terms here */
 
                if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
@@ -481,7 +483,7 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
        union acpi_parse_object *arg;
        struct acpi_create_field_info info;
 
-       ACPI_FUNCTION_TRACE_PTR("ds_create_bank_field", op);
+       ACPI_FUNCTION_TRACE_PTR(ds_create_bank_field, op);
 
        /* First arg is the name of the parent op_region (must already exist) */
 
@@ -513,8 +515,33 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
 
        /* Third arg is the bank_value */
 
+       /* TBD: This arg is a term_arg, not a constant, and must be evaluated */
+
        arg = arg->common.next;
-       info.bank_value = (u32) arg->common.value.integer;
+
+       /* Currently, only the following constants are supported */
+
+       switch (arg->common.aml_opcode) {
+       case AML_ZERO_OP:
+               info.bank_value = 0;
+               break;
+
+       case AML_ONE_OP:
+               info.bank_value = 1;
+               break;
+
+       case AML_BYTE_OP:
+       case AML_WORD_OP:
+       case AML_DWORD_OP:
+       case AML_QWORD_OP:
+               info.bank_value = (u32) arg->common.value.integer;
+               break;
+
+       default:
+               info.bank_value = 0;
+               ACPI_ERROR((AE_INFO,
+                           "Non-constant BankValue for BankField is not implemented"));
+       }
 
        /* Fourth arg is the field flags */
 
@@ -554,7 +581,7 @@ acpi_ds_create_index_field(union acpi_parse_object *op,
        union acpi_parse_object *arg;
        struct acpi_create_field_info info;
 
-       ACPI_FUNCTION_TRACE_PTR("ds_create_index_field", op);
+       ACPI_FUNCTION_TRACE_PTR(ds_create_index_field, op);
 
        /* First arg is the name of the Index register (must already exist) */