Lines Matching refs:rot_state

71 	struct dev_rot_state *rot_state = iio_priv(indio_dev);  in dev_rot_read_raw()  local
82 vals[i] = rot_state->scan.sampled_vals[i]; in dev_rot_read_raw()
89 vals[0] = rot_state->scale_pre_decml; in dev_rot_read_raw()
90 vals[1] = rot_state->scale_post_decml; in dev_rot_read_raw()
91 return rot_state->scale_precision; in dev_rot_read_raw()
94 *vals = rot_state->value_offset; in dev_rot_read_raw()
99 &rot_state->common_attributes, &vals[0], &vals[1]); in dev_rot_read_raw()
103 &rot_state->common_attributes, &vals[0], &vals[1]); in dev_rot_read_raw()
120 struct dev_rot_state *rot_state = iio_priv(indio_dev); in dev_rot_write_raw() local
126 &rot_state->common_attributes, val, val2); in dev_rot_write_raw()
130 &rot_state->common_attributes, val, val2); in dev_rot_write_raw()
150 struct dev_rot_state *rot_state = iio_priv(indio_dev); in dev_rot_proc_event() local
153 if (atomic_read(&rot_state->common_attributes.data_ready)) { in dev_rot_proc_event()
154 if (!rot_state->timestamp) in dev_rot_proc_event()
155 rot_state->timestamp = iio_get_time_ns(indio_dev); in dev_rot_proc_event()
157 iio_push_to_buffers_with_timestamp(indio_dev, &rot_state->scan, in dev_rot_proc_event()
158 rot_state->timestamp); in dev_rot_proc_event()
160 rot_state->timestamp = 0; in dev_rot_proc_event()
173 struct dev_rot_state *rot_state = iio_priv(indio_dev); in dev_rot_capture_sample() local
177 rot_state->scan.sampled_vals[0] = ((s16 *)raw_data)[0]; in dev_rot_capture_sample()
178 rot_state->scan.sampled_vals[1] = ((s16 *)raw_data)[1]; in dev_rot_capture_sample()
179 rot_state->scan.sampled_vals[2] = ((s16 *)raw_data)[2]; in dev_rot_capture_sample()
180 rot_state->scan.sampled_vals[3] = ((s16 *)raw_data)[3]; in dev_rot_capture_sample()
182 memcpy(&rot_state->scan.sampled_vals, raw_data, in dev_rot_capture_sample()
183 sizeof(rot_state->scan.sampled_vals)); in dev_rot_capture_sample()
187 sizeof(rot_state->scan.sampled_vals)); in dev_rot_capture_sample()
189 rot_state->timestamp = hid_sensor_convert_timestamp(&rot_state->common_attributes, in dev_rot_capture_sample()
236 struct dev_rot_state *rot_state; in hid_dev_rot_probe() local
246 rot_state = iio_priv(indio_dev); in hid_dev_rot_probe()
247 rot_state->common_attributes.hsdev = hsdev; in hid_dev_rot_probe()
248 rot_state->common_attributes.pdev = pdev; in hid_dev_rot_probe()
266 &rot_state->common_attributes, in hid_dev_rot_probe()
284 hsdev->usage, rot_state); in hid_dev_rot_probe()
295 atomic_set(&rot_state->common_attributes.data_ready, 0); in hid_dev_rot_probe()
298 &rot_state->common_attributes); in hid_dev_rot_probe()
310 rot_state->callbacks.send_event = dev_rot_proc_event; in hid_dev_rot_probe()
311 rot_state->callbacks.capture_sample = dev_rot_capture_sample; in hid_dev_rot_probe()
312 rot_state->callbacks.pdev = pdev; in hid_dev_rot_probe()
314 &rot_state->callbacks); in hid_dev_rot_probe()
325 hid_sensor_remove_trigger(indio_dev, &rot_state->common_attributes); in hid_dev_rot_probe()
334 struct dev_rot_state *rot_state = iio_priv(indio_dev); in hid_dev_rot_remove() local
338 hid_sensor_remove_trigger(indio_dev, &rot_state->common_attributes); in hid_dev_rot_remove()