Lines Matching +full:5 +full:c

11  * YAS535 MS-6C
13 * YAS537 MS-3T (2015 Samsung Galaxy S6, Note 5, Xiaomi)
18 * Copyright (C) 2012 InvenSense Corporation
97 /* Turn off device regulators etc after 5 seconds of inactivity */
158 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas530_extract_axis()
173 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas532_extract_axis()
227 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas5xx_measure()
241 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas5xx_measure()
245 val = FIELD_GET(GENMASK(14, 5), val); in yas5xx_measure()
266 struct yas5xx_calibration *c = &yas5xx->calibration; in yas5xx_linearize() local
296 * x' = x - (3721 + 50 * f) + (xoffset - r) * c in yas5xx_linearize()
298 * Where f and r are calibration values, c is a per-device in yas5xx_linearize()
301 return val - (3721 + 50 * c->f[axis]) + in yas5xx_linearize()
302 (yas5xx->hard_offsets[axis] - c->r[axis]) * coef; in yas5xx_linearize()
318 struct yas5xx_calibration *c = &yas5xx->calibration; in yas5xx_get_measure() local
341 sx = sx - (c->Cx * t) / 100; in yas5xx_get_measure()
342 sy1 = sy1 - (c->Cy1 * t) / 100; in yas5xx_get_measure()
343 sy2 = sy2 - (c->Cy2 * t) / 100; in yas5xx_get_measure()
372 *xo = c->k * ((100 * sx + c->a2 * sy + c->a3 * sz) / 10); in yas5xx_get_measure()
373 *yo = c->k * ((c->a4 * sx + c->a5 * sy + c->a6 * sz) / 10); in yas5xx_get_measure()
374 *zo = c->k * ((c->a7 * sx + c->a8 * sy + c->a9 * sz) / 10); in yas5xx_get_measure()
544 * @c: the calibration to populate
546 static void yas53x_extract_calibration(u8 *data, struct yas5xx_calibration *c) in yas53x_extract_calibration() argument
552 * a2 = 2 etc, k = k, c = clock divider in yas53x_extract_calibration()
554 * n 7 6 5 4 3 2 1 0 in yas53x_extract_calibration()
557 * 2 [ 5 5 5 5 5 5 6 6 ] bits 47 .. 40 in yas53x_extract_calibration()
560 * 5 [ 8 9 9 9 9 9 9 9 ] bits 23 .. 16 in yas53x_extract_calibration()
561 * 6 [ 9 k k k k k c c ] bits 15 .. 8 in yas53x_extract_calibration()
562 * 7 [ c x x x x x x x ] bits 7 .. 0 in yas53x_extract_calibration()
564 c->a2 = FIELD_GET(GENMASK_ULL(63, 58), val) - 32; in yas53x_extract_calibration()
565 c->a3 = FIELD_GET(GENMASK_ULL(57, 54), val) - 8; in yas53x_extract_calibration()
566 c->a4 = FIELD_GET(GENMASK_ULL(53, 48), val) - 32; in yas53x_extract_calibration()
567 c->a5 = FIELD_GET(GENMASK_ULL(47, 42), val) + 38; in yas53x_extract_calibration()
568 c->a6 = FIELD_GET(GENMASK_ULL(41, 36), val) - 32; in yas53x_extract_calibration()
569 c->a7 = FIELD_GET(GENMASK_ULL(35, 29), val) - 64; in yas53x_extract_calibration()
570 c->a8 = FIELD_GET(GENMASK_ULL(28, 23), val) - 32; in yas53x_extract_calibration()
571 c->a9 = FIELD_GET(GENMASK_ULL(22, 15), val); in yas53x_extract_calibration()
572 c->k = FIELD_GET(GENMASK_ULL(14, 10), val) + 10; in yas53x_extract_calibration()
573 c->dck = FIELD_GET(GENMASK_ULL(9, 7), val); in yas53x_extract_calibration()
578 struct yas5xx_calibration *c = &yas5xx->calibration; in yas530_get_calibration_data() local
598 c->Cx = data[0] * 6 - 768; in yas530_get_calibration_data()
599 c->Cy1 = data[1] * 6 - 768; in yas530_get_calibration_data()
600 c->Cy2 = data[2] * 6 - 768; in yas530_get_calibration_data()
601 yas53x_extract_calibration(&data[3], c); in yas530_get_calibration_data()
606 * The r factors are 6 bit values where bit 5 is the sign in yas530_get_calibration_data()
608 * n 7 6 5 4 3 2 1 0 in yas530_get_calibration_data()
615 c->f[0] = FIELD_GET(GENMASK(22, 21), val); in yas530_get_calibration_data()
616 c->f[1] = FIELD_GET(GENMASK(14, 13), val); in yas530_get_calibration_data()
617 c->f[2] = FIELD_GET(GENMASK(6, 5), val); in yas530_get_calibration_data()
618 c->r[0] = sign_extend32(FIELD_GET(GENMASK(28, 23), val), 5); in yas530_get_calibration_data()
619 c->r[1] = sign_extend32(FIELD_GET(GENMASK(20, 15), val), 5); in yas530_get_calibration_data()
620 c->r[2] = sign_extend32(FIELD_GET(GENMASK(12, 7), val), 5); in yas530_get_calibration_data()
626 struct yas5xx_calibration *c = &yas5xx->calibration; in yas532_get_calibration_data() local
652 c->Cx = data[0] * 10 - 1280; in yas532_get_calibration_data()
653 c->Cy1 = data[1] * 10 - 1280; in yas532_get_calibration_data()
654 c->Cy2 = data[2] * 10 - 1280; in yas532_get_calibration_data()
655 yas53x_extract_calibration(&data[3], c); in yas532_get_calibration_data()
659 * The r factors are 6 bit values where bit 5 is the sign in yas532_get_calibration_data()
661 * n 7 6 5 4 3 2 1 0 in yas532_get_calibration_data()
668 c->f[0] = FIELD_GET(GENMASK(24, 23), val); in yas532_get_calibration_data()
669 c->f[1] = FIELD_GET(GENMASK(16, 15), val); in yas532_get_calibration_data()
670 c->f[2] = FIELD_GET(GENMASK(8, 7), val); in yas532_get_calibration_data()
671 c->r[0] = sign_extend32(FIELD_GET(GENMASK(30, 25), val), 5); in yas532_get_calibration_data()
672 c->r[1] = sign_extend32(FIELD_GET(GENMASK(22, 17), val), 5); in yas532_get_calibration_data()
673 c->r[2] = sign_extend32(FIELD_GET(GENMASK(14, 7), val), 5); in yas532_get_calibration_data()
680 struct yas5xx_calibration *c = &yas5xx->calibration; in yas5xx_dump_calibration() local
683 c->f[0], c->f[1], c->f[2]); in yas5xx_dump_calibration()
685 c->r[0], c->r[1], c->r[2]); in yas5xx_dump_calibration()
686 dev_dbg(yas5xx->dev, "Cx = %d\n", c->Cx); in yas5xx_dump_calibration()
687 dev_dbg(yas5xx->dev, "Cy1 = %d\n", c->Cy1); in yas5xx_dump_calibration()
688 dev_dbg(yas5xx->dev, "Cy2 = %d\n", c->Cy2); in yas5xx_dump_calibration()
689 dev_dbg(yas5xx->dev, "a2 = %d\n", c->a2); in yas5xx_dump_calibration()
690 dev_dbg(yas5xx->dev, "a3 = %d\n", c->a3); in yas5xx_dump_calibration()
691 dev_dbg(yas5xx->dev, "a4 = %d\n", c->a4); in yas5xx_dump_calibration()
692 dev_dbg(yas5xx->dev, "a5 = %d\n", c->a5); in yas5xx_dump_calibration()
693 dev_dbg(yas5xx->dev, "a6 = %d\n", c->a6); in yas5xx_dump_calibration()
694 dev_dbg(yas5xx->dev, "a7 = %d\n", c->a7); in yas5xx_dump_calibration()
695 dev_dbg(yas5xx->dev, "a8 = %d\n", c->a8); in yas5xx_dump_calibration()
696 dev_dbg(yas5xx->dev, "a9 = %d\n", c->a9); in yas5xx_dump_calibration()
697 dev_dbg(yas5xx->dev, "k = %d\n", c->k); in yas5xx_dump_calibration()
698 dev_dbg(yas5xx->dev, "dck = %d\n", c->dck); in yas5xx_dump_calibration()
774 5-i, x, y1, y2); in yas5xx_meaure_offsets()