include/linux/mfd/wm8994/core.h
Source file repositories/reference/linux-study-clean/include/linux/mfd/wm8994/core.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mfd/wm8994/core.h- Extension
.h- Size
- 3282 bytes
- Lines
- 141
- 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/mutex.hlinux/interrupt.hlinux/regmap.hlinux/mfd/wm8994/pdata.h
Detected Declarations
struct regulator_devstruct regulator_bulk_datastruct irq_domainstruct wm8994enum wm8994_typefunction wm8994_reg_readfunction wm8994_reg_writefunction wm8994_bulk_readfunction wm8994_bulk_writefunction wm8994_set_bitsfunction wm8994_request_irqfunction wm8994_free_irq
Annotated Snippet
struct wm8994 {
struct wm8994_pdata pdata;
enum wm8994_type type;
int revision;
int cust_id;
struct device *dev;
struct regmap *regmap;
bool ldo_ena_always_driven;
int gpio_base;
int irq_base;
int irq;
struct regmap_irq_chip_data *irq_data;
struct irq_domain *edge_irq;
/* Used over suspend/resume */
bool suspended;
struct regulator_dev *dbvdd;
int num_supplies;
struct regulator_bulk_data *supplies;
};
/* Device I/O API */
static inline int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg)
{
unsigned int val;
int ret;
ret = regmap_read(wm8994->regmap, reg, &val);
if (ret < 0)
return ret;
else
return val;
}
static inline int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
unsigned short val)
{
return regmap_write(wm8994->regmap, reg, val);
}
static inline int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
int count, u16 *buf)
{
return regmap_bulk_read(wm8994->regmap, reg, buf, count);
}
static inline int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
int count, const u16 *buf)
{
return regmap_raw_write(wm8994->regmap, reg, buf, count * sizeof(u16));
}
static inline int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
unsigned short mask, unsigned short val)
{
return regmap_update_bits(wm8994->regmap, reg, mask, val);
}
/* Helper to save on boilerplate */
static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq,
irq_handler_t handler, const char *name,
void *data)
{
if (!wm8994->irq_data)
return -EINVAL;
return request_threaded_irq(regmap_irq_get_virq(wm8994->irq_data, irq),
NULL, handler, IRQF_TRIGGER_RISING, name,
data);
}
static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data)
{
if (!wm8994->irq_data)
return;
free_irq(regmap_irq_get_virq(wm8994->irq_data, irq), data);
}
int wm8994_irq_init(struct wm8994 *wm8994);
void wm8994_irq_exit(struct wm8994 *wm8994);
#endif
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/interrupt.h`, `linux/regmap.h`, `linux/mfd/wm8994/pdata.h`.
- Detected declarations: `struct regulator_dev`, `struct regulator_bulk_data`, `struct irq_domain`, `struct wm8994`, `enum wm8994_type`, `function wm8994_reg_read`, `function wm8994_reg_write`, `function wm8994_bulk_read`, `function wm8994_bulk_write`, `function wm8994_set_bits`.
- 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.