mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-03-04 20:59:50 +00:00
575.57.08
This commit is contained in:
@@ -133,6 +133,7 @@ NV_STATUS NV_API_CALL nv_acpi_get_powersource(NvU32 *ac_plugged)
|
||||
return NV_OK;
|
||||
}
|
||||
|
||||
#define ACPI_POWER_SOURCE_BUS_CHANGE_EVENT 0x00
|
||||
#define ACPI_POWER_SOURCE_CHANGE_EVENT 0x80
|
||||
static void nv_acpi_powersource_hotplug_event(acpi_handle handle, u32 event_type, void *data)
|
||||
{
|
||||
@@ -143,7 +144,7 @@ static void nv_acpi_powersource_hotplug_event(acpi_handle handle, u32 event_type
|
||||
nv_acpi_t *pNvAcpiObject = data;
|
||||
u32 ac_plugged = 0;
|
||||
|
||||
if (event_type == ACPI_POWER_SOURCE_CHANGE_EVENT)
|
||||
if (event_type == ACPI_POWER_SOURCE_CHANGE_EVENT || event_type == ACPI_POWER_SOURCE_BUS_CHANGE_EVENT)
|
||||
{
|
||||
if (nv_acpi_get_powersource(&ac_plugged) != NV_OK)
|
||||
return;
|
||||
@@ -201,8 +202,16 @@ static nv_acpi_t* nv_install_notifier(
|
||||
pNvAcpiObject->sp = sp;
|
||||
pNvAcpiObject->notifier_data = notifier_data;
|
||||
|
||||
status = acpi_install_notify_handler(handle, ACPI_DEVICE_NOTIFY,
|
||||
handler, pNvAcpiObject);
|
||||
if (handle == psr_device_handle)
|
||||
{
|
||||
status = acpi_install_notify_handler(handle, ACPI_ALL_NOTIFY,
|
||||
handler, pNvAcpiObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = acpi_install_notify_handler(handle, ACPI_DEVICE_NOTIFY,
|
||||
handler, pNvAcpiObject);
|
||||
}
|
||||
if (!ACPI_FAILURE(status))
|
||||
{
|
||||
pNvAcpiObject->notify_handler_installed = 1;
|
||||
@@ -225,7 +234,14 @@ static void nv_uninstall_notifier(nv_acpi_t *pNvAcpiObject, acpi_notify_handler
|
||||
|
||||
if (pNvAcpiObject && pNvAcpiObject->notify_handler_installed)
|
||||
{
|
||||
status = acpi_remove_notify_handler(pNvAcpiObject->handle, ACPI_DEVICE_NOTIFY, handler);
|
||||
if (pNvAcpiObject->handle == psr_device_handle)
|
||||
{
|
||||
status = acpi_remove_notify_handler(pNvAcpiObject->handle, ACPI_ALL_NOTIFY, handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = acpi_remove_notify_handler(pNvAcpiObject->handle, ACPI_DEVICE_NOTIFY, handler);
|
||||
}
|
||||
if (ACPI_FAILURE(status))
|
||||
{
|
||||
nv_printf(NV_DBG_INFO,
|
||||
|
||||
Reference in New Issue
Block a user