drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
Source file repositories/reference/linux-study-clean/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c- Extension
.c- Size
- 25977 bytes
- Lines
- 962
- Domain
- Driver Families
- Bucket
- drivers/iio
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/device.hlinux/module.hlinux/slab.hlinux/delay.hlinux/mutex.hlinux/interrupt.hlinux/irq.hlinux/regulator/consumer.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hlinux/iio/iio.hinv_icm42600.hinv_icm42600_buffer.h
Detected Declarations
struct inv_icm42600_hwfunction inv_icm42600_get_mount_matrixfunction inv_icm42600_odr_to_periodfunction inv_icm42600_set_pwr_mgmt0function inv_icm42600_set_accel_conffunction inv_icm42600_set_gyro_conffunction inv_icm42600_set_temp_conffunction inv_icm42600_enable_womfunction inv_icm42600_disable_womfunction inv_icm42600_debugfs_regfunction inv_icm42600_set_conffunction inv_icm42600_setupfunction inv_icm42600_irq_timestampfunction inv_icm42600_irq_handlerfunction inv_icm42600_irq_initfunction inv_icm42600_timestamp_setupfunction inv_icm42600_enable_regulator_vddiofunction inv_icm42600_disable_vddio_regfunction inv_icm42600_core_probefunction inv_icm42600_suspendfunction inv_icm42600_resumefunction inv_icm42600_runtime_suspendfunction inv_icm42600_runtime_resume
Annotated Snippet
struct inv_icm42600_hw {
u8 whoami;
const char *name;
const struct inv_icm42600_conf *conf;
};
/* chip initial default configuration */
static const struct inv_icm42600_conf inv_icm42600_default_conf = {
.gyro = {
.mode = INV_ICM42600_SENSOR_MODE_OFF,
.fs = INV_ICM42600_GYRO_FS_2000DPS,
.odr = INV_ICM42600_ODR_50HZ,
.filter = INV_ICM42600_FILTER_BW_ODR_DIV_2,
},
.accel = {
.mode = INV_ICM42600_SENSOR_MODE_OFF,
.fs = INV_ICM42600_ACCEL_FS_16G,
.odr = INV_ICM42600_ODR_50HZ,
.filter = INV_ICM42600_FILTER_BW_ODR_DIV_2,
},
.temp_en = false,
};
static const struct inv_icm42600_conf inv_icm42686_default_conf = {
.gyro = {
.mode = INV_ICM42600_SENSOR_MODE_OFF,
.fs = INV_ICM42686_GYRO_FS_4000DPS,
.odr = INV_ICM42600_ODR_50HZ,
.filter = INV_ICM42600_FILTER_BW_ODR_DIV_2,
},
.accel = {
.mode = INV_ICM42600_SENSOR_MODE_OFF,
.fs = INV_ICM42686_ACCEL_FS_32G,
.odr = INV_ICM42600_ODR_50HZ,
.filter = INV_ICM42600_FILTER_BW_ODR_DIV_2,
},
.temp_en = false,
};
static const struct inv_icm42600_hw inv_icm42600_hw[INV_CHIP_NB] = {
[INV_CHIP_ICM42600] = {
.whoami = INV_ICM42600_WHOAMI_ICM42600,
.name = "icm42600",
.conf = &inv_icm42600_default_conf,
},
[INV_CHIP_ICM42602] = {
.whoami = INV_ICM42600_WHOAMI_ICM42602,
.name = "icm42602",
.conf = &inv_icm42600_default_conf,
},
[INV_CHIP_ICM42605] = {
.whoami = INV_ICM42600_WHOAMI_ICM42605,
.name = "icm42605",
.conf = &inv_icm42600_default_conf,
},
[INV_CHIP_ICM42686] = {
.whoami = INV_ICM42600_WHOAMI_ICM42686,
.name = "icm42686",
.conf = &inv_icm42686_default_conf,
},
[INV_CHIP_ICM42622] = {
.whoami = INV_ICM42600_WHOAMI_ICM42622,
.name = "icm42622",
.conf = &inv_icm42600_default_conf,
},
[INV_CHIP_ICM42688] = {
.whoami = INV_ICM42600_WHOAMI_ICM42688,
.name = "icm42688",
.conf = &inv_icm42600_default_conf,
},
[INV_CHIP_ICM42631] = {
.whoami = INV_ICM42600_WHOAMI_ICM42631,
.name = "icm42631",
.conf = &inv_icm42600_default_conf,
},
};
const struct iio_mount_matrix *
inv_icm42600_get_mount_matrix(const struct iio_dev *indio_dev,
const struct iio_chan_spec *chan)
{
const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
return &st->orientation;
}
u32 inv_icm42600_odr_to_period(enum inv_icm42600_odr odr)
{
static u32 odr_periods[INV_ICM42600_ODR_NB] = {
/* reserved values */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/device.h`, `linux/module.h`, `linux/slab.h`, `linux/delay.h`, `linux/mutex.h`, `linux/interrupt.h`, `linux/irq.h`.
- Detected declarations: `struct inv_icm42600_hw`, `function inv_icm42600_get_mount_matrix`, `function inv_icm42600_odr_to_period`, `function inv_icm42600_set_pwr_mgmt0`, `function inv_icm42600_set_accel_conf`, `function inv_icm42600_set_gyro_conf`, `function inv_icm42600_set_temp_conf`, `function inv_icm42600_enable_wom`, `function inv_icm42600_disable_wom`, `function inv_icm42600_debugfs_reg`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.