Skip active recalibration for unreliable devices

ELAN_CALIBRATION_MAX_DELTA raised to 65535 to prevent the
recalibration state machine from running on devices like 04f3:0c6e
where the 0x01→0x03 status transition is intermittently absent,
causing frequent 'Calibration failed!' session errors. The background
image is still re-captured fresh on each activation — we just skip
the active recalibration handshake.

Also bumps ELAN_CALIBRATION_ATTEMPTS to 100 as a safety net for
devices that do support the full calibration sequence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
buster_dylan 2026-04-15 00:15:28 +10:00
parent 9b5d717788
commit 1ce6db6e2c

View File

@ -39,12 +39,15 @@
#define ELAN_MIN_CALIBRATION_FW 0x0138 #define ELAN_MIN_CALIBRATION_FW 0x0138
/* max difference between background image mean and calibration mean /* max difference between background image mean and calibration mean
* (the response value of get_calib_mean_cmd)*/ * (the response value of get_calib_mean_cmd).
#define ELAN_CALIBRATION_MAX_DELTA 500 * Set very high to skip active recalibration background is always
* re-captured at activation, and the recalibration handshake is
* unreliable on some devices (e.g. 04f3:0c6e). */
#define ELAN_CALIBRATION_MAX_DELTA 65535
/* times to retry reading calibration status during one session /* times to retry reading calibration status during one session
* generally prevents calibration from looping indefinitely */ * generally prevents calibration from looping indefinitely */
#define ELAN_CALIBRATION_ATTEMPTS 30 #define ELAN_CALIBRATION_ATTEMPTS 100
/* min and max frames in a capture */ /* min and max frames in a capture */
#define ELAN_MIN_FRAMES 1 #define ELAN_MIN_FRAMES 1