2.6.32.28 update
/drivers/acpi/ec.c
blob:960696a4b362341d89507dcea8295d9eef3f512e -> blob:f1670e0ef9bb7fb7836ee30af5769bb9430f6f50
--- drivers/acpi/ec.c
+++ drivers/acpi/ec.c
@@ -588,12 +588,12 @@ static u32 acpi_ec_gpe_handler(void *dat
static acpi_status
acpi_ec_space_handler(u32 function, acpi_physical_address address,
- u32 bits, acpi_integer *value64,
+ u32 bits, acpi_integer *value,
void *handler_context, void *region_context)
{
struct acpi_ec *ec = handler_context;
- int result = 0, i, bytes = bits / 8;
- u8 *value = (u8 *)value64;
+ int result = 0, i;
+ u8 temp = 0;
if ((address > 0xFF) || !value || !handler_context)
return AE_BAD_PARAMETER;
@@ -601,15 +601,32 @@ acpi_ec_space_handler(u32 function, acpi
if (function != ACPI_READ && function != ACPI_WRITE)
return AE_BAD_PARAMETER;
- if (EC_FLAGS_MSI || bits > 8)
+ if (bits != 8 && acpi_strict)
+ return AE_BAD_PARAMETER;
+
+ if (EC_FLAGS_MSI)
acpi_ec_burst_enable(ec);
- for (i = 0; i < bytes; ++i, ++address, ++value)
- result = (function == ACPI_READ) ?
- acpi_ec_read(ec, address, value) :
- acpi_ec_write(ec, address, *value);
+ if (function == ACPI_READ) {
+ result = acpi_ec_read(ec, address, &temp);
+ *value = temp;
+ } else {
+ temp = 0xff & (*value);
+ result = acpi_ec_write(ec, address, temp);
+ }
+
+ for (i = 8; unlikely(bits - i > 0); i += 8) {
+ ++address;
+ if (function == ACPI_READ) {
+ result = acpi_ec_read(ec, address, &temp);
+ (*value) |= ((acpi_integer)temp) << i;
+ } else {
+ temp = 0xff & ((*value) >> i);
+ result = acpi_ec_write(ec, address, temp);
+ }
+ }
- if (EC_FLAGS_MSI || bits > 8)
+ if (EC_FLAGS_MSI)
acpi_ec_burst_disable(ec);
switch (result) {
@@ -953,9 +970,6 @@ static struct dmi_system_id __initdata e
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
{
- ec_flag_msi, "MSI hardware", {
- DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
- {
ec_validate_ecdt, "ASUS hardware", {
DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
{},