Lines Matching refs:drv_data
71 const struct icm42605_data *drv_data = dev->data; in icm42605_channel_get() local
75 icm42605_convert_accel(val, drv_data->accel_x, in icm42605_channel_get()
76 drv_data->accel_sensitivity_shift); in icm42605_channel_get()
77 icm42605_convert_accel(val + 1, drv_data->accel_y, in icm42605_channel_get()
78 drv_data->accel_sensitivity_shift); in icm42605_channel_get()
79 icm42605_convert_accel(val + 2, drv_data->accel_z, in icm42605_channel_get()
80 drv_data->accel_sensitivity_shift); in icm42605_channel_get()
83 icm42605_convert_accel(val, drv_data->accel_x, in icm42605_channel_get()
84 drv_data->accel_sensitivity_shift); in icm42605_channel_get()
87 icm42605_convert_accel(val, drv_data->accel_y, in icm42605_channel_get()
88 drv_data->accel_sensitivity_shift); in icm42605_channel_get()
91 icm42605_convert_accel(val, drv_data->accel_z, in icm42605_channel_get()
92 drv_data->accel_sensitivity_shift); in icm42605_channel_get()
95 icm42605_convert_gyro(val, drv_data->gyro_x, in icm42605_channel_get()
96 drv_data->gyro_sensitivity_x10); in icm42605_channel_get()
97 icm42605_convert_gyro(val + 1, drv_data->gyro_y, in icm42605_channel_get()
98 drv_data->gyro_sensitivity_x10); in icm42605_channel_get()
99 icm42605_convert_gyro(val + 2, drv_data->gyro_z, in icm42605_channel_get()
100 drv_data->gyro_sensitivity_x10); in icm42605_channel_get()
103 icm42605_convert_gyro(val, drv_data->gyro_x, in icm42605_channel_get()
104 drv_data->gyro_sensitivity_x10); in icm42605_channel_get()
107 icm42605_convert_gyro(val, drv_data->gyro_y, in icm42605_channel_get()
108 drv_data->gyro_sensitivity_x10); in icm42605_channel_get()
111 icm42605_convert_gyro(val, drv_data->gyro_z, in icm42605_channel_get()
112 drv_data->gyro_sensitivity_x10); in icm42605_channel_get()
115 icm42605_convert_temp(val, drv_data->temp); in icm42605_channel_get()
127 struct icm42605_data *drv_data = dev->data; in icm42605_tap_fetch() local
130 if (drv_data->tap_en && in icm42605_tap_fetch()
131 (drv_data->tap_handler || drv_data->double_tap_handler)) { in icm42605_tap_fetch()
132 result = inv_spi_read(&cfg->spi, REG_INT_STATUS3, drv_data->fifo_data, 1); in icm42605_tap_fetch()
133 if (drv_data->fifo_data[0] & BIT_INT_STATUS_TAP_DET) { in icm42605_tap_fetch()
135 drv_data->fifo_data, 1); in icm42605_tap_fetch()
136 if (drv_data->fifo_data[0] & APEX_TAP) { in icm42605_tap_fetch()
137 if (drv_data->tap_trigger->type == in icm42605_tap_fetch()
139 if (drv_data->tap_handler) { in icm42605_tap_fetch()
141 drv_data->tap_handler(dev in icm42605_tap_fetch()
142 , drv_data->tap_trigger); in icm42605_tap_fetch()
147 } else if (drv_data->fifo_data[0] & APEX_DOUBLE_TAP) { in icm42605_tap_fetch()
148 if (drv_data->double_tap_trigger->type == in icm42605_tap_fetch()
150 if (drv_data->double_tap_handler) { in icm42605_tap_fetch()
152 drv_data->double_tap_handler(dev in icm42605_tap_fetch()
153 , drv_data->tap_trigger); in icm42605_tap_fetch()
172 struct icm42605_data *drv_data = dev->data; in icm42605_sample_fetch() local
176 result = inv_spi_read(&cfg->spi, REG_INT_STATUS, drv_data->fifo_data, 3); in icm42605_sample_fetch()
178 if (drv_data->fifo_data[0] & BIT_INT_STATUS_DRDY) { in icm42605_sample_fetch()
179 fifo_count = (drv_data->fifo_data[1] << 8) in icm42605_sample_fetch()
180 + (drv_data->fifo_data[2]); in icm42605_sample_fetch()
181 result = inv_spi_read(&cfg->spi, REG_FIFO_DATA, drv_data->fifo_data, in icm42605_sample_fetch()
192 if (drv_data->fifo_data[0] & BIT_FIFO_HEAD_ACCEL) { in icm42605_sample_fetch()
194 if (!(drv_data->fifo_data[1] == FIFO_ACCEL0_RESET_VALUE in icm42605_sample_fetch()
195 && drv_data->fifo_data[2] == in icm42605_sample_fetch()
197 drv_data->accel_x = in icm42605_sample_fetch()
198 (drv_data->fifo_data[1] << 8) in icm42605_sample_fetch()
199 + (drv_data->fifo_data[2]); in icm42605_sample_fetch()
200 drv_data->accel_y = in icm42605_sample_fetch()
201 (drv_data->fifo_data[3] << 8) in icm42605_sample_fetch()
202 + (drv_data->fifo_data[4]); in icm42605_sample_fetch()
203 drv_data->accel_z = in icm42605_sample_fetch()
204 (drv_data->fifo_data[5] << 8) in icm42605_sample_fetch()
205 + (drv_data->fifo_data[6]); in icm42605_sample_fetch()
207 if (!(drv_data->fifo_data[0] & BIT_FIFO_HEAD_GYRO)) { in icm42605_sample_fetch()
208 drv_data->temp = in icm42605_sample_fetch()
209 (int16_t)(drv_data->fifo_data[7]); in icm42605_sample_fetch()
211 if (!(drv_data->fifo_data[7] == in icm42605_sample_fetch()
213 drv_data->fifo_data[8] == in icm42605_sample_fetch()
215 drv_data->gyro_x = in icm42605_sample_fetch()
216 (drv_data->fifo_data[7] << 8) in icm42605_sample_fetch()
217 + (drv_data->fifo_data[8]); in icm42605_sample_fetch()
218 drv_data->gyro_y = in icm42605_sample_fetch()
219 (drv_data->fifo_data[9] << 8) in icm42605_sample_fetch()
220 + (drv_data->fifo_data[10]); in icm42605_sample_fetch()
221 drv_data->gyro_z = in icm42605_sample_fetch()
222 (drv_data->fifo_data[11] << 8) in icm42605_sample_fetch()
223 + (drv_data->fifo_data[12]); in icm42605_sample_fetch()
225 drv_data->temp = in icm42605_sample_fetch()
226 (int16_t)(drv_data->fifo_data[13]); in icm42605_sample_fetch()
229 if (drv_data->fifo_data[0] & BIT_FIFO_HEAD_GYRO) { in icm42605_sample_fetch()
230 if (!(drv_data->fifo_data[1] == in icm42605_sample_fetch()
232 drv_data->fifo_data[2] == in icm42605_sample_fetch()
234 drv_data->gyro_x = in icm42605_sample_fetch()
235 (drv_data->fifo_data[1] << 8) in icm42605_sample_fetch()
236 + (drv_data->fifo_data[2]); in icm42605_sample_fetch()
237 drv_data->gyro_y = in icm42605_sample_fetch()
238 (drv_data->fifo_data[3] << 8) in icm42605_sample_fetch()
239 + (drv_data->fifo_data[4]); in icm42605_sample_fetch()
240 drv_data->gyro_z = in icm42605_sample_fetch()
241 (drv_data->fifo_data[5] << 8) in icm42605_sample_fetch()
242 + (drv_data->fifo_data[6]); in icm42605_sample_fetch()
244 drv_data->temp = in icm42605_sample_fetch()
245 (int16_t)(drv_data->fifo_data[7]); in icm42605_sample_fetch()
258 struct icm42605_data *drv_data = dev->data; in icm42605_attr_set() local
272 drv_data->accel_hz = val->val1; in icm42605_attr_set()
280 drv_data->accel_sf = val->val1; in icm42605_attr_set()
297 drv_data->gyro_hz = val->val1; in icm42605_attr_set()
305 drv_data->gyro_sf = val->val1; in icm42605_attr_set()
325 const struct icm42605_data *drv_data = dev->data; in icm42605_attr_get() local
335 val->val1 = drv_data->accel_hz; in icm42605_attr_get()
337 val->val1 = drv_data->accel_sf; in icm42605_attr_get()
349 val->val1 = drv_data->gyro_hz; in icm42605_attr_get()
351 val->val1 = drv_data->gyro_sf; in icm42605_attr_get()
392 struct icm42605_data *drv_data = dev->data; in icm42605_init() local
400 icm42605_data_init(drv_data, cfg); in icm42605_init()
403 drv_data->accel_sensitivity_shift = 14 - 3; in icm42605_init()
404 drv_data->gyro_sensitivity_x10 = icm42605_gyro_sensitivity_x10[3]; in icm42605_init()