drivers/base/regmap/internal.h
Source file repositories/reference/linux-study-clean/drivers/base/regmap/internal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/base/regmap/internal.h- Extension
.h- Size
- 10241 bytes
- Lines
- 355
- Domain
- Driver Families
- Bucket
- drivers/base
- 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/device.hlinux/regmap.hlinux/fs.hlinux/list.hlinux/wait.h
Detected Declarations
struct regmapstruct regcache_opsstruct regmap_debugfs_off_cachestruct regmap_formatstruct regmap_asyncstruct regmapstruct regcache_opsstruct regmap_range_nodestruct regmap_fieldstruct regmap_ram_datafunction regmap_debugfs_disablefunction regmap_debugfs_initcallfunction regmap_get_offsetfunction regcache_get_index_by_order
Annotated Snippet
struct regmap_debugfs_off_cache {
struct list_head list;
off_t min;
off_t max;
unsigned int base_reg;
unsigned int max_reg;
};
struct regmap_format {
size_t buf_size;
size_t reg_bytes;
size_t pad_bytes;
size_t val_bytes;
s8 reg_shift;
void (*format_write)(struct regmap *map,
unsigned int reg, unsigned int val);
void (*format_reg)(void *buf, unsigned int reg, unsigned int shift);
void (*format_val)(void *buf, unsigned int val, unsigned int shift);
unsigned int (*parse_val)(const void *buf);
void (*parse_inplace)(void *buf);
};
struct regmap_async {
struct list_head list;
struct regmap *map;
void *work_buf;
};
struct regmap {
union {
struct mutex mutex;
struct {
spinlock_t spinlock;
unsigned long spinlock_flags;
};
struct {
raw_spinlock_t raw_spinlock;
unsigned long raw_spinlock_flags;
};
};
struct lock_class_key *lock_key;
regmap_lock lock;
regmap_unlock unlock;
void *lock_arg; /* This is passed to lock/unlock functions */
gfp_t alloc_flags;
unsigned int reg_base;
struct device *dev; /* Device we do I/O on */
void *work_buf; /* Scratch buffer used to format I/O */
struct regmap_format format; /* Buffer format */
const struct regmap_bus *bus;
void *bus_context;
const char *name;
spinlock_t async_lock;
wait_queue_head_t async_waitq;
struct list_head async_list;
struct list_head async_free;
int async_ret;
bool async;
#ifdef CONFIG_DEBUG_FS
bool debugfs_disable;
struct dentry *debugfs;
const char *debugfs_name;
int debugfs_dummy_id;
unsigned int debugfs_reg_len;
unsigned int debugfs_val_len;
unsigned int debugfs_tot_len;
struct list_head debugfs_off_cache;
struct mutex cache_lock;
#endif
unsigned int max_register;
bool max_register_is_set;
bool (*writeable_reg)(struct device *dev, unsigned int reg);
bool (*readable_reg)(struct device *dev, unsigned int reg);
bool (*volatile_reg)(struct device *dev, unsigned int reg);
bool (*precious_reg)(struct device *dev, unsigned int reg);
bool (*writeable_noinc_reg)(struct device *dev, unsigned int reg);
bool (*readable_noinc_reg)(struct device *dev, unsigned int reg);
const struct regmap_access_table *wr_table;
const struct regmap_access_table *rd_table;
const struct regmap_access_table *volatile_table;
const struct regmap_access_table *precious_table;
const struct regmap_access_table *wr_noinc_table;
const struct regmap_access_table *rd_noinc_table;
Annotation
- Immediate include surface: `linux/device.h`, `linux/regmap.h`, `linux/fs.h`, `linux/list.h`, `linux/wait.h`.
- Detected declarations: `struct regmap`, `struct regcache_ops`, `struct regmap_debugfs_off_cache`, `struct regmap_format`, `struct regmap_async`, `struct regmap`, `struct regcache_ops`, `struct regmap_range_node`, `struct regmap_field`, `struct regmap_ram_data`.
- Atlas domain: Driver Families / drivers/base.
- 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.