Lines Matching refs:calib
144 } calib; member
290 struct bmp280_calib *calib = &data->calib.bmp280; in bmp280_read_calib() local
307 calib->T1 = le16_to_cpu(data->bmp280_cal_buf[T1]); in bmp280_read_calib()
308 calib->T2 = le16_to_cpu(data->bmp280_cal_buf[T2]); in bmp280_read_calib()
309 calib->T3 = le16_to_cpu(data->bmp280_cal_buf[T3]); in bmp280_read_calib()
312 calib->P1 = le16_to_cpu(data->bmp280_cal_buf[P1]); in bmp280_read_calib()
313 calib->P2 = le16_to_cpu(data->bmp280_cal_buf[P2]); in bmp280_read_calib()
314 calib->P3 = le16_to_cpu(data->bmp280_cal_buf[P3]); in bmp280_read_calib()
315 calib->P4 = le16_to_cpu(data->bmp280_cal_buf[P4]); in bmp280_read_calib()
316 calib->P5 = le16_to_cpu(data->bmp280_cal_buf[P5]); in bmp280_read_calib()
317 calib->P6 = le16_to_cpu(data->bmp280_cal_buf[P6]); in bmp280_read_calib()
318 calib->P7 = le16_to_cpu(data->bmp280_cal_buf[P7]); in bmp280_read_calib()
319 calib->P8 = le16_to_cpu(data->bmp280_cal_buf[P8]); in bmp280_read_calib()
320 calib->P9 = le16_to_cpu(data->bmp280_cal_buf[P9]); in bmp280_read_calib()
327 struct bmp280_calib *calib = &data->calib.bmp280; in bme280_read_calib() local
352 calib->H1 = tmp; in bme280_read_calib()
360 calib->H2 = sign_extend32(le16_to_cpu(data->le16), 15); in bme280_read_calib()
367 calib->H3 = tmp; in bme280_read_calib()
375 calib->H4 = sign_extend32(((be16_to_cpu(data->be16) >> 4) & 0xff0) | in bme280_read_calib()
384 calib->H5 = sign_extend32(FIELD_GET(BMP280_COMP_H5_MASK, le16_to_cpu(data->le16)), 11); in bme280_read_calib()
391 calib->H6 = sign_extend32(tmp, 7); in bme280_read_calib()
404 struct bmp280_calib *calib = &data->calib.bmp280; in bmp280_compensate_humidity() local
408 var = ((((adc_humidity << 14) - (calib->H4 << 20) - (calib->H5 * var)) in bmp280_compensate_humidity()
409 + (s32)16384) >> 15) * (((((((var * calib->H6) >> 10) in bmp280_compensate_humidity()
410 * (((var * (s32)calib->H3) >> 11) + (s32)32768)) >> 10) in bmp280_compensate_humidity()
411 + (s32)2097152) * calib->H2 + 8192) >> 14); in bmp280_compensate_humidity()
412 var -= ((((var >> 15) * (var >> 15)) >> 7) * (s32)calib->H1) >> 4; in bmp280_compensate_humidity()
429 struct bmp280_calib *calib = &data->calib.bmp280; in bmp280_compensate_temp() local
432 var1 = (((adc_temp >> 3) - ((s32)calib->T1 << 1)) * in bmp280_compensate_temp()
433 ((s32)calib->T2)) >> 11; in bmp280_compensate_temp()
434 var2 = (((((adc_temp >> 4) - ((s32)calib->T1)) * in bmp280_compensate_temp()
435 ((adc_temp >> 4) - ((s32)calib->T1))) >> 12) * in bmp280_compensate_temp()
436 ((s32)calib->T3)) >> 14; in bmp280_compensate_temp()
452 struct bmp280_calib *calib = &data->calib.bmp280; in bmp280_compensate_press() local
456 var2 = var1 * var1 * (s64)calib->P6; in bmp280_compensate_press()
457 var2 += (var1 * (s64)calib->P5) << 17; in bmp280_compensate_press()
458 var2 += ((s64)calib->P4) << 35; in bmp280_compensate_press()
459 var1 = ((var1 * var1 * (s64)calib->P3) >> 8) + in bmp280_compensate_press()
460 ((var1 * (s64)calib->P2) << 12); in bmp280_compensate_press()
461 var1 = ((((s64)1) << 47) + var1) * ((s64)calib->P1) >> 33; in bmp280_compensate_press()
468 var1 = (((s64)calib->P9) * (p >> 13) * (p >> 13)) >> 25; in bmp280_compensate_press()
469 var2 = ((s64)(calib->P8) * p) >> 19; in bmp280_compensate_press()
470 p = ((p + var1 + var2) >> 8) + (((s64)calib->P7) << 4); in bmp280_compensate_press()
1036 struct bmp380_calib *calib = &data->calib.bmp380; in bmp380_compensate_temp() local
1038 var1 = ((s64) adc_temp) - (((s64) calib->T1) << 8); in bmp380_compensate_temp()
1039 var2 = var1 * ((s64) calib->T2); in bmp380_compensate_temp()
1041 var4 = var3 * ((s64) calib->T3); in bmp380_compensate_temp()
1061 struct bmp380_calib *calib = &data->calib.bmp380; in bmp380_compensate_press() local
1067 var4 = ((s64)calib->P8 * var3) >> 5; in bmp380_compensate_press()
1068 var5 = ((s64)calib->P7 * var1) << 4; in bmp380_compensate_press()
1069 var6 = ((s64)calib->P6 * (s64)data->t_fine) << 22; in bmp380_compensate_press()
1070 offset = ((s64)calib->P5 << 47) + var4 + var5 + var6; in bmp380_compensate_press()
1071 var2 = ((s64)calib->P4 * var3) >> 5; in bmp380_compensate_press()
1072 var4 = ((s64)calib->P3 * var1) << 2; in bmp380_compensate_press()
1073 var5 = ((s64)calib->P2 - ((s64)1 << 14)) * in bmp380_compensate_press()
1075 sensitivity = (((s64) calib->P1 - ((s64) 1 << 14)) << 46) + in bmp380_compensate_press()
1078 var2 = (s64)calib->P10 * (s64)data->t_fine; in bmp380_compensate_press()
1079 var3 = var2 + ((s64)calib->P9 << 16); in bmp380_compensate_press()
1089 var2 = ((s64)calib->P11 * var6) >> 16; in bmp380_compensate_press()
1165 struct bmp380_calib *calib = &data->calib.bmp380; in bmp380_read_calib() local
1181 calib->T1 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_T1]); in bmp380_read_calib()
1182 calib->T2 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_T2]); in bmp380_read_calib()
1183 calib->T3 = data->bmp380_cal_buf[BMP380_T3]; in bmp380_read_calib()
1184 calib->P1 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_P1]); in bmp380_read_calib()
1185 calib->P2 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_P2]); in bmp380_read_calib()
1186 calib->P3 = data->bmp380_cal_buf[BMP380_P3]; in bmp380_read_calib()
1187 calib->P4 = data->bmp380_cal_buf[BMP380_P4]; in bmp380_read_calib()
1188 calib->P5 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_P5]); in bmp380_read_calib()
1189 calib->P6 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_P6]); in bmp380_read_calib()
1190 calib->P7 = data->bmp380_cal_buf[BMP380_P7]; in bmp380_read_calib()
1191 calib->P8 = data->bmp380_cal_buf[BMP380_P8]; in bmp380_read_calib()
1192 calib->P9 = get_unaligned_le16(&data->bmp380_cal_buf[BMP380_P9]); in bmp380_read_calib()
1193 calib->P10 = data->bmp380_cal_buf[BMP380_P10]; in bmp380_read_calib()
1194 calib->P11 = data->bmp380_cal_buf[BMP380_P11]; in bmp380_read_calib()
1417 struct bmp180_calib *calib = &data->calib.bmp180; in bmp180_read_calib() local
1437 calib->AC1 = be16_to_cpu(data->bmp180_cal_buf[AC1]); in bmp180_read_calib()
1438 calib->AC2 = be16_to_cpu(data->bmp180_cal_buf[AC2]); in bmp180_read_calib()
1439 calib->AC3 = be16_to_cpu(data->bmp180_cal_buf[AC3]); in bmp180_read_calib()
1440 calib->AC4 = be16_to_cpu(data->bmp180_cal_buf[AC4]); in bmp180_read_calib()
1441 calib->AC5 = be16_to_cpu(data->bmp180_cal_buf[AC5]); in bmp180_read_calib()
1442 calib->AC6 = be16_to_cpu(data->bmp180_cal_buf[AC6]); in bmp180_read_calib()
1443 calib->B1 = be16_to_cpu(data->bmp180_cal_buf[B1]); in bmp180_read_calib()
1444 calib->B2 = be16_to_cpu(data->bmp180_cal_buf[B2]); in bmp180_read_calib()
1445 calib->MB = be16_to_cpu(data->bmp180_cal_buf[MB]); in bmp180_read_calib()
1446 calib->MC = be16_to_cpu(data->bmp180_cal_buf[MC]); in bmp180_read_calib()
1447 calib->MD = be16_to_cpu(data->bmp180_cal_buf[MD]); in bmp180_read_calib()
1460 struct bmp180_calib *calib = &data->calib.bmp180; in bmp180_compensate_temp() local
1463 x1 = ((adc_temp - calib->AC6) * calib->AC5) >> 15; in bmp180_compensate_temp()
1464 x2 = (calib->MC << 11) / (x1 + calib->MD); in bmp180_compensate_temp()
1522 struct bmp180_calib *calib = &data->calib.bmp180; in bmp180_compensate_press() local
1529 x1 = (calib->B2 * (b6 * b6 >> 12)) >> 11; in bmp180_compensate_press()
1530 x2 = calib->AC2 * b6 >> 11; in bmp180_compensate_press()
1532 b3 = ((((s32)calib->AC1 * 4 + x3) << oss) + 2) / 4; in bmp180_compensate_press()
1533 x1 = calib->AC3 * b6 >> 13; in bmp180_compensate_press()
1534 x2 = (calib->B1 * ((b6 * b6) >> 12)) >> 16; in bmp180_compensate_press()
1536 b4 = calib->AC4 * (u32)(x3 + 32768) >> 15; in bmp180_compensate_press()