drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
Source file repositories/reference/linux-study-clean/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h- Extension
.h- Size
- 16688 bytes
- Lines
- 582
- Domain
- Driver Families
- Bucket
- drivers/iio
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/iio/iio.hlinux/regulator/consumer.h
Detected Declarations
struct st_lsm6dsx_regstruct st_lsm6dsx_sensorstruct st_lsm6dsx_hwstruct st_lsm6dsx_odrstruct st_lsm6dsx_odr_table_entrystruct st_lsm6dsx_samples_to_discardstruct st_lsm6dsx_fsstruct st_lsm6dsx_fs_table_entrystruct st_lsm6dsx_fifo_opsstruct st_lsm6dsx_hw_ts_settingsstruct st_lsm6dsx_shub_settingsstruct st_lsm6dsx_event_srcstruct st_lsm6dsx_event_settingsstruct st_lsm6dsx_ext_dev_settingsstruct st_lsm6dsx_settingsstruct st_lsm6dsx_sensorstruct st_lsm6dsx_hwenum st_lsm6dsx_hw_idenum st_lsm6dsx_event_idenum st_lsm6dsx_sensor_idenum st_lsm6dsx_ext_sensor_idenum st_lsm6dsx_fifo_modefunction st_lsm6dsx_update_bits_lockedfunction st_lsm6dsx_read_lockedfunction st_lsm6dsx_write_lockedfunction st_lsm6dsx_get_mount_matrixfunction st_lsm6dsx_device_set_enable
Annotated Snippet
struct st_lsm6dsx_reg {
u8 addr;
u8 mask;
};
struct st_lsm6dsx_sensor;
struct st_lsm6dsx_hw;
struct st_lsm6dsx_odr {
u32 milli_hz;
u8 val;
};
#define ST_LSM6DSX_ODR_LIST_SIZE 8
struct st_lsm6dsx_odr_table_entry {
struct st_lsm6dsx_reg reg;
struct st_lsm6dsx_odr odr_avl[ST_LSM6DSX_ODR_LIST_SIZE];
int odr_len;
};
struct st_lsm6dsx_samples_to_discard {
struct {
u32 milli_hz;
u16 samples;
} val[ST_LSM6DSX_ODR_LIST_SIZE];
};
struct st_lsm6dsx_fs {
u32 gain;
u8 val;
};
#define ST_LSM6DSX_FS_LIST_SIZE 4
struct st_lsm6dsx_fs_table_entry {
struct st_lsm6dsx_reg reg;
struct st_lsm6dsx_fs fs_avl[ST_LSM6DSX_FS_LIST_SIZE];
int fs_len;
};
/**
* struct st_lsm6dsx_fifo_ops - ST IMU FIFO settings
* @update_fifo: Update FIFO configuration callback.
* @read_fifo: Read FIFO callback.
* @fifo_th: FIFO threshold register info (addr + mask).
* @fifo_diff: FIFO diff status register info (addr + mask).
* @max_size: Sensor max fifo length in FIFO words.
* @th_wl: FIFO threshold word length.
*/
struct st_lsm6dsx_fifo_ops {
int (*update_fifo)(struct st_lsm6dsx_sensor *sensor, bool enable);
int (*read_fifo)(struct st_lsm6dsx_hw *hw);
struct {
u8 addr;
u16 mask;
} fifo_th;
struct {
u8 addr;
u16 mask;
} fifo_diff;
u16 max_size;
u8 th_wl;
};
/**
* struct st_lsm6dsx_hw_ts_settings - ST IMU hw timer settings
* @timer_en: Hw timer enable register info (addr + mask).
* @hr_timer: Hw timer resolution register info (addr + mask).
* @fifo_en: Hw timer FIFO enable register info (addr + mask).
* @decimator: Hw timer FIFO decimator register info (addr + mask).
* @freq_fine: Difference in % of ODR with respect to the typical.
* @ts_sensitivity: Nominal timestamp sensitivity.
* @ts_trim_coeff: Coefficient for calculating the calibrated timestamp gain.
* This coefficient comes into play when linearizing the formula
* used to calculate the calibrated timestamp (please see the
* relevant formula in the AN for the specific IMU).
* For example, in the case of LSM6DSO we have:
*
* 1 / (1 + x) ~= 1 - x (Taylor’s Series)
* ttrim[s] = 1 / (40000 * (1 + 0.0015 * val)) (from AN5192)
* ttrim[ns] ~= 25000 - 37.5 * val
* ttrim[ns] ~= 25000 - (37500 * val) / 1000
*
* so, replacing ts_sensitivity = 25000 and
* ts_trim_coeff = 37500
*
* ttrim[ns] ~= ts_sensitivity - (ts_trim_coeff * val) / 1000
*/
struct st_lsm6dsx_hw_ts_settings {
Annotation
- Immediate include surface: `linux/device.h`, `linux/iio/iio.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct st_lsm6dsx_reg`, `struct st_lsm6dsx_sensor`, `struct st_lsm6dsx_hw`, `struct st_lsm6dsx_odr`, `struct st_lsm6dsx_odr_table_entry`, `struct st_lsm6dsx_samples_to_discard`, `struct st_lsm6dsx_fs`, `struct st_lsm6dsx_fs_table_entry`, `struct st_lsm6dsx_fifo_ops`, `struct st_lsm6dsx_hw_ts_settings`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.