include/linux/mfd/da9052/da9052.h
Source file repositories/reference/linux-study-clean/include/linux/mfd/da9052/da9052.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mfd/da9052/da9052.h- Extension
.h- Size
- 4805 bytes
- Lines
- 221
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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/interrupt.hlinux/regmap.hlinux/slab.hlinux/completion.hlinux/list.hlinux/mfd/core.hlinux/mfd/da9052/reg.h
Detected Declarations
struct da9052_pdatastruct da9052enum da9052_chip_idfunction da9052_reg_readfunction da9052_reg_writefunction da9052_group_readfunction da9052_group_writefunction da9052_reg_update
Annotated Snippet
struct da9052 {
struct device *dev;
struct regmap *regmap;
struct mutex auxadc_lock;
struct completion done;
int irq_base;
struct regmap_irq_chip_data *irq_data;
u8 chip_id;
int chip_irq;
int fault_log;
/* SOC I/O transfer related fixes for DA9052/53 */
int (*fix_io) (struct da9052 *da9052, unsigned char reg);
};
/* ADC API */
int da9052_adc_manual_read(struct da9052 *da9052, unsigned char channel);
int da9052_adc_read_temp(struct da9052 *da9052);
/* Device I/O API */
static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg)
{
int val, ret;
ret = regmap_read(da9052->regmap, reg, &val);
if (ret < 0)
return ret;
if (da9052->fix_io) {
ret = da9052->fix_io(da9052, reg);
if (ret < 0)
return ret;
}
return val;
}
static inline int da9052_reg_write(struct da9052 *da9052, unsigned char reg,
unsigned char val)
{
int ret;
ret = regmap_write(da9052->regmap, reg, val);
if (ret < 0)
return ret;
if (da9052->fix_io) {
ret = da9052->fix_io(da9052, reg);
if (ret < 0)
return ret;
}
return ret;
}
static inline int da9052_group_read(struct da9052 *da9052, unsigned char reg,
unsigned reg_cnt, unsigned char *val)
{
int ret;
unsigned int tmp;
int i;
for (i = 0; i < reg_cnt; i++) {
ret = regmap_read(da9052->regmap, reg + i, &tmp);
val[i] = (unsigned char)tmp;
if (ret < 0)
return ret;
}
if (da9052->fix_io) {
ret = da9052->fix_io(da9052, reg);
if (ret < 0)
return ret;
}
return ret;
}
static inline int da9052_group_write(struct da9052 *da9052, unsigned char reg,
unsigned reg_cnt, unsigned char *val)
{
int ret = 0;
int i;
for (i = 0; i < reg_cnt; i++) {
ret = regmap_write(da9052->regmap, reg + i, val[i]);
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/regmap.h`, `linux/slab.h`, `linux/completion.h`, `linux/list.h`, `linux/mfd/core.h`, `linux/mfd/da9052/reg.h`.
- Detected declarations: `struct da9052_pdata`, `struct da9052`, `enum da9052_chip_id`, `function da9052_reg_read`, `function da9052_reg_write`, `function da9052_group_read`, `function da9052_group_write`, `function da9052_reg_update`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.