drivers/iio/adc/ad4000.c
Source file repositories/reference/linux-study-clean/drivers/iio/adc/ad4000.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/adc/ad4000.c- Extension
.c- Size
- 39976 bytes
- Lines
- 1265
- 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.
- 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/bits.hlinux/bitfield.hlinux/byteorder/generic.hlinux/cleanup.hlinux/device.hlinux/err.hlinux/math.hlinux/module.hlinux/mod_devicetable.hlinux/gpio/consumer.hlinux/regulator/consumer.hlinux/spi/offload/consumer.hlinux/spi/spi.hlinux/units.hlinux/util_macros.hlinux/iio/iio.hlinux/iio/buffer.hlinux/iio/buffer-dmaengine.hlinux/iio/triggered_buffer.hlinux/iio/trigger_consumer.h
Detected Declarations
struct ad4000_time_specstruct ad4000_chip_infostruct ad4000_stateenum ad4000_sdifunction ad4000_fill_scale_tblfunction ad4000_write_regfunction ad4000_read_regfunction ad4000_set_sampling_freqfunction ad4000_convert_and_acquirefunction ad4000_single_conversionfunction ad4000_read_rawfunction ad4000_read_availfunction ad4000_write_raw_get_fmtfunction __ad4000_write_rawfunction ad4000_write_rawfunction ad4000_trigger_handlerfunction ad4000_offload_buffer_postenablefunction ad4000_offload_buffer_predisablefunction ad4000_spi_offload_setupfunction CSfunction linefunction ad4000_prepare_4wire_mode_messagefunction ad4000_configfunction ad4000_probe
Annotated Snippet
struct ad4000_time_spec {
int t_conv_ns;
int t_quiet2_ns;
};
/*
* Same timing specifications for all of AD4000, AD4001, ..., AD4008, AD4010,
* ADAQ4001, and ADAQ4003.
*/
static const struct ad4000_time_spec ad4000_t_spec = {
.t_conv_ns = 320,
.t_quiet2_ns = 60,
};
/* AD4020, AD4021, AD4022 */
static const struct ad4000_time_spec ad4020_t_spec = {
.t_conv_ns = 350,
.t_quiet2_ns = 60,
};
/* AD7983, AD7984 */
static const struct ad4000_time_spec ad7983_t_spec = {
.t_conv_ns = 500,
.t_quiet2_ns = 0,
};
/* AD7980, AD7982 */
static const struct ad4000_time_spec ad7980_t_spec = {
.t_conv_ns = 800,
.t_quiet2_ns = 0,
};
/* AD7946, AD7686, AD7688, AD7988-5, AD7693 */
static const struct ad4000_time_spec ad7686_t_spec = {
.t_conv_ns = 1600,
.t_quiet2_ns = 0,
};
/* AD7690 */
static const struct ad4000_time_spec ad7690_t_spec = {
.t_conv_ns = 2100,
.t_quiet2_ns = 0,
};
/* AD7942, AD7685, AD7687 */
static const struct ad4000_time_spec ad7687_t_spec = {
.t_conv_ns = 3200,
.t_quiet2_ns = 0,
};
/* AD7691 */
static const struct ad4000_time_spec ad7691_t_spec = {
.t_conv_ns = 3700,
.t_quiet2_ns = 0,
};
/* AD7988-1 */
static const struct ad4000_time_spec ad7988_1_t_spec = {
.t_conv_ns = 9500,
.t_quiet2_ns = 0,
};
struct ad4000_chip_info {
const char *dev_name;
struct iio_chan_spec chan_spec[2];
struct iio_chan_spec reg_access_chan_spec[2];
struct iio_chan_spec offload_chan_spec;
struct iio_chan_spec reg_access_offload_chan_spec;
const struct ad4000_time_spec *time_spec;
bool has_hardware_gain;
int max_rate_hz;
};
static const struct ad4000_chip_info ad4000_chip_info = {
.dev_name = "ad4000",
.chan_spec = AD4000_PSEUDO_DIFF_CHANNELS('u', 16, 0),
.reg_access_chan_spec = AD4000_PSEUDO_DIFF_CHANNELS('u', 16, 1),
.offload_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 0, 1),
.reg_access_offload_chan_spec = AD4000_PSEUDO_DIFF_CHANNEL('u', 16, 1, 1),
.time_spec = &ad4000_t_spec,
.max_rate_hz = 2 * MEGA,
};
static const struct ad4000_chip_info ad4001_chip_info = {
.dev_name = "ad4001",
.chan_spec = AD4000_DIFF_CHANNELS('s', 16, 0),
.reg_access_chan_spec = AD4000_DIFF_CHANNELS('s', 16, 1),
.offload_chan_spec = AD4000_DIFF_CHANNEL('s', 16, 0, 1),
.reg_access_offload_chan_spec = AD4000_DIFF_CHANNEL('s', 16, 1, 1),
.time_spec = &ad4000_t_spec,
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitfield.h`, `linux/byteorder/generic.h`, `linux/cleanup.h`, `linux/device.h`, `linux/err.h`, `linux/math.h`, `linux/module.h`.
- Detected declarations: `struct ad4000_time_spec`, `struct ad4000_chip_info`, `struct ad4000_state`, `enum ad4000_sdi`, `function ad4000_fill_scale_tbl`, `function ad4000_write_reg`, `function ad4000_read_reg`, `function ad4000_set_sampling_freq`, `function ad4000_convert_and_acquire`, `function ad4000_single_conversion`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: source implementation candidate.
- 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.