drivers/iio/proximity/isl29501.c
Source file repositories/reference/linux-study-clean/drivers/iio/proximity/isl29501.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/proximity/isl29501.c- Extension
.c- Size
- 23880 bytes
- Lines
- 1023
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/i2c.hlinux/err.hlinux/mod_devicetable.hlinux/iio/iio.hlinux/iio/sysfs.hlinux/iio/trigger_consumer.hlinux/iio/buffer.hlinux/iio/triggered_buffer.h
Detected Declarations
struct isl29501_privatestruct isl29501_register_descenum isl29501_correction_coeffenum isl29501_register_namefunction isl29501_register_readfunction isl29501_register_writefunction isl29501_read_extfunction isl29501_set_shadow_coefffunction isl29501_write_coefffunction isl29501_find_corr_expfunction isl29501_write_extfunction isl29501_reset_registersfunction isl29501_begin_acquisitionfunction isl29501_get_rawfunction isl29501_get_scalefunction isl29501_get_calibbiasfunction isl29501_get_inttimefunction isl29501_get_freqfunction isl29501_read_rawfunction isl29501_set_rawfunction isl29501_set_inttimefunction isl29501_set_scalefunction isl29501_set_calibbiasfunction isl29501_set_freqfunction isl29501_write_rawfunction isl29501_init_chipfunction isl29501_trigger_handlerfunction isl29501_probe
Annotated Snippet
struct isl29501_private {
struct i2c_client *client;
struct mutex lock;
/* Exact representation of correction coefficients. */
unsigned int shadow_coeffs[COEFF_MAX];
};
enum isl29501_register_name {
REG_DISTANCE,
REG_PHASE,
REG_TEMPERATURE,
REG_AMBIENT_LIGHT,
REG_GAIN,
REG_GAIN_BIAS,
REG_PHASE_EXP,
REG_CALIB_PHASE_TEMP_A,
REG_CALIB_PHASE_TEMP_B,
REG_CALIB_PHASE_LIGHT_A,
REG_CALIB_PHASE_LIGHT_B,
REG_DISTANCE_BIAS,
REG_TEMPERATURE_BIAS,
REG_INT_TIME,
REG_SAMPLE_TIME,
REG_DRIVER_RANGE,
REG_EMITTER_DAC,
};
struct isl29501_register_desc {
u8 msb;
u8 lsb;
};
static const struct isl29501_register_desc isl29501_registers[] = {
[REG_DISTANCE] = {
.msb = ISL29501_DISTANCE_MSB_DATA,
.lsb = ISL29501_DISTANCE_LSB_DATA,
},
[REG_PHASE] = {
.msb = ISL29501_PHASE_MSB,
.lsb = ISL29501_PHASE_LSB,
},
[REG_TEMPERATURE] = {
.lsb = ISL29501_DIE_TEMPERATURE,
},
[REG_AMBIENT_LIGHT] = {
.lsb = ISL29501_AMBIENT_LIGHT,
},
[REG_GAIN] = {
.msb = ISL29501_GAIN_MSB,
.lsb = ISL29501_GAIN_LSB,
},
[REG_GAIN_BIAS] = {
.msb = ISL29501_CROSSTALK_GAIN_MSB,
.lsb = ISL29501_CROSSTALK_GAIN_LSB,
},
[REG_PHASE_EXP] = {
.lsb = ISL29501_PHASE_EXPONENT,
},
[REG_CALIB_PHASE_TEMP_A] = {
.lsb = ISL29501_TEMP_COEFF_A,
},
[REG_CALIB_PHASE_TEMP_B] = {
.lsb = ISL29501_TEMP_COEFF_B,
},
[REG_CALIB_PHASE_LIGHT_A] = {
.lsb = ISL29501_AMBIANT_COEFF_A,
},
[REG_CALIB_PHASE_LIGHT_B] = {
.lsb = ISL29501_AMBIANT_COEFF_B,
},
[REG_DISTANCE_BIAS] = {
.msb = ISL29501_PHASE_OFFSET_MSB,
.lsb = ISL29501_PHASE_OFFSET_LSB,
},
[REG_TEMPERATURE_BIAS] = {
.lsb = ISL29501_TEMP_REFERENCE,
},
[REG_INT_TIME] = {
.lsb = ISL29501_INTEGRATION_PERIOD,
},
[REG_SAMPLE_TIME] = {
.lsb = ISL29501_SAMPLE_PERIOD,
},
[REG_DRIVER_RANGE] = {
.lsb = ISL29501_DRIVER_RANGE,
},
[REG_EMITTER_DAC] = {
.lsb = ISL29501_EMITTER_DAC,
},
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/i2c.h`, `linux/err.h`, `linux/mod_devicetable.h`, `linux/iio/iio.h`, `linux/iio/sysfs.h`, `linux/iio/trigger_consumer.h`.
- Detected declarations: `struct isl29501_private`, `struct isl29501_register_desc`, `enum isl29501_correction_coeff`, `enum isl29501_register_name`, `function isl29501_register_read`, `function isl29501_register_write`, `function isl29501_read_ext`, `function isl29501_set_shadow_coeff`, `function isl29501_write_coeff`, `function isl29501_find_corr_exp`.
- 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.
- 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.