Lines Matching refs:sensor
103 struct st_lsm6dsx_sensor *sensor; in st_lsm6dsx_get_max_min_odr() local
111 sensor = iio_priv(hw->iio_devs[i]); in st_lsm6dsx_get_max_min_odr()
113 if (!(hw->enable_mask & BIT(sensor->id))) in st_lsm6dsx_get_max_min_odr()
116 *max_odr = max_t(u16, *max_odr, sensor->odr); in st_lsm6dsx_get_max_min_odr()
117 *min_odr = min_t(u16, *min_odr, sensor->odr); in st_lsm6dsx_get_max_min_odr()
125 struct st_lsm6dsx_sensor *sensor; in st_lsm6dsx_update_decimators() local
137 sensor = iio_priv(hw->iio_devs[i]); in st_lsm6dsx_update_decimators()
139 if (hw->enable_mask & BIT(sensor->id)) { in st_lsm6dsx_update_decimators()
140 sensor->sip = sensor->odr / min_odr; in st_lsm6dsx_update_decimators()
141 sensor->decimator = max_odr / sensor->odr; in st_lsm6dsx_update_decimators()
142 data = st_lsm6dsx_get_decimator_val(sensor->decimator); in st_lsm6dsx_update_decimators()
144 sensor->sip = 0; in st_lsm6dsx_update_decimators()
145 sensor->decimator = 0; in st_lsm6dsx_update_decimators()
148 ts_sip = max_t(u16, ts_sip, sensor->sip); in st_lsm6dsx_update_decimators()
150 dec_reg = &hw->settings->decimator[sensor->id]; in st_lsm6dsx_update_decimators()
160 sip += sensor->sip; in st_lsm6dsx_update_decimators()
198 static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor, in st_lsm6dsx_set_fifo_odr() argument
201 struct st_lsm6dsx_hw *hw = sensor->hw; in st_lsm6dsx_set_fifo_odr()
205 batch_reg = &hw->settings->batch[sensor->id]; in st_lsm6dsx_set_fifo_odr()
212 err = st_lsm6dsx_check_odr(sensor, sensor->odr, in st_lsm6dsx_set_fifo_odr()
232 int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark) in st_lsm6dsx_update_watermark() argument
235 struct st_lsm6dsx_hw *hw = sensor->hw; in st_lsm6dsx_update_watermark()
252 cur_watermark = (cur_sensor == sensor) ? watermark in st_lsm6dsx_update_watermark()
283 struct st_lsm6dsx_sensor *sensor; in st_lsm6dsx_reset_hw_ts() local
296 sensor = iio_priv(hw->iio_devs[i]); in st_lsm6dsx_reset_hw_ts()
301 sensor->ts_ref = iio_get_time_ns(hw->iio_devs[i]); in st_lsm6dsx_reset_hw_ts()
463 struct st_lsm6dsx_sensor *sensor; in st_lsm6dsx_push_tagged_data() local
501 sensor = iio_priv(iio_dev); in st_lsm6dsx_push_tagged_data()
503 ts + sensor->ts_ref); in st_lsm6dsx_push_tagged_data()
605 int st_lsm6dsx_update_fifo(struct st_lsm6dsx_sensor *sensor, bool enable) in st_lsm6dsx_update_fifo() argument
607 struct st_lsm6dsx_hw *hw = sensor->hw; in st_lsm6dsx_update_fifo()
618 if (sensor->id == ST_LSM6DSX_ID_EXT0 || in st_lsm6dsx_update_fifo()
619 sensor->id == ST_LSM6DSX_ID_EXT1 || in st_lsm6dsx_update_fifo()
620 sensor->id == ST_LSM6DSX_ID_EXT2) { in st_lsm6dsx_update_fifo()
621 err = st_lsm6dsx_shub_set_enable(sensor, enable); in st_lsm6dsx_update_fifo()
625 err = st_lsm6dsx_sensor_set_enable(sensor, enable); in st_lsm6dsx_update_fifo()
629 err = st_lsm6dsx_set_fifo_odr(sensor, enable); in st_lsm6dsx_update_fifo()
638 err = st_lsm6dsx_update_watermark(sensor, sensor->watermark); in st_lsm6dsx_update_fifo()
678 struct st_lsm6dsx_sensor *sensor = iio_priv(iio_dev); in st_lsm6dsx_buffer_preenable() local
679 struct st_lsm6dsx_hw *hw = sensor->hw; in st_lsm6dsx_buffer_preenable()
684 return hw->settings->fifo_ops.update_fifo(sensor, true); in st_lsm6dsx_buffer_preenable()
689 struct st_lsm6dsx_sensor *sensor = iio_priv(iio_dev); in st_lsm6dsx_buffer_postdisable() local
690 struct st_lsm6dsx_hw *hw = sensor->hw; in st_lsm6dsx_buffer_postdisable()
695 return hw->settings->fifo_ops.update_fifo(sensor, false); in st_lsm6dsx_buffer_postdisable()