drivers/iio/pressure/mprls0025pa.c
Source file repositories/reference/linux-study-clean/drivers/iio/pressure/mprls0025pa.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/pressure/mprls0025pa.c- Extension
.c- Size
- 13499 bytes
- Lines
- 445
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/array_size.hlinux/bitfield.hlinux/bits.hlinux/completion.hlinux/delay.hlinux/errno.hlinux/export.hlinux/interrupt.hlinux/jiffies.hlinux/math64.hlinux/mod_devicetable.hlinux/module.hlinux/property.hlinux/string.hlinux/time.hlinux/units.hlinux/gpio/consumer.hlinux/iio/buffer.hlinux/iio/iio.hlinux/iio/trigger_consumer.hlinux/iio/triggered_buffer.hlinux/regulator/consumer.hlinux/unaligned.hmprls0025pa.h
Detected Declarations
struct mpr_func_specstruct mpr_range_configenum mpr_variantsfunction mpr_resetfunction mpr_read_pressurefunction mpr_eoc_handlerfunction mpr_trigger_handlerfunction mpr_read_rawfunction mpr_common_probe
Annotated Snippet
struct mpr_func_spec {
u32 output_min;
u32 output_max;
};
static const struct mpr_func_spec mpr_func_spec[] = {
[MPR_FUNCTION_A] = { .output_min = 1677722, .output_max = 15099494 },
[MPR_FUNCTION_B] = { .output_min = 419430, .output_max = 3774874 },
[MPR_FUNCTION_C] = { .output_min = 3355443, .output_max = 13421773 },
};
enum mpr_variants {
MPR0001BA = 0x00, MPR01_6BA = 0x01, MPR02_5BA = 0x02, MPR0060MG = 0x03,
MPR0100MG = 0x04, MPR0160MG = 0x05, MPR0250MG = 0x06, MPR0400MG = 0x07,
MPR0600MG = 0x08, MPR0001BG = 0x09, MPR01_6BG = 0x0a, MPR02_5BG = 0x0b,
MPR0100KA = 0x0c, MPR0160KA = 0x0d, MPR0250KA = 0x0e, MPR0006KG = 0x0f,
MPR0010KG = 0x10, MPR0016KG = 0x11, MPR0025KG = 0x12, MPR0040KG = 0x13,
MPR0060KG = 0x14, MPR0100KG = 0x15, MPR0160KG = 0x16, MPR0250KG = 0x17,
MPR0015PA = 0x18, MPR0025PA = 0x19, MPR0030PA = 0x1a, MPR0001PG = 0x1b,
MPR0005PG = 0x1c, MPR0015PG = 0x1d, MPR0030PG = 0x1e, MPR0300YG = 0x1f,
MPR_VARIANTS_MAX
};
static const char * const mpr_triplet_variants[MPR_VARIANTS_MAX] = {
[MPR0001BA] = "0001BA", [MPR01_6BA] = "01.6BA", [MPR02_5BA] = "02.5BA",
[MPR0060MG] = "0060MG", [MPR0100MG] = "0100MG", [MPR0160MG] = "0160MG",
[MPR0250MG] = "0250MG", [MPR0400MG] = "0400MG", [MPR0600MG] = "0600MG",
[MPR0001BG] = "0001BG", [MPR01_6BG] = "01.6BG", [MPR02_5BG] = "02.5BG",
[MPR0100KA] = "0100KA", [MPR0160KA] = "0160KA", [MPR0250KA] = "0250KA",
[MPR0006KG] = "0006KG", [MPR0010KG] = "0010KG", [MPR0016KG] = "0016KG",
[MPR0025KG] = "0025KG", [MPR0040KG] = "0040KG", [MPR0060KG] = "0060KG",
[MPR0100KG] = "0100KG", [MPR0160KG] = "0160KG", [MPR0250KG] = "0250KG",
[MPR0015PA] = "0015PA", [MPR0025PA] = "0025PA", [MPR0030PA] = "0030PA",
[MPR0001PG] = "0001PG", [MPR0005PG] = "0005PG", [MPR0015PG] = "0015PG",
[MPR0030PG] = "0030PG", [MPR0300YG] = "0300YG"
};
/**
* struct mpr_range_config - list of pressure ranges based on nomenclature
* @pmin: lowest pressure that can be measured
* @pmax: highest pressure that can be measured
*/
struct mpr_range_config {
const s32 pmin;
const s32 pmax;
};
/* All min max limits have been converted to pascals */
static const struct mpr_range_config mpr_range_config[MPR_VARIANTS_MAX] = {
[MPR0001BA] = { .pmin = 0, .pmax = 100000 },
[MPR01_6BA] = { .pmin = 0, .pmax = 160000 },
[MPR02_5BA] = { .pmin = 0, .pmax = 250000 },
[MPR0060MG] = { .pmin = 0, .pmax = 6000 },
[MPR0100MG] = { .pmin = 0, .pmax = 10000 },
[MPR0160MG] = { .pmin = 0, .pmax = 16000 },
[MPR0250MG] = { .pmin = 0, .pmax = 25000 },
[MPR0400MG] = { .pmin = 0, .pmax = 40000 },
[MPR0600MG] = { .pmin = 0, .pmax = 60000 },
[MPR0001BG] = { .pmin = 0, .pmax = 100000 },
[MPR01_6BG] = { .pmin = 0, .pmax = 160000 },
[MPR02_5BG] = { .pmin = 0, .pmax = 250000 },
[MPR0100KA] = { .pmin = 0, .pmax = 100000 },
[MPR0160KA] = { .pmin = 0, .pmax = 160000 },
[MPR0250KA] = { .pmin = 0, .pmax = 250000 },
[MPR0006KG] = { .pmin = 0, .pmax = 6000 },
[MPR0010KG] = { .pmin = 0, .pmax = 10000 },
[MPR0016KG] = { .pmin = 0, .pmax = 16000 },
[MPR0025KG] = { .pmin = 0, .pmax = 25000 },
[MPR0040KG] = { .pmin = 0, .pmax = 40000 },
[MPR0060KG] = { .pmin = 0, .pmax = 60000 },
[MPR0100KG] = { .pmin = 0, .pmax = 100000 },
[MPR0160KG] = { .pmin = 0, .pmax = 160000 },
[MPR0250KG] = { .pmin = 0, .pmax = 250000 },
[MPR0015PA] = { .pmin = 0, .pmax = 103421 },
[MPR0025PA] = { .pmin = 0, .pmax = 172369 },
[MPR0030PA] = { .pmin = 0, .pmax = 206843 },
[MPR0001PG] = { .pmin = 0, .pmax = 6895 },
[MPR0005PG] = { .pmin = 0, .pmax = 34474 },
[MPR0015PG] = { .pmin = 0, .pmax = 103421 },
[MPR0030PG] = { .pmin = 0, .pmax = 206843 },
[MPR0300YG] = { .pmin = 0, .pmax = 39997 }
};
static const struct iio_chan_spec mpr_channels[] = {
{
.type = IIO_PRESSURE,
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_SCALE) |
BIT(IIO_CHAN_INFO_OFFSET),
.scan_index = 0,
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/bitfield.h`, `linux/bits.h`, `linux/completion.h`, `linux/delay.h`, `linux/errno.h`, `linux/export.h`, `linux/interrupt.h`.
- Detected declarations: `struct mpr_func_spec`, `struct mpr_range_config`, `enum mpr_variants`, `function mpr_reset`, `function mpr_read_pressure`, `function mpr_eoc_handler`, `function mpr_trigger_handler`, `function mpr_read_raw`, `function mpr_common_probe`.
- 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.