Lines Matching refs:cal

72 	struct analog_axis_calibration *cal = &cfg->calibration[channel];  in analog_axis_calibration_get()  local
79 memcpy(out_cal, cal, sizeof(struct analog_axis_calibration)); in analog_axis_calibration_get()
100 struct analog_axis_calibration *cal = &cfg->calibration[channel]; in analog_axis_calibration_set() local
107 memcpy(cal, new_cal, sizeof(struct analog_axis_calibration)); in analog_axis_calibration_set()
119 struct analog_axis_calibration *cal = &cfg->calibration[channel]; in analog_axis_out_deadzone() local
121 int16_t in_range = cal->in_max - cal->in_min; in analog_axis_out_deadzone()
123 int16_t in_mid = DIV_ROUND_CLOSEST(cal->in_min + cal->in_max, 2); in analog_axis_out_deadzone()
124 int16_t in_min = cal->in_min; in analog_axis_out_deadzone()
126 if (abs(raw_val - in_mid) < cal->in_deadzone) { in analog_axis_out_deadzone()
130 in_range -= cal->in_deadzone * 2; in analog_axis_out_deadzone()
131 in_min += cal->in_deadzone; in analog_axis_out_deadzone()
133 raw_val += cal->in_deadzone; in analog_axis_out_deadzone()
135 raw_val -= cal->in_deadzone; in analog_axis_out_deadzone()
147 struct analog_axis_calibration *cal = &cfg->calibration[channel]; in analog_axis_out_linear() local
149 int16_t in_range = cal->in_max - cal->in_min; in analog_axis_out_linear()
152 return DIV_ROUND_CLOSEST((raw_val - cal->in_min) * out_range, in_range) + axis_cfg->out_min; in analog_axis_out_linear()
188 struct analog_axis_calibration *cal = &cfg->calibration[i]; in analog_axis_loop() local
201 if (cal->in_deadzone > 0) { in analog_axis_loop()