Lines Matching +full:5 +full:c

11  * YAS535 MS-6C
13 * YAS537 MS-3T (2015 Samsung Galaxy S6, Note 5, Galaxy S7)
18 * Copyright (C) 2012 InvenSense Corporation
21 * Copyright (c) 2014 Yamaha Corporation
92 #define YAS5XX_MEASURE_CONT BIT(5)
125 #define YAS537_MTC3_MASK_GET GENMASK(7, 5)
131 #define YAS537_OC_MASK_GET GENMASK(5, 0)
133 /* Turn off device regulators etc after 5 seconds of inactivity */
176 * @t_ref: number of counts at reference temperature 20 °C
250 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas530_extract_axis()
265 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas532_extract_axis()
322 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas530_measure()
336 * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 in yas530_measure()
340 val = FIELD_GET(GENMASK(14, 5), val); in yas530_measure()
370 struct yas5xx_calibration *c = &yas5xx->calibration; in yas537_measure() local
410 h[0] = (c->k * (128 * s[0] + c->a2 * s[1] + c->a3 * s[2])) / BIT(13); in yas537_measure()
411 h[1] = (c->k * (c->a4 * s[0] + c->a5 * s[1] + c->a6 * s[2])) / BIT(13); in yas537_measure()
412 h[2] = (c->k * (c->a7 * s[0] + c->a8 * s[1] + c->a9 * s[2])) / BIT(13); in yas537_measure()
434 struct yas5xx_calibration *c = &yas5xx->calibration; in yas530_linearize() local
464 * x' = x - (3721 + 50 * f) + (xoffset - r) * c in yas530_linearize()
466 * Where f and r are calibration values, c is a per-device in yas530_linearize()
469 return val - (3721 + 50 * c->f[axis]) + in yas530_linearize()
470 (yas5xx->hard_offsets[axis] - c->r[axis]) * coef; in yas530_linearize()
503 struct yas5xx_calibration *c = &yas5xx->calibration; in yas530_get_measure() local
539 sx = sx - (c->Cx * t_comp) / 100; in yas530_get_measure()
540 sy1 = sy1 - (c->Cy1 * t_comp) / 100; in yas530_get_measure()
541 sy2 = sy2 - (c->Cy2 * t_comp) / 100; in yas530_get_measure()
568 *xo = c->k * ((100 * sx + c->a2 * sy + c->a3 * sz) / 10); in yas530_get_measure()
569 *yo = c->k * ((c->a4 * sx + c->a5 * sy + c->a6 * sz) / 10); in yas530_get_measure()
570 *zo = c->k * ((c->a7 * sx + c->a8 * sy + c->a9 * sz) / 10); in yas530_get_measure()
784 * @c: the calibration to populate
788 static void yas530_extract_calibration(u8 *data, struct yas5xx_calibration *c) in yas530_extract_calibration() argument
794 * a2 = 2 etc, k = k, c = clock divider in yas530_extract_calibration()
796 * n 7 6 5 4 3 2 1 0 in yas530_extract_calibration()
799 * 2 [ 5 5 5 5 5 5 6 6 ] bits 47 .. 40 in yas530_extract_calibration()
802 * 5 [ 8 9 9 9 9 9 9 9 ] bits 23 .. 16 in yas530_extract_calibration()
803 * 6 [ 9 k k k k k c c ] bits 15 .. 8 in yas530_extract_calibration()
804 * 7 [ c x x x x x x x ] bits 7 .. 0 in yas530_extract_calibration()
806 c->a2 = FIELD_GET(GENMASK_ULL(63, 58), val) - 32; in yas530_extract_calibration()
807 c->a3 = FIELD_GET(GENMASK_ULL(57, 54), val) - 8; in yas530_extract_calibration()
808 c->a4 = FIELD_GET(GENMASK_ULL(53, 48), val) - 32; in yas530_extract_calibration()
809 c->a5 = FIELD_GET(GENMASK_ULL(47, 42), val) + 38; in yas530_extract_calibration()
810 c->a6 = FIELD_GET(GENMASK_ULL(41, 36), val) - 32; in yas530_extract_calibration()
811 c->a7 = FIELD_GET(GENMASK_ULL(35, 29), val) - 64; in yas530_extract_calibration()
812 c->a8 = FIELD_GET(GENMASK_ULL(28, 23), val) - 32; in yas530_extract_calibration()
813 c->a9 = FIELD_GET(GENMASK_ULL(22, 15), val); in yas530_extract_calibration()
814 c->k = FIELD_GET(GENMASK_ULL(14, 10), val) + 10; in yas530_extract_calibration()
815 c->dck = FIELD_GET(GENMASK_ULL(9, 7), val); in yas530_extract_calibration()
820 struct yas5xx_calibration *c = &yas5xx->calibration; in yas530_get_calibration_data() local
843 c->Cx = data[0] * 6 - 768; in yas530_get_calibration_data()
844 c->Cy1 = data[1] * 6 - 768; in yas530_get_calibration_data()
845 c->Cy2 = data[2] * 6 - 768; in yas530_get_calibration_data()
846 yas530_extract_calibration(&data[3], c); in yas530_get_calibration_data()
851 * The r factors are 6 bit values where bit 5 is the sign in yas530_get_calibration_data()
853 * n 7 6 5 4 3 2 1 0 in yas530_get_calibration_data()
860 c->f[0] = FIELD_GET(GENMASK(22, 21), val); in yas530_get_calibration_data()
861 c->f[1] = FIELD_GET(GENMASK(14, 13), val); in yas530_get_calibration_data()
862 c->f[2] = FIELD_GET(GENMASK(6, 5), val); in yas530_get_calibration_data()
863 c->r[0] = sign_extend32(FIELD_GET(GENMASK(28, 23), val), 5); in yas530_get_calibration_data()
864 c->r[1] = sign_extend32(FIELD_GET(GENMASK(20, 15), val), 5); in yas530_get_calibration_data()
865 c->r[2] = sign_extend32(FIELD_GET(GENMASK(12, 7), val), 5); in yas530_get_calibration_data()
872 struct yas5xx_calibration *c = &yas5xx->calibration; in yas532_get_calibration_data() local
898 c->Cx = data[0] * 10 - 1280; in yas532_get_calibration_data()
899 c->Cy1 = data[1] * 10 - 1280; in yas532_get_calibration_data()
900 c->Cy2 = data[2] * 10 - 1280; in yas532_get_calibration_data()
901 yas530_extract_calibration(&data[3], c); in yas532_get_calibration_data()
906 * The r factors are 6 bit values where bit 5 is the sign in yas532_get_calibration_data()
908 * n 7 6 5 4 3 2 1 0 in yas532_get_calibration_data()
915 c->f[0] = FIELD_GET(GENMASK(24, 23), val); in yas532_get_calibration_data()
916 c->f[1] = FIELD_GET(GENMASK(16, 15), val); in yas532_get_calibration_data()
917 c->f[2] = FIELD_GET(GENMASK(8, 7), val); in yas532_get_calibration_data()
918 c->r[0] = sign_extend32(FIELD_GET(GENMASK(30, 25), val), 5); in yas532_get_calibration_data()
919 c->r[1] = sign_extend32(FIELD_GET(GENMASK(22, 17), val), 5); in yas532_get_calibration_data()
920 c->r[2] = sign_extend32(FIELD_GET(GENMASK(14, 7), val), 5); in yas532_get_calibration_data()
927 struct yas5xx_calibration *c = &yas5xx->calibration; in yas537_get_calibration_data() local
944 if (!memchr_inv(data, 0x00, 16) && !FIELD_GET(GENMASK(5, 0), data[16])) in yas537_get_calibration_data()
964 * data[5] 0x98 in yas537_get_calibration_data()
1035 * data[3] n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1038 * data[15] n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1041 * data[15] n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1044 * data[16] n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1071 * n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1077 * n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1080 * data[5] 2 [ a3 a4 a4 a4 a4 a4 a4 a4 ] bits 15 .. 8 in yas537_get_calibration_data()
1083 * n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1089 * n 7 6 5 4 3 2 1 0 in yas537_get_calibration_data()
1100 c->Cx = FIELD_GET(GENMASK(31, 23), val1) - 256; in yas537_get_calibration_data()
1101 c->Cy1 = FIELD_GET(GENMASK(22, 14), val1) - 256; in yas537_get_calibration_data()
1102 c->Cy2 = FIELD_GET(GENMASK(13, 5), val1) - 256; in yas537_get_calibration_data()
1103 c->a2 = FIELD_GET(GENMASK(28, 22), val2) - 64; in yas537_get_calibration_data()
1104 c->a3 = FIELD_GET(GENMASK(21, 15), val2) - 64; in yas537_get_calibration_data()
1105 c->a4 = FIELD_GET(GENMASK(14, 7), val2) - 128; in yas537_get_calibration_data()
1106 c->a5 = FIELD_GET(GENMASK(30, 22), val3) - 112; in yas537_get_calibration_data()
1107 c->a6 = FIELD_GET(GENMASK(21, 15), val3) - 64; in yas537_get_calibration_data()
1108 c->a7 = FIELD_GET(GENMASK(14, 7), val3) - 128; in yas537_get_calibration_data()
1109 c->a8 = FIELD_GET(GENMASK(30, 24), val4) - 64; in yas537_get_calibration_data()
1110 c->a9 = FIELD_GET(GENMASK(23, 15), val4) - 112; in yas537_get_calibration_data()
1111 c->k = FIELD_GET(GENMASK(14, 8), val4); in yas537_get_calibration_data()
1124 struct yas5xx_calibration *c = &yas5xx->calibration; in yas530_dump_calibration() local
1127 c->f[0], c->f[1], c->f[2]); in yas530_dump_calibration()
1129 c->r[0], c->r[1], c->r[2]); in yas530_dump_calibration()
1130 dev_dbg(yas5xx->dev, "Cx = %d\n", c->Cx); in yas530_dump_calibration()
1131 dev_dbg(yas5xx->dev, "Cy1 = %d\n", c->Cy1); in yas530_dump_calibration()
1132 dev_dbg(yas5xx->dev, "Cy2 = %d\n", c->Cy2); in yas530_dump_calibration()
1133 dev_dbg(yas5xx->dev, "a2 = %d\n", c->a2); in yas530_dump_calibration()
1134 dev_dbg(yas5xx->dev, "a3 = %d\n", c->a3); in yas530_dump_calibration()
1135 dev_dbg(yas5xx->dev, "a4 = %d\n", c->a4); in yas530_dump_calibration()
1136 dev_dbg(yas5xx->dev, "a5 = %d\n", c->a5); in yas530_dump_calibration()
1137 dev_dbg(yas5xx->dev, "a6 = %d\n", c->a6); in yas530_dump_calibration()
1138 dev_dbg(yas5xx->dev, "a7 = %d\n", c->a7); in yas530_dump_calibration()
1139 dev_dbg(yas5xx->dev, "a8 = %d\n", c->a8); in yas530_dump_calibration()
1140 dev_dbg(yas5xx->dev, "a9 = %d\n", c->a9); in yas530_dump_calibration()
1141 dev_dbg(yas5xx->dev, "k = %d\n", c->k); in yas530_dump_calibration()
1142 dev_dbg(yas5xx->dev, "dck = %d\n", c->dck); in yas530_dump_calibration()
1147 struct yas5xx_calibration *c = &yas5xx->calibration; in yas537_dump_calibration() local
1150 dev_dbg(yas5xx->dev, "Cx = %d\n", c->Cx); in yas537_dump_calibration()
1151 dev_dbg(yas5xx->dev, "Cy1 = %d\n", c->Cy1); in yas537_dump_calibration()
1152 dev_dbg(yas5xx->dev, "Cy2 = %d\n", c->Cy2); in yas537_dump_calibration()
1153 dev_dbg(yas5xx->dev, "a2 = %d\n", c->a2); in yas537_dump_calibration()
1154 dev_dbg(yas5xx->dev, "a3 = %d\n", c->a3); in yas537_dump_calibration()
1155 dev_dbg(yas5xx->dev, "a4 = %d\n", c->a4); in yas537_dump_calibration()
1156 dev_dbg(yas5xx->dev, "a5 = %d\n", c->a5); in yas537_dump_calibration()
1157 dev_dbg(yas5xx->dev, "a6 = %d\n", c->a6); in yas537_dump_calibration()
1158 dev_dbg(yas5xx->dev, "a7 = %d\n", c->a7); in yas537_dump_calibration()
1159 dev_dbg(yas5xx->dev, "a8 = %d\n", c->a8); in yas537_dump_calibration()
1160 dev_dbg(yas5xx->dev, "a9 = %d\n", c->a9); in yas537_dump_calibration()
1161 dev_dbg(yas5xx->dev, "k = %d\n", c->k); in yas537_dump_calibration()
1242 5-i, x, y1, y2); in yas530_measure_offsets()