elan: restart after short swipe needs access to fp_img_dev
Not sure what but it looks like something broke re-entering capture loop after a short swipe. This is the fix
diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c
index ed474b0..e4cf93e 100644
--- a/libfprint/drivers/elan.c
+++ b/libfprint/drivers/elan.c
@@ -39,6 +39,7 @@
#define FP_COMPONENT "elan"
#include "drivers_api.h"
+#include "fp_internal.h"
#include "elan.h"
#define dbg_buf(buf, len) \
@@ -472,8 +473,10 @@ static void stop_capture_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_
* deactivate, try to re-enter the capture loop. Since state change is
* async, there's still a chance to be deactivated by another pending
* event. */
- if (elandev->dev_state_next != IMGDEV_STATE_INACTIVE)
+ if (elandev->dev_state_next != IMGDEV_STATE_INACTIVE) {
+ dev->action_state = IMG_ACQUIRE_STATE_AWAIT_FINGER_ON;
dev_change_state(dev, IMGDEV_STATE_AWAIT_FINGER_ON);
+ }
} else if (error != -ECANCELED)
fpi_imgdev_abort_scan(dev, error);
Otherwise the subsequent fpi_imgdev_report_finger_status(dev, TRUE)
fails ("ignoring status report") and everything hangs. The problem is that it needs fp_internal.h
which isn't for drivers, right? Here are the possible solutions I see:
-
Expose
fp_img_dev
. I guess it's hidden for a reason, so.. -
Make
fpi_imgdev_report_finger_status
(orfpi_drvcb_report_X_result
) actually manageaction_state
all the time, not only duringIMG_ACTION_ENROLL
. This makes sense to me because if it's called withFALSE
andaction_state = IMG_ACQUIRE_STATE_AWAIT_FINDER_OFF
, thenaction_state
should advance to a different state, shouldn't it? -
Disable short swipe checks in elan and make it fail instead. I only have a VFS5011 device to compare and it seems to do just that. It might just be that "short swipe" functionality isn't yet ready to be used by the drivers.