include/linux/mfd/wm831x/core.h
Source file repositories/reference/linux-study-clean/include/linux/mfd/wm831x/core.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/mfd/wm831x/core.h- Extension
.h- Size
- 20597 bytes
- Lines
- 432
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/interrupt.hlinux/irqdomain.hlinux/list.hlinux/regmap.hlinux/mfd/wm831x/auxadc.hlinux/mfd/wm831x/pdata.hlinux/of.h
Detected Declarations
struct regulator_devstruct irq_domainstruct wm831xstruct wm831xenum wm831x_parentfunction wm831x_irq
Annotated Snippet
struct wm831x {
struct mutex io_lock;
struct device *dev;
struct regmap *regmap;
struct wm831x_pdata pdata;
enum wm831x_parent type;
int irq; /* Our chip IRQ */
struct mutex irq_lock;
struct irq_domain *irq_domain;
int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
bool soft_shutdown;
/* Chip revision based flags */
unsigned has_gpio_ena:1; /* Has GPIO enable bit */
unsigned has_cs_sts:1; /* Has current sink status bit */
unsigned charger_irq_wake:1; /* Are charger IRQs a wake source? */
int num_gpio;
/* Used by the interrupt controller code to post writes */
int gpio_update[WM831X_NUM_GPIO_REGS];
bool gpio_level_high[WM831X_NUM_GPIO_REGS];
bool gpio_level_low[WM831X_NUM_GPIO_REGS];
struct mutex auxadc_lock;
struct list_head auxadc_pending;
u16 auxadc_active;
wm831x_auxadc_read_fn auxadc_read;
/* The WM831x has a security key blocking access to certain
* registers. The mutex is taken by the accessors for locking
* and unlocking the security key, locked is used to fail
* writes if the lock is held.
*/
struct mutex key_lock;
unsigned int locked:1;
};
/* Device I/O API */
int wm831x_reg_read(struct wm831x *wm831x, unsigned short reg);
int wm831x_reg_write(struct wm831x *wm831x, unsigned short reg,
unsigned short val);
void wm831x_reg_lock(struct wm831x *wm831x);
int wm831x_reg_unlock(struct wm831x *wm831x);
int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
unsigned short mask, unsigned short val);
int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
int count, u16 *buf);
int wm831x_device_init(struct wm831x *wm831x, int irq);
int wm831x_device_suspend(struct wm831x *wm831x);
void wm831x_device_shutdown(struct wm831x *wm831x);
int wm831x_irq_init(struct wm831x *wm831x, int irq);
void wm831x_irq_exit(struct wm831x *wm831x);
void wm831x_auxadc_init(struct wm831x *wm831x);
static inline int wm831x_irq(struct wm831x *wm831x, int irq)
{
return irq_create_mapping(wm831x->irq_domain, irq);
}
extern struct regmap_config wm831x_regmap_config;
extern const struct of_device_id wm831x_of_match[];
#endif
Annotation
- Immediate include surface: `linux/completion.h`, `linux/interrupt.h`, `linux/irqdomain.h`, `linux/list.h`, `linux/regmap.h`, `linux/mfd/wm831x/auxadc.h`, `linux/mfd/wm831x/pdata.h`, `linux/of.h`.
- Detected declarations: `struct regulator_dev`, `struct irq_domain`, `struct wm831x`, `struct wm831x`, `enum wm831x_parent`, `function wm831x_irq`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.