Lines Matching refs:s16
362 static s32 bmc150_magn_compensate_x(struct bmc150_magn_trim_regs *tregs, s16 x, in bmc150_magn_compensate_x()
365 s16 val; in bmc150_magn_compensate_x()
374 val = ((s16)(((u16)((((s32)xyz1) << 14) / rhall)) - ((u16)0x4000))); in bmc150_magn_compensate_x()
375 val = ((s16)((((s32)x) * ((((((((s32)tregs->xy2) * ((((s32)val) * in bmc150_magn_compensate_x()
377 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) * in bmc150_magn_compensate_x()
378 ((s32)(((s16)tregs->x2) + ((s16)0xA0)))) >> 12)) >> 13)) + in bmc150_magn_compensate_x()
379 (((s16)tregs->x1) << 3); in bmc150_magn_compensate_x()
384 static s32 bmc150_magn_compensate_y(struct bmc150_magn_trim_regs *tregs, s16 y, in bmc150_magn_compensate_y()
387 s16 val; in bmc150_magn_compensate_y()
396 val = ((s16)(((u16)((((s32)xyz1) << 14) / rhall)) - ((u16)0x4000))); in bmc150_magn_compensate_y()
397 val = ((s16)((((s32)y) * ((((((((s32)tregs->xy2) * ((((s32)val) * in bmc150_magn_compensate_y()
399 ((s32)(((s16)tregs->xy1) << 7)))) >> 9) + ((s32)0x100000)) * in bmc150_magn_compensate_y()
400 ((s32)(((s16)tregs->y2) + ((s16)0xA0)))) >> 12)) >> 13)) + in bmc150_magn_compensate_y()
401 (((s16)tregs->y1) << 3); in bmc150_magn_compensate_y()
406 static s32 bmc150_magn_compensate_z(struct bmc150_magn_trim_regs *tregs, s16 z, in bmc150_magn_compensate_z()
412 s16 z2 = le16_to_cpu(tregs->z2); in bmc150_magn_compensate_z()
413 s16 z3 = le16_to_cpu(tregs->z3); in bmc150_magn_compensate_z()
414 s16 z4 = le16_to_cpu(tregs->z4); in bmc150_magn_compensate_z()
419 val = (((((s32)(z - z4)) << 15) - ((((s32)z3) * ((s32)(((s16)rhall) - in bmc150_magn_compensate_z()
420 ((s16)xyz1)))) >> 2)) / (z2 + ((s16)(((((s32)z1) * in bmc150_magn_compensate_z()
421 ((((s16)rhall) << 1))) + (1 << 15)) >> 16)))); in bmc150_magn_compensate_z()
430 s16 raw_x, raw_y, raw_z; in bmc150_magn_read_xyz()
439 raw_x = (s16)le16_to_cpu(values[AXIS_X]) >> BMC150_MAGN_SHIFT_XY_L; in bmc150_magn_read_xyz()
440 raw_y = (s16)le16_to_cpu(values[AXIS_Y]) >> BMC150_MAGN_SHIFT_XY_L; in bmc150_magn_read_xyz()
441 raw_z = (s16)le16_to_cpu(values[AXIS_Z]) >> BMC150_MAGN_SHIFT_Z_L; in bmc150_magn_read_xyz()