Commit 52fec4fe authored by Len Brown's avatar Len Brown Committed by Len Brown
parent 23975520
...@@ -442,6 +442,8 @@ acpi_ec_space_handler ( ...@@ -442,6 +442,8 @@ acpi_ec_space_handler (
int result = 0; int result = 0;
struct acpi_ec *ec = NULL; struct acpi_ec *ec = NULL;
u32 temp = 0; u32 temp = 0;
acpi_integer f_v = 0;
int i = 0;
ACPI_FUNCTION_TRACE("acpi_ec_space_handler"); ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
...@@ -456,6 +458,7 @@ acpi_ec_space_handler ( ...@@ -456,6 +458,7 @@ acpi_ec_space_handler (
ec = (struct acpi_ec *) handler_context; ec = (struct acpi_ec *) handler_context;
next_byte:
switch (function) { switch (function) {
case ACPI_READ: case ACPI_READ:
result = acpi_ec_read(ec, (u8) address, &temp); result = acpi_ec_read(ec, (u8) address, &temp);
...@@ -466,9 +469,29 @@ acpi_ec_space_handler ( ...@@ -466,9 +469,29 @@ acpi_ec_space_handler (
break; break;
default: default:
result = -EINVAL; result = -EINVAL;
goto out;
break; break;
} }
bit_width -= 8;
if(bit_width){
if(function == ACPI_READ)
f_v |= (acpi_integer) (*value) << 8*i;
if(function == ACPI_WRITE)
(*value) >>=8;
i++;
goto next_byte;
}
if(function == ACPI_READ){
f_v |= (acpi_integer) (*value) << 8*i;
*value = f_v;
}
out:
switch (result) { switch (result) {
case -EINVAL: case -EINVAL:
return_VALUE(AE_BAD_PARAMETER); return_VALUE(AE_BAD_PARAMETER);
...@@ -483,6 +506,7 @@ acpi_ec_space_handler ( ...@@ -483,6 +506,7 @@ acpi_ec_space_handler (
return_VALUE(AE_OK); return_VALUE(AE_OK);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment