Commit 2babfa06 authored by Dave.wang's avatar Dave.wang Committed by Bastien Nocera

elan: Simplify calibration check for ELAN_0C42

Check for the mean calibration being outside of range to know whether we
require a recalibration. Continue with the usual checks if the
calibration value is within range.
parent 83af4067
......@@ -603,6 +603,14 @@ static int elan_need_calibration(struct elan_dev *elandev)
g_assert(frame_size != 0);
if (elandev->dev_type == ELAN_0C42) {
if (calib_mean > 5500 ||
calib_mean < 2500) {
fp_dbg("Forcing needed recalibration");
return 1;
}
}
for (int i = 0; i < frame_size; i++)
bg_mean += elandev->background[i];
bg_mean /= frame_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment