touch_updater: Add calibration check for elan touchscreen

Elan I2C-HID touchscreen will calibrate after update firmware.
If some actions interrupt firmware to calibrate after update success,
such as power-off, suspend system or etc, then touch will malfunction.

We add a checking mechanism to auto recover by Auto-Update script.
If calibration counter is '0xffff', then touch will be re-calibrated.
Otherwise, if counter is greater or equal to '0x0000', nothing will happen.

BUG=b:255247444
TEST=on Nightfury/hatch device with elan touchscreen, version check, firmware update, and calibration check all work.
The patched script also works fine with older version of elan_i2chid_iap tool without implementation of calibration counter function.
Besides, the patched script works fine in recovery case: firmware update and calibration check both work.

Cq-Depend: chromium:3980457
Change-Id: I01a8eb6000f2bdfffe8415e56e818dda3d3f0390
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/touch_updater/+/3980996
Tested-by: Paul Liang <paul.liang@emc.com.tw>
Reviewed-by: Sean O'Brien <seobrien@chromium.org>
Commit-Queue: Henry Barnor <hbarnor@chromium.org>
Reviewed-by: Paul Liang <paul.liang@emc.com.tw>
1 file changed