drivers/iio/imu/inv_icm42600/inv_icm42600.h
Source file repositories/reference/linux-study-clean/drivers/iio/imu/inv_icm42600/inv_icm42600.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/imu/inv_icm42600/inv_icm42600.h- Extension
.h- Size
- 17056 bytes
- Lines
- 488
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/bitfield.hlinux/regmap.hlinux/mutex.hlinux/regulator/consumer.hlinux/pm.hlinux/iio/iio.hlinux/iio/common/inv_sensors_timestamp.hinv_icm42600_buffer.h
Detected Declarations
struct inv_icm42600_sensor_confstruct inv_icm42600_confstruct inv_icm42600_suspendedstruct inv_icm42600_apexstruct inv_icm42600_statestruct inv_icm42600_sensor_stateenum inv_icm42600_chipenum inv_icm42600_slew_rateenum inv_icm42600_sensor_modeenum inv_icm42600_gyro_fsenum inv_icm42686_gyro_fsenum inv_icm42600_accel_fsenum inv_icm42686_accel_fsenum inv_icm42600_odrenum inv_icm42600_filter
Annotated Snippet
struct inv_icm42600_sensor_conf {
int mode;
int fs;
int odr;
int filter;
};
#define INV_ICM42600_SENSOR_CONF_INIT {-1, -1, -1, -1}
struct inv_icm42600_conf {
struct inv_icm42600_sensor_conf gyro;
struct inv_icm42600_sensor_conf accel;
bool temp_en;
};
struct inv_icm42600_suspended {
enum inv_icm42600_sensor_mode gyro;
enum inv_icm42600_sensor_mode accel;
bool temp;
};
struct inv_icm42600_apex {
unsigned int on;
struct {
u64 value;
bool enable;
} wom;
};
/**
* struct inv_icm42600_state - driver state variables
* @lock: lock for serializing multiple registers access.
* @chip: chip identifier.
* @name: chip name.
* @map: regmap pointer.
* @vdd_supply: VDD voltage regulator for the chip.
* @vddio_supply: I/O voltage regulator for the chip.
* @irq: chip irq, required to enable/disable and set wakeup
* @orientation: sensor chip orientation relative to main hardware.
* @conf: chip sensors configurations.
* @suspended: suspended sensors configuration.
* @indio_gyro: gyroscope IIO device.
* @indio_accel: accelerometer IIO device.
* @timestamp: interrupt timestamps.
* @apex: APEX (Advanced Pedometer and Event detection) management
* @fifo: FIFO management structure.
* @buffer: data transfer buffer aligned for DMA.
*/
struct inv_icm42600_state {
struct mutex lock;
enum inv_icm42600_chip chip;
const char *name;
struct regmap *map;
struct regulator *vddio_supply;
int irq;
struct iio_mount_matrix orientation;
struct inv_icm42600_conf conf;
struct inv_icm42600_suspended suspended;
struct iio_dev *indio_gyro;
struct iio_dev *indio_accel;
struct {
s64 gyro;
s64 accel;
} timestamp;
struct inv_icm42600_apex apex;
struct inv_icm42600_fifo fifo;
u8 buffer[3] __aligned(IIO_DMA_MINALIGN);
};
/**
* struct inv_icm42600_sensor_state - sensor state variables
* @scales: table of scales.
* @scales_len: length (nb of items) of the scales table.
* @power_mode: sensor requested power mode (for common frequencies)
* @filter: sensor filter.
* @ts: timestamp module states.
*/
struct inv_icm42600_sensor_state {
const int *scales;
size_t scales_len;
enum inv_icm42600_sensor_mode power_mode;
enum inv_icm42600_filter filter;
struct inv_sensors_timestamp ts;
};
/* Virtual register addresses: @bank on MSB (4 upper bits), @address on LSB */
/* Bank selection register, available in all banks */
#define INV_ICM42600_REG_BANK_SEL 0x76
#define INV_ICM42600_BANK_SEL_MASK GENMASK(2, 0)
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitfield.h`, `linux/regmap.h`, `linux/mutex.h`, `linux/regulator/consumer.h`, `linux/pm.h`, `linux/iio/iio.h`, `linux/iio/common/inv_sensors_timestamp.h`.
- Detected declarations: `struct inv_icm42600_sensor_conf`, `struct inv_icm42600_conf`, `struct inv_icm42600_suspended`, `struct inv_icm42600_apex`, `struct inv_icm42600_state`, `struct inv_icm42600_sensor_state`, `enum inv_icm42600_chip`, `enum inv_icm42600_slew_rate`, `enum inv_icm42600_sensor_mode`, `enum inv_icm42600_gyro_fs`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: source implementation candidate.
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.