Lines Matching refs:calib
109 struct bme680_calib *calib) in bme680_read_calib() argument
123 calib->par_t1 = le16_to_cpu(buf); in bme680_read_calib()
131 calib->par_t2 = le16_to_cpu(buf); in bme680_read_calib()
138 calib->par_t3 = tmp; in bme680_read_calib()
147 calib->par_p1 = le16_to_cpu(buf); in bme680_read_calib()
155 calib->par_p2 = le16_to_cpu(buf); in bme680_read_calib()
162 calib->par_p3 = tmp; in bme680_read_calib()
170 calib->par_p4 = le16_to_cpu(buf); in bme680_read_calib()
178 calib->par_p5 = le16_to_cpu(buf); in bme680_read_calib()
185 calib->par_p6 = tmp; in bme680_read_calib()
192 calib->par_p7 = tmp; in bme680_read_calib()
200 calib->par_p8 = le16_to_cpu(buf); in bme680_read_calib()
208 calib->par_p9 = le16_to_cpu(buf); in bme680_read_calib()
215 calib->par_p10 = tmp; in bme680_read_calib()
228 calib->par_h1 = (tmp_msb << BME680_HUM_REG_SHIFT_VAL) | in bme680_read_calib()
241 calib->par_h2 = (tmp_msb << BME680_HUM_REG_SHIFT_VAL) | in bme680_read_calib()
249 calib->par_h3 = tmp; in bme680_read_calib()
256 calib->par_h4 = tmp; in bme680_read_calib()
263 calib->par_h5 = tmp; in bme680_read_calib()
270 calib->par_h6 = tmp; in bme680_read_calib()
277 calib->par_h7 = tmp; in bme680_read_calib()
285 calib->par_gh1 = tmp; in bme680_read_calib()
293 calib->par_gh2 = le16_to_cpu(buf); in bme680_read_calib()
300 calib->par_gh3 = tmp; in bme680_read_calib()
308 calib->res_heat_range = FIELD_GET(BME680_RHRANGE_MASK, tmp); in bme680_read_calib()
315 calib->res_heat_val = tmp; in bme680_read_calib()
322 calib->range_sw_err = FIELD_GET(BME680_RSERROR_MASK, tmp); in bme680_read_calib()
337 struct bme680_calib *calib = &data->bme680; in bme680_compensate_temp() local
342 if (!calib->par_t2) in bme680_compensate_temp()
343 bme680_read_calib(data, calib); in bme680_compensate_temp()
345 var1 = (adc_temp >> 3) - (calib->par_t1 << 1); in bme680_compensate_temp()
346 var2 = (var1 * calib->par_t2) >> 11; in bme680_compensate_temp()
348 var3 = (var3 * (calib->par_t3 << 4)) >> 14; in bme680_compensate_temp()
365 struct bme680_calib *calib = &data->bme680; in bme680_compensate_press() local
369 var2 = ((((var1 >> 2) * (var1 >> 2)) >> 11) * calib->par_p6) >> 2; in bme680_compensate_press()
370 var2 = var2 + (var1 * calib->par_p5 << 1); in bme680_compensate_press()
371 var2 = (var2 >> 2) + (calib->par_p4 << 16); in bme680_compensate_press()
373 (calib->par_p3 << 5)) >> 3) + in bme680_compensate_press()
374 ((calib->par_p2 * var1) >> 1); in bme680_compensate_press()
376 var1 = ((32768 + var1) * calib->par_p1) >> 15; in bme680_compensate_press()
385 var1 = (calib->par_p9 * (((press_comp >> 3) * in bme680_compensate_press()
387 var2 = ((press_comp >> 2) * calib->par_p8) >> 13; in bme680_compensate_press()
389 (press_comp >> 8) * calib->par_p10) >> 17; in bme680_compensate_press()
391 press_comp += (var1 + var2 + var3 + (calib->par_p7 << 7)) >> 4; in bme680_compensate_press()
406 struct bme680_calib *calib = &data->bme680; in bme680_compensate_humid() local
410 var1 = (adc_humid - ((s32) ((s32) calib->par_h1 * 16))) - in bme680_compensate_humid()
411 (((temp_scaled * (s32) calib->par_h3) / 100) >> 1); in bme680_compensate_humid()
412 var2 = ((s32) calib->par_h2 * in bme680_compensate_humid()
413 (((temp_scaled * calib->par_h4) / 100) + in bme680_compensate_humid()
414 (((temp_scaled * ((temp_scaled * calib->par_h5) / 100)) in bme680_compensate_humid()
417 var4 = calib->par_h6 << 7; in bme680_compensate_humid()
418 var4 = (var4 + ((temp_scaled * calib->par_h7) / 100)) >> 4; in bme680_compensate_humid()
437 struct bme680_calib *calib = &data->bme680; in bme680_compensate_gas() local
451 var1 = ((1340 + (5 * (s64) calib->range_sw_err)) * in bme680_compensate_gas()
467 struct bme680_calib *calib = &data->bme680; in bme680_calc_heater_res() local
474 var1 = (((s32) BME680_AMB_TEMP * calib->par_gh3) / 1000) * 256; in bme680_calc_heater_res()
475 var2 = (calib->par_gh1 + 784) * (((((calib->par_gh2 + 154009) * in bme680_calc_heater_res()
479 var4 = (var3 / (calib->res_heat_range + 4)); in bme680_calc_heater_res()
480 var5 = 131 * calib->res_heat_val + 65536; in bme680_calc_heater_res()