drivers/iio/temperature/mlx90635.c
Source file repositories/reference/linux-study-clean/drivers/iio/temperature/mlx90635.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/temperature/mlx90635.c- Extension
.c- Size
- 30465 bytes
- Lines
- 1095
- 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/bitfield.hlinux/delay.hlinux/device.hlinux/err.hlinux/gpio/consumer.hlinux/i2c.hlinux/iopoll.hlinux/jiffies.hlinux/kernel.hlinux/limits.hlinux/mod_devicetable.hlinux/module.hlinux/math64.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hlinux/iio/iio.h
Detected Declarations
struct mlx90635_datafunction mlx90635_reset_delayfunction mlx90635_pwr_sleep_stepfunction mlx90635_pwr_continuousfunction mlx90635_read_ee_registerfunction mlx90635_read_ee_ambientfunction mlx90635_read_ee_objectfunction mlx90635_calculate_dataset_ready_timefunction mlx90635_perform_measurement_burstfunction mlx90635_read_ambient_rawfunction mlx90635_read_object_rawfunction mlx90635_read_all_channelfunction mlx90635_preprocess_temp_ambfunction mlx90635_preprocess_temp_objfunction mlx90635_calc_temp_ambientfunction mlx90635_calc_temp_object_iterationfunction mlx90635_calc_ta4function mlx90635_calc_temp_objectfunction mlx90635_calc_objectfunction mlx90635_calc_ambientfunction mlx90635_get_refresh_ratefunction mlx90635_pm_interaction_wakeupfunction msecs_to_jiffiesfunction mlx90635_read_rawfunction mlx90635_write_rawfunction mlx90635_read_availfunction mlx90635_sleepfunction mlx90635_suspendfunction mlx90635_wakeupfunction mlx90635_disable_regulatorfunction mlx90635_enable_regulatorfunction mlx90635_probefunction mlx90635_pm_suspendfunction mlx90635_pm_resumefunction mlx90635_pm_runtime_suspend
Annotated Snippet
struct mlx90635_data {
struct i2c_client *client;
struct mutex lock;
struct regmap *regmap;
struct regmap *regmap_ee;
u16 emissivity;
struct regulator *regulator;
int powerstatus;
unsigned long interaction_ts;
};
static const struct regmap_range mlx90635_volatile_reg_range[] = {
regmap_reg_range(MLX90635_REG_STATUS, MLX90635_REG_STATUS),
regmap_reg_range(MLX90635_RESULT_1, MLX90635_RESULT_5),
regmap_reg_range(MLX90635_REG_EE, MLX90635_REG_EE),
regmap_reg_range(MLX90635_REG_CMD, MLX90635_REG_CMD),
regmap_reg_range(MLX90635_REG_CTRL1, MLX90635_REG_CTRL2),
};
static const struct regmap_access_table mlx90635_volatile_regs_tbl = {
.yes_ranges = mlx90635_volatile_reg_range,
.n_yes_ranges = ARRAY_SIZE(mlx90635_volatile_reg_range),
};
static const struct regmap_range mlx90635_read_reg_range[] = {
regmap_reg_range(MLX90635_REG_STATUS, MLX90635_REG_STATUS),
regmap_reg_range(MLX90635_RESULT_1, MLX90635_RESULT_5),
regmap_reg_range(MLX90635_REG_EE, MLX90635_REG_EE),
regmap_reg_range(MLX90635_REG_CMD, MLX90635_REG_CMD),
regmap_reg_range(MLX90635_REG_CTRL1, MLX90635_REG_CTRL2),
};
static const struct regmap_access_table mlx90635_readable_regs_tbl = {
.yes_ranges = mlx90635_read_reg_range,
.n_yes_ranges = ARRAY_SIZE(mlx90635_read_reg_range),
};
static const struct regmap_range mlx90635_no_write_reg_range[] = {
regmap_reg_range(MLX90635_RESULT_1, MLX90635_RESULT_5),
};
static const struct regmap_access_table mlx90635_writeable_regs_tbl = {
.no_ranges = mlx90635_no_write_reg_range,
.n_no_ranges = ARRAY_SIZE(mlx90635_no_write_reg_range),
};
static const struct regmap_config mlx90635_regmap = {
.name = "mlx90635-registers",
.reg_stride = 1,
.reg_bits = 16,
.val_bits = 16,
.volatile_table = &mlx90635_volatile_regs_tbl,
.rd_table = &mlx90635_readable_regs_tbl,
.wr_table = &mlx90635_writeable_regs_tbl,
.use_single_read = true,
.use_single_write = true,
.can_multi_write = false,
.reg_format_endian = REGMAP_ENDIAN_BIG,
.val_format_endian = REGMAP_ENDIAN_BIG,
.cache_type = REGCACHE_RBTREE,
};
static const struct regmap_range mlx90635_read_ee_range[] = {
regmap_reg_range(MLX90635_EE_I2C_CFG, MLX90635_EE_CTRL2),
regmap_reg_range(MLX90635_EE_Ha, MLX90635_EE_Gb),
};
static const struct regmap_access_table mlx90635_readable_ees_tbl = {
.yes_ranges = mlx90635_read_ee_range,
.n_yes_ranges = ARRAY_SIZE(mlx90635_read_ee_range),
};
static const struct regmap_range mlx90635_no_write_ee_range[] = {
regmap_reg_range(MLX90635_ADDR_EEPROM, MLX90635_EE_Gb),
};
static const struct regmap_access_table mlx90635_writeable_ees_tbl = {
.no_ranges = mlx90635_no_write_ee_range,
.n_no_ranges = ARRAY_SIZE(mlx90635_no_write_ee_range),
};
static const struct regmap_config mlx90635_regmap_ee = {
.name = "mlx90635-eeprom",
.reg_stride = 1,
.reg_bits = 16,
.val_bits = 16,
.volatile_table = NULL,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/delay.h`, `linux/device.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/iopoll.h`, `linux/jiffies.h`.
- Detected declarations: `struct mlx90635_data`, `function mlx90635_reset_delay`, `function mlx90635_pwr_sleep_step`, `function mlx90635_pwr_continuous`, `function mlx90635_read_ee_register`, `function mlx90635_read_ee_ambient`, `function mlx90635_read_ee_object`, `function mlx90635_calculate_dataset_ready_time`, `function mlx90635_perform_measurement_burst`, `function mlx90635_read_ambient_raw`.
- 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.