/* WMI can have EmbeddedControl access regions. In which case, we just want to hand these off to the EC driver.  */
static acpi_status acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address, u32 bits, acpi_integer *value, void *handler_context, void *region_context)
/* WMI can have EmbeddedControl access regions. In which case, we just want to hand these off to the EC driver.  */
static acpi_status acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address, u32 bits, acpi_integer *value, void *handler_context, void *region_context)
{
	int result = 0, i = 0;
	u8 temp = 0;
	if ((address > 0xFF) || !value)
		return AE_BAD_PARAMETER;
	if (function != ACPI_READ && function != ACPI_WRITE)
		return AE_BAD_PARAMETER;
	if (bits != 8)
		return AE_BAD_PARAMETER;
	if (function == ACPI_READ) {
		result = ec_read(address, &temp);
		(*value) |= ((acpi_integer)temp) << i;
	} else {
		temp = 0xff & ((*value) >> i);
		result = ec_write(address, temp);
	}
	switch (result) {
	case -EINVAL:
		return AE_BAD_PARAMETER;
		break;
	case -ENODEV:
		return AE_NOT_FOUND;
		break;
	case -ETIME:
		return AE_TIME;
		break;
	default:
		return AE_OK;
	}
}