575.57.08

This commit is contained in:
Maneet Singh
2025-05-29 10:58:21 -07:00
parent e00332b05f
commit 30e15d79de
74 changed files with 798 additions and 417 deletions

View File

@@ -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,