drivers/iio/industrialio-core.c
Source file repositories/reference/linux-study-clean/drivers/iio/industrialio-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/industrialio-core.c- Extension
.c- Size
- 59483 bytes
- Lines
- 2224
- Domain
- Driver Families
- Bucket
- drivers/iio
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/anon_inodes.hlinux/cdev.hlinux/cleanup.hlinux/debugfs.hlinux/device.hlinux/err.hlinux/fs.hlinux/idr.hlinux/kdev_t.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/poll.hlinux/property.hlinux/sched.hlinux/slab.hlinux/wait.hlinux/wordpart.hlinux/iio/buffer.hlinux/iio/buffer_impl.hlinux/iio/events.hlinux/iio/iio-opaque.hlinux/iio/iio.hlinux/iio/sysfs.hiio_core.hiio_core_trigger.h
Detected Declarations
function iio_device_idfunction iio_buffer_enabledfunction iio_get_debugfs_dentryfunction iio_find_channel_from_sifunction iio_read_const_attrfunction iio_device_set_clockfunction iio_buffer_enabledfunction iio_device_get_clockfunction iio_get_time_nsfunction iio_initfunction iio_exitfunction iio_debugfs_read_regfunction iio_debugfs_write_regfunction iio_device_unregister_debugfsfunction iio_device_register_debugfsfunction iio_device_register_debugfsfunction iio_write_channel_ext_infofunction iio_enum_available_readfunction iio_enum_readfunction iio_enum_writefunction iio_setup_mount_idmatrixfunction iio_show_mount_matrixfunction iio_read_mount_matrixfunction __iio_format_valuefunction iio_format_valuefunction do_iio_read_channel_labelfunction iio_read_channel_labelfunction iio_read_channel_infofunction iio_format_listfunction iio_format_avail_listfunction iio_format_avail_rangefunction iio_read_channel_info_availfunction __iio_str_to_fixpointfunction iio_str_to_fixpointfunction iio_write_channel_infofunction __iio_device_attr_initfunction __iio_device_attr_deinitfunction __iio_add_chan_devattrfunction iio_device_add_channel_labelfunction iio_device_add_info_mask_typefunction for_each_set_bitfunction iio_device_add_info_mask_type_availfunction for_each_set_bitfunction iio_device_add_channel_sysfsfunction iio_free_chan_devattr_listfunction list_for_each_entry_safefunction name_showfunction label_show
Annotated Snippet
const struct bus_type iio_bus_type = {
.name = "iio",
};
EXPORT_SYMBOL(iio_bus_type);
static struct dentry *iio_debugfs_dentry;
static const char * const iio_direction[] = {
[0] = "in",
[1] = "out",
};
static const char * const iio_chan_type_name_spec[] = {
[IIO_VOLTAGE] = "voltage",
[IIO_CURRENT] = "current",
[IIO_POWER] = "power",
[IIO_ACCEL] = "accel",
[IIO_ANGL_VEL] = "anglvel",
[IIO_MAGN] = "magn",
[IIO_LIGHT] = "illuminance",
[IIO_INTENSITY] = "intensity",
[IIO_PROXIMITY] = "proximity",
[IIO_TEMP] = "temp",
[IIO_INCLI] = "incli",
[IIO_ROT] = "rot",
[IIO_ANGL] = "angl",
[IIO_TIMESTAMP] = "timestamp",
[IIO_CAPACITANCE] = "capacitance",
[IIO_ALTVOLTAGE] = "altvoltage",
[IIO_CCT] = "cct",
[IIO_PRESSURE] = "pressure",
[IIO_HUMIDITYRELATIVE] = "humidityrelative",
[IIO_ACTIVITY] = "activity",
[IIO_STEPS] = "steps",
[IIO_ENERGY] = "energy",
[IIO_DISTANCE] = "distance",
[IIO_VELOCITY] = "velocity",
[IIO_CONCENTRATION] = "concentration",
[IIO_RESISTANCE] = "resistance",
[IIO_PH] = "ph",
[IIO_UVINDEX] = "uvindex",
[IIO_ELECTRICALCONDUCTIVITY] = "electricalconductivity",
[IIO_COUNT] = "count",
[IIO_INDEX] = "index",
[IIO_GRAVITY] = "gravity",
[IIO_POSITIONRELATIVE] = "positionrelative",
[IIO_PHASE] = "phase",
[IIO_MASSCONCENTRATION] = "massconcentration",
[IIO_DELTA_ANGL] = "deltaangl",
[IIO_DELTA_VELOCITY] = "deltavelocity",
[IIO_COLORTEMP] = "colortemp",
[IIO_CHROMATICITY] = "chromaticity",
[IIO_ATTENTION] = "attention",
[IIO_ALTCURRENT] = "altcurrent",
};
static const char * const iio_modifier_names[] = {
[IIO_MOD_X] = "x",
[IIO_MOD_Y] = "y",
[IIO_MOD_Z] = "z",
[IIO_MOD_X_AND_Y] = "x&y",
[IIO_MOD_X_AND_Z] = "x&z",
[IIO_MOD_Y_AND_Z] = "y&z",
[IIO_MOD_X_AND_Y_AND_Z] = "x&y&z",
[IIO_MOD_X_OR_Y] = "x|y",
[IIO_MOD_X_OR_Z] = "x|z",
[IIO_MOD_Y_OR_Z] = "y|z",
[IIO_MOD_X_OR_Y_OR_Z] = "x|y|z",
[IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)",
[IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2",
[IIO_MOD_LIGHT_BOTH] = "both",
[IIO_MOD_LIGHT_IR] = "ir",
[IIO_MOD_LIGHT_CLEAR] = "clear",
[IIO_MOD_LIGHT_RED] = "red",
[IIO_MOD_LIGHT_GREEN] = "green",
[IIO_MOD_LIGHT_BLUE] = "blue",
[IIO_MOD_LIGHT_UV] = "uv",
[IIO_MOD_LIGHT_UVA] = "uva",
[IIO_MOD_LIGHT_UVB] = "uvb",
[IIO_MOD_LIGHT_DUV] = "duv",
[IIO_MOD_QUATERNION] = "quaternion",
[IIO_MOD_TEMP_AMBIENT] = "ambient",
[IIO_MOD_TEMP_OBJECT] = "object",
[IIO_MOD_NORTH_MAGN] = "from_north_magnetic",
[IIO_MOD_NORTH_TRUE] = "from_north_true",
[IIO_MOD_NORTH_MAGN_TILT_COMP] = "from_north_magnetic_tilt_comp",
[IIO_MOD_NORTH_TRUE_TILT_COMP] = "from_north_true_tilt_comp",
[IIO_MOD_RUNNING] = "running",
[IIO_MOD_JOGGING] = "jogging",
[IIO_MOD_WALKING] = "walking",
Annotation
- Immediate include surface: `linux/anon_inodes.h`, `linux/cdev.h`, `linux/cleanup.h`, `linux/debugfs.h`, `linux/device.h`, `linux/err.h`, `linux/fs.h`, `linux/idr.h`.
- Detected declarations: `function iio_device_id`, `function iio_buffer_enabled`, `function iio_get_debugfs_dentry`, `function iio_find_channel_from_si`, `function iio_read_const_attr`, `function iio_device_set_clock`, `function iio_buffer_enabled`, `function iio_device_get_clock`, `function iio_get_time_ns`, `function iio_init`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: pattern 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.