Lines Matching refs:tregs
362 static s32 bmc150_magn_compensate_x(struct bmc150_magn_trim_regs *tregs, s16 x,
366 u16 xyz1 = le16_to_cpu(tregs->xyz1);
375 val = ((s16)((((s32)x) * ((((((((s32)tregs->xy2) * ((((s32)val) *
377 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) *
378 ((s32)(((s16)tregs->x2) + ((s16)0xA0)))) >> 12)) >> 13)) +
379 (((s16)tregs->x1) << 3);
384 static s32 bmc150_magn_compensate_y(struct bmc150_magn_trim_regs *tregs, s16 y,
388 u16 xyz1 = le16_to_cpu(tregs->xyz1);
397 val = ((s16)((((s32)y) * ((((((((s32)tregs->xy2) * ((((s32)val) *
399 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) *
400 ((s32)(((s16)tregs->y2) + ((s16)0xA0)))) >> 12)) >> 13)) +
401 (((s16)tregs->y1) << 3);
406 static s32 bmc150_magn_compensate_z(struct bmc150_magn_trim_regs *tregs, s16 z,
410 u16 xyz1 = le16_to_cpu(tregs->xyz1);
411 u16 z1 = le16_to_cpu(tregs->z1);
412 s16 z2 = le16_to_cpu(tregs->z2);
413 s16 z3 = le16_to_cpu(tregs->z3);
414 s16 z4 = le16_to_cpu(tregs->z4);
432 struct bmc150_magn_trim_regs tregs;
445 &tregs, sizeof(tregs));
449 buffer[AXIS_X] = bmc150_magn_compensate_x(&tregs, raw_x, rhall);
450 buffer[AXIS_Y] = bmc150_magn_compensate_y(&tregs, raw_y, rhall);
451 buffer[AXIS_Z] = bmc150_magn_compensate_z(&tregs, raw_z, rhall);