acpi_wmi(4): Allow attachment to ACPI node if EC is not found

Conducted tests showed that Embedded Controller is not mandatory for
WMI extensions to work.

Reported-by:	yuripv
Reviewed-by:	avg
MFC-after:	2 weeks
Differential-Revision:	https://reviews.freebsd.org/D27653
This commit is contained in:
Vladimir Kondratyev 2020-12-21 18:48:50 +03:00
parent 54d2dfc4b2
commit bde56c9942

View File

@ -246,7 +246,7 @@ acpi_wmi_attach(device_t dev)
if ((sc->ec_dev = devclass_get_device(devclass_find("acpi_ec"), 0))
== NULL)
device_printf(dev, "cannot find EC device\n");
else if (ACPI_FAILURE((status = AcpiInstallNotifyHandler(sc->wmi_handle,
if (ACPI_FAILURE((status = AcpiInstallNotifyHandler(sc->wmi_handle,
ACPI_DEVICE_NOTIFY, acpi_wmi_notify_handler, sc))))
device_printf(sc->wmi_dev, "couldn't install notify handler - %s\n",
AcpiFormatException(status));
@ -701,6 +701,8 @@ acpi_wmi_ec_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address,
return (AE_BAD_PARAMETER);
if (address + (width / 8) - 1 > 0xFF)
return (AE_BAD_ADDRESS);
if (sc->ec_dev == NULL)
return (AE_NOT_FOUND);
if (function == ACPI_READ)
*value = 0;
ec_addr = address;