drivers/iio/dac/ds4424.c
Source file repositories/reference/linux-study-clean/drivers/iio/dac/ds4424.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/dac/ds4424.c- Extension
.c- Size
- 11165 bytes
- Lines
- 440
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/array_size.hlinux/bits.hlinux/delay.hlinux/err.hlinux/i2c.hlinux/kernel.hlinux/module.hlinux/property.hlinux/regmap.hlinux/regulator/consumer.hlinux/time64.hlinux/types.hlinux/iio/driver.hlinux/iio/iio.hlinux/iio/machine.h
Detected Declarations
struct ds4424_chip_infostruct ds4424_datafunction Copyrightfunction ds4424_init_regmapfunction ds4424_read_rawfunction ds4424_write_rawfunction ds4424_parse_rfsfunction ds4424_suspendfunction ds4424_resumefunction ds4424_probefunction ds4424_remove
Annotated Snippet
struct ds4424_chip_info {
const char *name;
int vref_mV;
int scale_denom;
u8 result_mask;
u8 num_channels;
};
static const struct ds4424_chip_info ds4402_info = {
.name = "ds4402",
.vref_mV = 1230,
.scale_denom = 4,
.result_mask = DS4404_DAC_MASK,
.num_channels = DS4422_MAX_DAC_CHANNELS,
};
static const struct ds4424_chip_info ds4404_info = {
.name = "ds4404",
.vref_mV = 1230,
.scale_denom = 4,
.result_mask = DS4404_DAC_MASK,
.num_channels = DS4424_MAX_DAC_CHANNELS,
};
static const struct ds4424_chip_info ds4422_info = {
.name = "ds4422",
.vref_mV = 976,
.scale_denom = 16,
.result_mask = DS4424_DAC_MASK,
.num_channels = DS4422_MAX_DAC_CHANNELS,
};
static const struct ds4424_chip_info ds4424_info = {
.name = "ds4424",
.vref_mV = 976,
.scale_denom = 16,
.result_mask = DS4424_DAC_MASK,
.num_channels = DS4424_MAX_DAC_CHANNELS,
};
struct ds4424_data {
struct regmap *regmap;
struct regulator *vcc_reg;
const struct ds4424_chip_info *chip_info;
u32 rfs_ohms[DS4424_MAX_DAC_CHANNELS];
bool has_rfs;
};
static const struct iio_chan_spec ds4424_channels[] = {
DS4424_CHANNEL(0),
DS4424_CHANNEL(1),
DS4424_CHANNEL(2),
DS4424_CHANNEL(3),
};
static const struct iio_chan_spec ds4424_channels_with_scale[] = {
DS4424_CHANNEL_WITH_SCALE(0),
DS4424_CHANNEL_WITH_SCALE(1),
DS4424_CHANNEL_WITH_SCALE(2),
DS4424_CHANNEL_WITH_SCALE(3),
};
static const struct regmap_range ds44x2_ranges[] = {
regmap_reg_range(DS4424_DAC_ADDR(0), DS4424_DAC_ADDR(1)),
};
static const struct regmap_range ds44x4_ranges[] = {
regmap_reg_range(DS4424_DAC_ADDR(0), DS4424_DAC_ADDR(3)),
};
static const struct regmap_access_table ds44x2_table = {
.yes_ranges = ds44x2_ranges,
.n_yes_ranges = ARRAY_SIZE(ds44x2_ranges),
};
static const struct regmap_access_table ds44x4_table = {
.yes_ranges = ds44x4_ranges,
.n_yes_ranges = ARRAY_SIZE(ds44x4_ranges),
};
static const struct regmap_config ds44x2_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.cache_type = REGCACHE_MAPLE,
.max_register = DS4424_DAC_ADDR(1),
.rd_table = &ds44x2_table,
.wr_table = &ds44x2_table,
};
static const struct regmap_config ds44x4_regmap_config = {
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/bits.h`, `linux/delay.h`, `linux/err.h`, `linux/i2c.h`, `linux/kernel.h`, `linux/module.h`, `linux/property.h`.
- Detected declarations: `struct ds4424_chip_info`, `struct ds4424_data`, `function Copyright`, `function ds4424_init_regmap`, `function ds4424_read_raw`, `function ds4424_write_raw`, `function ds4424_parse_rfs`, `function ds4424_suspend`, `function ds4424_resume`, `function ds4424_probe`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: source implementation candidate.
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.