Lines Matching +full:sensor +full:- +full:gain

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * STMicroelectronics st_lsm6dsx sensor driver
27 #define ST_LSM6DS3TRC_DEV_NAME "lsm6ds3tr-c"
29 #define ST_LSM9DS1_DEV_NAME "lsm9ds1-imu"
150 u32 gain; member
163 * struct st_lsm6dsx_fifo_ops - ST IMU FIFO settings
168 * @max_size: Sensor max fifo length in FIFO words.
172 int (*update_fifo)(struct st_lsm6dsx_sensor *sensor, bool enable);
187 * struct st_lsm6dsx_hw_ts_settings - ST IMU hw timer settings
203 * struct st_lsm6dsx_shub_settings - ST IMU hw i2c controller settings
206 * @pullup_en: i2c controller pull-up register info (addr + mask).
207 * @aux_sens: aux sensor register info (addr + mask).
211 * @shub_out: sensor hub first output register info.
258 * struct st_lsm6dsx_ext_dev_settings - i2c controller slave settings
261 * @id: external sensor id.
262 * @odr_table: Output data rate of the sensor [Hz].
263 * @fs_table: Configured sensor sensitivity table depending on full scale.
294 * struct st_lsm6dsx_settings - ST IMU sensor settings
301 * @drdy_mask: register info for data-ready mask (addr + mask).
304 * @fs_table: Hw sensors gain table (gain + val).
307 * @fifo_ops: Sensor hw FIFO parameters.
361 * struct st_lsm6dsx_sensor - ST IMU sensor instance
362 * @name: Sensor name.
363 * @id: Sensor identifier.
365 * @gain: Configured sensor sensitivity.
366 * @odr: Output data rate of the sensor [Hz].
368 * @watermark: Sensor watermark level.
369 * @decimator: Sensor decimation factor.
371 * @ts_ref: Sensor timestamp reference for hw one.
372 * @ext_info: Sensor settings if it is connected to i2c controller
379 u32 gain; member
396 * struct st_lsm6dsx_hw - ST IMU MEMS hw instance
403 * @suspend_mask: Suspended sensor bitmask.
404 * @enable_mask: Enabled sensor bitmask.
414 * @settings: Pointer to the specific sensor settings in use.
415 * @orientation: sensor chip orientation relative to main hardware.
467 int st_lsm6dsx_sensor_set_enable(struct st_lsm6dsx_sensor *sensor,
471 int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor,
473 int st_lsm6dsx_update_fifo(struct st_lsm6dsx_sensor *sensor, bool enable);
478 int st_lsm6dsx_check_odr(struct st_lsm6dsx_sensor *sensor, u32 odr, u8 *val);
480 int st_lsm6dsx_shub_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable);
490 mutex_lock(&hw->page_lock); in st_lsm6dsx_update_bits_locked()
491 err = regmap_update_bits(hw->regmap, addr, mask, val); in st_lsm6dsx_update_bits_locked()
492 mutex_unlock(&hw->page_lock); in st_lsm6dsx_update_bits_locked()
503 mutex_lock(&hw->page_lock); in st_lsm6dsx_read_locked()
504 err = regmap_bulk_read(hw->regmap, addr, val, len); in st_lsm6dsx_read_locked()
505 mutex_unlock(&hw->page_lock); in st_lsm6dsx_read_locked()
516 mutex_lock(&hw->page_lock); in st_lsm6dsx_write_locked()
517 err = regmap_write(hw->regmap, addr, val); in st_lsm6dsx_write_locked()
518 mutex_unlock(&hw->page_lock); in st_lsm6dsx_write_locked()
527 struct st_lsm6dsx_sensor *sensor = iio_priv(iio_dev); in st_lsm6dsx_get_mount_matrix() local
528 struct st_lsm6dsx_hw *hw = sensor->hw; in st_lsm6dsx_get_mount_matrix()
530 return &hw->orientation; in st_lsm6dsx_get_mount_matrix()
534 st_lsm6dsx_device_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable) in st_lsm6dsx_device_set_enable() argument
536 if (sensor->id == ST_LSM6DSX_ID_EXT0 || in st_lsm6dsx_device_set_enable()
537 sensor->id == ST_LSM6DSX_ID_EXT1 || in st_lsm6dsx_device_set_enable()
538 sensor->id == ST_LSM6DSX_ID_EXT2) in st_lsm6dsx_device_set_enable()
539 return st_lsm6dsx_shub_set_enable(sensor, enable); in st_lsm6dsx_device_set_enable()
541 return st_lsm6dsx_sensor_set_enable(sensor, enable); in st_lsm6dsx_device_set_enable()