Skip to content

Commit

Permalink
Fix sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
1Revenger1 committed Jun 16, 2020
1 parent 158ebf0 commit cd94edb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VoodooRMI/Functions/F01.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ int F01::rmi_f01_suspend()
old_nosleep = device_control->ctrl0 & RMI_F01_CTRL0_NOSLEEP_BIT;
device_control->ctrl0 &= ~RMI_F01_CTRL0_NOSLEEP_BIT;

device_control->ctrl0 *= ~RMI_F01_CTRL0_SLEEP_MODE_MASK;
device_control->ctrl0 &= ~RMI_F01_CTRL0_SLEEP_MODE_MASK;
if ((false) /* device may wakeup = false*/)
device_control->ctrl0 |= RMI_SLEEP_MODE_RESERVED1;
else
Expand Down
2 changes: 1 addition & 1 deletion VoodooRMI/Functions/F11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ bool F11::getReport()

if (error < 0)
{
IOLogError("Could not read F11 attention data: %02X", error);
IOLogError("Could not read F11 attention data: %d", error);
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions VoodooRMI/RMIBus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ IOReturn RMIBus::setPowerState(unsigned long whichState, IOService* whatDevice)

if (whichState == 0 && awake) {
IOLogDebug("Sleep");
IOReturn error = messageClients(kHandleRMISuspend);
messageClients(kHandleRMISuspend);
rmi_driver_clear_irq_bits(this);
if (!error) awake = false;
awake = false;
} else if (!awake) {
IOSleep(1000);
IOLogDebug("Wakeup");
Expand All @@ -181,8 +181,8 @@ IOReturn RMIBus::setPowerState(unsigned long whichState, IOService* whatDevice)
return 0;
});
rmi_driver_set_irq_bits(this);
IOReturn error = messageClients(kHandleRMIResume);
if (!error) awake = true;
messageClients(kHandleRMIResume);
awake = true;
}

return kIOPMAckImplied;
Expand Down

0 comments on commit cd94edb

Please sign in to comment.