Lines Matching defs:tregs
360 static s32 bmc150_magn_compensate_x(struct bmc150_magn_trim_regs *tregs, s16 x,
364 u16 xyz1 = le16_to_cpu(tregs->xyz1);
373 val = ((s16)((((s32)x) * ((((((((s32)tregs->xy2) * ((((s32)val) *
375 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) *
376 ((s32)(((s16)tregs->x2) + ((s16)0xA0)))) >> 12)) >> 13)) +
377 (((s16)tregs->x1) << 3);
382 static s32 bmc150_magn_compensate_y(struct bmc150_magn_trim_regs *tregs, s16 y,
386 u16 xyz1 = le16_to_cpu(tregs->xyz1);
395 val = ((s16)((((s32)y) * ((((((((s32)tregs->xy2) * ((((s32)val) *
397 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) *
398 ((s32)(((s16)tregs->y2) + ((s16)0xA0)))) >> 12)) >> 13)) +
399 (((s16)tregs->y1) << 3);
404 static s32 bmc150_magn_compensate_z(struct bmc150_magn_trim_regs *tregs, s16 z,
408 u16 xyz1 = le16_to_cpu(tregs->xyz1);
409 u16 z1 = le16_to_cpu(tregs->z1);
410 s16 z2 = le16_to_cpu(tregs->z2);
411 s16 z3 = le16_to_cpu(tregs->z3);
412 s16 z4 = le16_to_cpu(tregs->z4);
430 struct bmc150_magn_trim_regs tregs;
443 &tregs, sizeof(tregs));
447 buffer[AXIS_X] = bmc150_magn_compensate_x(&tregs, raw_x, rhall);
448 buffer[AXIS_Y] = bmc150_magn_compensate_y(&tregs, raw_y, rhall);
449 buffer[AXIS_Z] = bmc150_magn_compensate_z(&tregs, raw_z, rhall);