diff --git a/debian/patches/elanmoc-Make-sure-sensor-in-the-right-mode-at-identity.patch b/debian/patches/elanmoc-Make-sure-sensor-in-the-right-mode-at-identity.patch new file mode 100644 index 00000000..0c53311d Binary files /dev/null and b/debian/patches/elanmoc-Make-sure-sensor-in-the-right-mode-at-identity.patch differ diff --git a/debian/patches/elanmoc-add-PID-0x0c82.patch b/debian/patches/elanmoc-add-PID-0x0c82.patch new file mode 100644 index 00000000..660e6f17 --- /dev/null +++ b/debian/patches/elanmoc-add-PID-0x0c82.patch @@ -0,0 +1,33 @@ +From: ArronYen +Date: Wed, 2 Mar 2022 10:43:20 +0800 +Subject: elanmoc: add PID 0x0c82 + +--- + data/autosuspend.hwdb | 1 + + libfprint/drivers/elanmoc/elanmoc.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb +index 91a14eb..d55ed3e 100644 +--- a/data/autosuspend.hwdb ++++ b/data/autosuspend.hwdb +@@ -144,6 +144,7 @@ usb:v04F3p0C58* + # Supported by libfprint driver elanmoc + usb:v04F3p0C7D* + usb:v04F3p0C7E* ++usb:v04F3p0C82* + ID_AUTOSUSPEND=1 + ID_PERSIST=0 + +diff --git a/libfprint/drivers/elanmoc/elanmoc.c b/libfprint/drivers/elanmoc/elanmoc.c +index 69700a0..3185ee7 100644 +--- a/libfprint/drivers/elanmoc/elanmoc.c ++++ b/libfprint/drivers/elanmoc/elanmoc.c +@@ -27,6 +27,7 @@ G_DEFINE_TYPE (FpiDeviceElanmoc, fpi_device_elanmoc, FP_TYPE_DEVICE) + static const FpIdEntry id_table[] = { + { .vid = 0x04f3, .pid = 0x0c7d, }, + { .vid = 0x04f3, .pid = 0x0c7e, }, ++ { .vid = 0x04f3, .pid = 0x0c82, }, + { .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */ + }; + diff --git a/debian/patches/elanmoc-add-PID-0x0c88.patch b/debian/patches/elanmoc-add-PID-0x0c88.patch new file mode 100644 index 00000000..a58e7ae7 --- /dev/null +++ b/debian/patches/elanmoc-add-PID-0x0c88.patch @@ -0,0 +1,33 @@ +From: ArronYen +Date: Mon, 20 Jun 2022 14:03:05 +0800 +Subject: elanmoc: add PID 0x0c88 + +--- + data/autosuspend.hwdb | 1 + + libfprint/drivers/elanmoc/elanmoc.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb +index d55ed3e..725c602 100644 +--- a/data/autosuspend.hwdb ++++ b/data/autosuspend.hwdb +@@ -145,6 +145,7 @@ usb:v04F3p0C58* + usb:v04F3p0C7D* + usb:v04F3p0C7E* + usb:v04F3p0C82* ++usb:v04F3p0C88* + ID_AUTOSUSPEND=1 + ID_PERSIST=0 + +diff --git a/libfprint/drivers/elanmoc/elanmoc.c b/libfprint/drivers/elanmoc/elanmoc.c +index 3185ee7..ad23e93 100644 +--- a/libfprint/drivers/elanmoc/elanmoc.c ++++ b/libfprint/drivers/elanmoc/elanmoc.c +@@ -28,6 +28,7 @@ static const FpIdEntry id_table[] = { + { .vid = 0x04f3, .pid = 0x0c7d, }, + { .vid = 0x04f3, .pid = 0x0c7e, }, + { .vid = 0x04f3, .pid = 0x0c82, }, ++ { .vid = 0x04f3, .pid = 0x0c88, }, + { .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */ + }; + diff --git a/debian/patches/elanmoc-add-PID-0x0c8c-0x0c8d.patch b/debian/patches/elanmoc-add-PID-0x0c8c-0x0c8d.patch new file mode 100644 index 00000000..ae079e19 --- /dev/null +++ b/debian/patches/elanmoc-add-PID-0x0c8c-0x0c8d.patch @@ -0,0 +1,103 @@ +From: Johnny Li +Date: Mon, 25 Jul 2022 14:11:37 +0800 +Subject: elanmoc: add PID 0x0c8c & 0x0c8d + +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfprint/+bug/1989314 +--- + data/autosuspend.hwdb | 2 ++ + libfprint/drivers/elanmoc/elanmoc.c | 27 ++++++++++++++++++++++++--- + libfprint/drivers/elanmoc/elanmoc.h | 1 + + 3 files changed, 27 insertions(+), 3 deletions(-) + +diff --git a/data/autosuspend.hwdb b/data/autosuspend.hwdb +index 6e53964..5977aa8 100644 +--- a/data/autosuspend.hwdb ++++ b/data/autosuspend.hwdb +@@ -147,6 +147,8 @@ usb:v04F3p0C7D* + usb:v04F3p0C7E* + usb:v04F3p0C82* + usb:v04F3p0C88* ++usb:v04F3p0C8C* ++usb:v04F3p0C8D* + ID_AUTOSUSPEND=1 + ID_PERSIST=0 + +diff --git a/libfprint/drivers/elanmoc/elanmoc.c b/libfprint/drivers/elanmoc/elanmoc.c +index 5bcfce2..77e22f2 100644 +--- a/libfprint/drivers/elanmoc/elanmoc.c ++++ b/libfprint/drivers/elanmoc/elanmoc.c +@@ -29,6 +29,8 @@ static const FpIdEntry id_table[] = { + { .vid = 0x04f3, .pid = 0x0c7e, }, + { .vid = 0x04f3, .pid = 0x0c82, }, + { .vid = 0x04f3, .pid = 0x0c88, }, ++ { .vid = 0x04f3, .pid = 0x0c8c, }, ++ { .vid = 0x04f3, .pid = 0x0c8d, }, + { .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */ + }; + +@@ -377,9 +379,9 @@ elanmoc_enroll_cb (FpiDeviceElanmoc *self, + enroll_status_report (self, ENROLL_RSP_RETRY, self->num_frames, NULL); + } + +- if (self->num_frames == ELAN_MOC_ENROLL_TIMES && buffer_in[1] == ELAN_MSG_OK) ++ if (self->num_frames == self->max_moc_enroll_time && buffer_in[1] == ELAN_MSG_OK) + fpi_ssm_next_state (self->task_ssm); +- else if (self->num_frames < ELAN_MOC_ENROLL_TIMES) ++ else if (self->num_frames < self->max_moc_enroll_time) + fpi_ssm_jump_to_state (self->task_ssm, MOC_ENROLL_WAIT_FINGER); + else + fpi_ssm_mark_failed (self->task_ssm, error); +@@ -442,7 +444,7 @@ elan_enroll_run_state (FpiSsm *ssm, FpDevice *dev) + case MOC_ENROLL_WAIT_FINGER: + cmd_buf = elanmoc_compose_cmd (&elanmoc_enroll_cmd); + cmd_buf[3] = self->curr_enrolled; +- cmd_buf[4] = ELAN_MOC_ENROLL_TIMES; ++ cmd_buf[4] = self->max_moc_enroll_time; + cmd_buf[5] = self->num_frames; + elanmoc_get_cmd (dev, cmd_buf, elanmoc_enroll_cmd.cmd_len, elanmoc_enroll_cmd.resp_len, 1, elanmoc_enroll_cb); + break; +@@ -1069,6 +1071,7 @@ elanmoc_open (FpDevice *device) + { + FpiDeviceElanmoc *self = FPI_DEVICE_ELANMOC (device); + GError *error = NULL; ++ gint productid = 0; + + if (!g_usb_device_reset (fpi_device_get_usb_device (device), &error)) + goto error; +@@ -1076,6 +1079,24 @@ elanmoc_open (FpDevice *device) + if (!g_usb_device_claim_interface (fpi_device_get_usb_device (device), 0, 0, &error)) + goto error; + ++ productid = g_usb_device_get_pid (fpi_device_get_usb_device (device)); ++ switch (productid) ++ { ++ case 0x0c8c: ++ self->max_moc_enroll_time = 11; ++ break; ++ ++ case 0x0c8d: ++ self->max_moc_enroll_time = 17; ++ break; ++ ++ default: ++ self->max_moc_enroll_time = ELAN_MOC_ENROLL_TIMES; ++ break; ++ } ++ ++ fpi_device_set_nr_enroll_stages (device, self->max_moc_enroll_time); ++ + self->task_ssm = fpi_ssm_new (FP_DEVICE (self), dev_init_handler, DEV_INIT_STATES); + fpi_ssm_start (self->task_ssm, task_ssm_init_done); + return; +diff --git a/libfprint/drivers/elanmoc/elanmoc.h b/libfprint/drivers/elanmoc/elanmoc.h +index 312a4b4..a948d40 100644 +--- a/libfprint/drivers/elanmoc/elanmoc.h ++++ b/libfprint/drivers/elanmoc/elanmoc.h +@@ -188,6 +188,7 @@ struct _FpiDeviceElanmoc + unsigned char y_trace; + int num_frames; + int curr_enrolled; ++ int max_moc_enroll_time; + int cancel_result; + int cmd_retry_cnt; + int list_index; diff --git a/debian/patches/series b/debian/patches/series index 6cf19c04..dad26c29 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,6 @@ tod-Add-wrapper-for-goodix-tod-not-handling-identificatio.patch fpi-device-Avoid-using-device-action-strings.patch +elanmoc-add-PID-0x0c82.patch +elanmoc-add-PID-0x0c88.patch +elanmoc-Make-sure-sensor-in-the-right-mode-at-identity.patch +elanmoc-add-PID-0x0c8c-0x0c8d.patch diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 00000000..607c2384 --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1,2 @@ +# This is a patch that includes tests recordings in pcapng format +debian/patches/elanmoc-Make-sure-sensor-in-the-right-mode-at-identity.patch