synaptics: Implement suspend/resume methods

We only allow suspending while we are in the interrupt transfer stage.
To suspend, we cancel the interrupt transfer and at resume time we
restart it.

This has been tested to work correctly on an X1 Carbon 8th Gen with
suspend mode set to "Windows 10" (i.e. S0ix [s2idle] and not S3 [suspend
to RAM]). With S3 suspend, the USB root hub appears to be turned off or
reset and the device will be unresponsive afterwards (if it returns). To
avoid issues, libfprint disables the "persist" mode in the kernel and
we'll see a new device instead after resume.
This commit is contained in:
Benjamin Berg
2021-05-20 20:01:49 +02:00
parent 8147372bdd
commit 5c89bda7f3
3 changed files with 81 additions and 2 deletions
+1 -1
View File
@@ -1126,7 +1126,7 @@ fp_device_resume (FpDevice *device,
case FPI_DEVICE_ACTION_LIST:
case FPI_DEVICE_ACTION_CLEAR_STORAGE:
/* cannot happen as we make sure these tasks complete before suspend */
g_assert_not_reached();
g_assert_not_reached ();
complete_suspend_resume_task (device);
break;
}