Lines Matching refs:tregs
367 static s32 bmc150_magn_compensate_x(struct bmc150_magn_trim_regs *tregs, s16 x, in bmc150_magn_compensate_x() argument
371 u16 xyz1 = le16_to_cpu(tregs->xyz1); in bmc150_magn_compensate_x()
380 val = ((s16)((((s32)x) * ((((((((s32)tregs->xy2) * ((((s32)val) * in bmc150_magn_compensate_x()
382 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) * in bmc150_magn_compensate_x()
383 ((s32)(((s16)tregs->x2) + ((s16)0xA0)))) >> 12)) >> 13)) + in bmc150_magn_compensate_x()
384 (((s16)tregs->x1) << 3); in bmc150_magn_compensate_x()
389 static s32 bmc150_magn_compensate_y(struct bmc150_magn_trim_regs *tregs, s16 y, in bmc150_magn_compensate_y() argument
393 u16 xyz1 = le16_to_cpu(tregs->xyz1); in bmc150_magn_compensate_y()
402 val = ((s16)((((s32)y) * ((((((((s32)tregs->xy2) * ((((s32)val) * in bmc150_magn_compensate_y()
404 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) * in bmc150_magn_compensate_y()
405 ((s32)(((s16)tregs->y2) + ((s16)0xA0)))) >> 12)) >> 13)) + in bmc150_magn_compensate_y()
406 (((s16)tregs->y1) << 3); in bmc150_magn_compensate_y()
411 static s32 bmc150_magn_compensate_z(struct bmc150_magn_trim_regs *tregs, s16 z, in bmc150_magn_compensate_z() argument
415 u16 xyz1 = le16_to_cpu(tregs->xyz1); in bmc150_magn_compensate_z()
416 u16 z1 = le16_to_cpu(tregs->z1); in bmc150_magn_compensate_z()
417 s16 z2 = le16_to_cpu(tregs->z2); in bmc150_magn_compensate_z()
418 s16 z3 = le16_to_cpu(tregs->z3); in bmc150_magn_compensate_z()
419 s16 z4 = le16_to_cpu(tregs->z4); in bmc150_magn_compensate_z()
437 struct bmc150_magn_trim_regs tregs; in bmc150_magn_read_xyz() local
450 &tregs, sizeof(tregs)); in bmc150_magn_read_xyz()
454 buffer[AXIS_X] = bmc150_magn_compensate_x(&tregs, raw_x, rhall); in bmc150_magn_read_xyz()
455 buffer[AXIS_Y] = bmc150_magn_compensate_y(&tregs, raw_y, rhall); in bmc150_magn_read_xyz()
456 buffer[AXIS_Z] = bmc150_magn_compensate_z(&tregs, raw_z, rhall); in bmc150_magn_read_xyz()