Lines Matching refs:magn_state
152 struct magn_3d_state *magn_state = iio_priv(indio_dev); in magn_3d_read_raw() local
162 hid_sensor_power_state(&magn_state->magn_flux_attributes, true); in magn_3d_read_raw()
163 report_id = magn_state->magn[chan->address].report_id; in magn_3d_read_raw()
164 min = magn_state->magn[chan->address].logical_minimum; in magn_3d_read_raw()
168 magn_state->magn_flux_attributes.hsdev, in magn_3d_read_raw()
176 &magn_state->magn_flux_attributes, in magn_3d_read_raw()
180 hid_sensor_power_state(&magn_state->magn_flux_attributes, in magn_3d_read_raw()
187 *val = magn_state->magn_flux_attr.scale_pre_decml; in magn_3d_read_raw()
188 *val2 = magn_state->magn_flux_attr.scale_post_decml; in magn_3d_read_raw()
189 ret_type = magn_state->magn_flux_attr.scale_precision; in magn_3d_read_raw()
192 *val = magn_state->rot_attr.scale_pre_decml; in magn_3d_read_raw()
193 *val2 = magn_state->rot_attr.scale_post_decml; in magn_3d_read_raw()
194 ret_type = magn_state->rot_attr.scale_precision; in magn_3d_read_raw()
203 *val = magn_state->magn_flux_attr.value_offset; in magn_3d_read_raw()
207 *val = magn_state->rot_attr.value_offset; in magn_3d_read_raw()
216 &magn_state->magn_flux_attributes, val, val2); in magn_3d_read_raw()
222 &magn_state->magn_flux_attributes, val, val2); in magn_3d_read_raw()
226 &magn_state->rot_attributes, val, val2); in magn_3d_read_raw()
247 struct magn_3d_state *magn_state = iio_priv(indio_dev); in magn_3d_write_raw() local
253 &magn_state->magn_flux_attributes, val, val2); in magn_3d_write_raw()
259 &magn_state->magn_flux_attributes, val, val2); in magn_3d_write_raw()
263 &magn_state->rot_attributes, val, val2); in magn_3d_write_raw()
287 struct magn_3d_state *magn_state = iio_priv(indio_dev); in magn_3d_proc_event() local
290 if (atomic_read(&magn_state->magn_flux_attributes.data_ready)) { in magn_3d_proc_event()
291 if (!magn_state->timestamp) in magn_3d_proc_event()
292 magn_state->timestamp = iio_get_time_ns(indio_dev); in magn_3d_proc_event()
295 magn_state->iio_vals, in magn_3d_proc_event()
296 magn_state->timestamp); in magn_3d_proc_event()
297 magn_state->timestamp = 0; in magn_3d_proc_event()
310 struct magn_3d_state *magn_state = iio_priv(indio_dev); in magn_3d_capture_sample() local
330 magn_state->timestamp = in magn_3d_capture_sample()
331 hid_sensor_convert_timestamp(&magn_state->magn_flux_attributes, in magn_3d_capture_sample()
338 iio_val = magn_state->magn_val_addr[offset]; in magn_3d_capture_sample()
472 struct magn_3d_state *magn_state; in hid_magn_3d_probe() local
484 magn_state = iio_priv(indio_dev); in hid_magn_3d_probe()
485 magn_state->magn_flux_attributes.hsdev = hsdev; in hid_magn_3d_probe()
486 magn_state->magn_flux_attributes.pdev = pdev; in hid_magn_3d_probe()
490 &magn_state->magn_flux_attributes, in hid_magn_3d_probe()
497 magn_state->rot_attributes = magn_state->magn_flux_attributes; in hid_magn_3d_probe()
499 magn_state->rot_attributes.sensitivity.index = -1; in hid_magn_3d_probe()
503 HID_USAGE_SENSOR_COMPASS_3D, magn_state); in hid_magn_3d_probe()
515 atomic_set(&magn_state->magn_flux_attributes.data_ready, 0); in hid_magn_3d_probe()
518 &magn_state->magn_flux_attributes); in hid_magn_3d_probe()
530 magn_state->callbacks.send_event = magn_3d_proc_event; in hid_magn_3d_probe()
531 magn_state->callbacks.capture_sample = magn_3d_capture_sample; in hid_magn_3d_probe()
532 magn_state->callbacks.pdev = pdev; in hid_magn_3d_probe()
534 &magn_state->callbacks); in hid_magn_3d_probe()
545 hid_sensor_remove_trigger(indio_dev, &magn_state->magn_flux_attributes); in hid_magn_3d_probe()
554 struct magn_3d_state *magn_state = iio_priv(indio_dev); in hid_magn_3d_remove() local
558 hid_sensor_remove_trigger(indio_dev, &magn_state->magn_flux_attributes); in hid_magn_3d_remove()