drivers/bus/vexpress-config.c
Source file repositories/reference/linux-study-clean/drivers/bus/vexpress-config.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bus/vexpress-config.c- Extension
.c- Size
- 10196 bytes
- Lines
- 419
- Domain
- Driver Families
- Bucket
- drivers/bus
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/init.hlinux/io.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/of_platform.hlinux/sched/signal.hlinux/slab.hlinux/vexpress.h
Detected Declarations
struct vexpress_syscfgstruct vexpress_syscfg_funcstruct vexpress_config_bridge_opsstruct vexpress_config_bridgefunction vexpress_config_set_masterfunction vexpress_config_lockfunction vexpress_config_unlockfunction vexpress_config_find_propfunction vexpress_config_get_topofunction vexpress_config_devres_releasefunction vexpress_syscfg_execfunction vexpress_syscfg_readfunction vexpress_syscfg_writefunction vexpress_syscfg_regmap_exitfunction list_for_each_entry_safefunction vexpress_syscfg_probefunction for_each_compatible_nodeexport devm_regmap_init_vexpress_config
Annotated Snippet
struct vexpress_syscfg {
struct device *dev;
void __iomem *base;
struct list_head funcs;
};
struct vexpress_syscfg_func {
struct list_head list;
struct vexpress_syscfg *syscfg;
struct regmap *regmap;
int num_templates;
u32 template[] __counted_by(num_templates); /* Keep it last! */
};
struct vexpress_config_bridge_ops {
struct regmap * (*regmap_init)(struct device *dev, void *context);
void (*regmap_exit)(struct regmap *regmap, void *context);
};
struct vexpress_config_bridge {
struct vexpress_config_bridge_ops *ops;
void *context;
};
static DEFINE_MUTEX(vexpress_config_mutex);
static u32 vexpress_config_site_master = VEXPRESS_SITE_MASTER;
static void vexpress_config_set_master(u32 site)
{
vexpress_config_site_master = site;
}
static void vexpress_config_lock(void *arg)
{
mutex_lock(&vexpress_config_mutex);
}
static void vexpress_config_unlock(void *arg)
{
mutex_unlock(&vexpress_config_mutex);
}
static void vexpress_config_find_prop(struct device_node *node,
const char *name, u32 *val)
{
/* Default value */
*val = 0;
of_node_get(node);
while (node) {
if (of_property_read_u32(node, name, val) == 0) {
of_node_put(node);
return;
}
node = of_get_next_parent(node);
}
}
static int vexpress_config_get_topo(struct device_node *node, u32 *site,
u32 *position, u32 *dcc)
{
vexpress_config_find_prop(node, "arm,vexpress,site", site);
if (*site == VEXPRESS_SITE_MASTER)
*site = vexpress_config_site_master;
if (WARN_ON(vexpress_config_site_master == VEXPRESS_SITE_MASTER))
return -EINVAL;
vexpress_config_find_prop(node, "arm,vexpress,position", position);
vexpress_config_find_prop(node, "arm,vexpress,dcc", dcc);
return 0;
}
static void vexpress_config_devres_release(struct device *dev, void *res)
{
struct vexpress_config_bridge *bridge = dev_get_drvdata(dev->parent);
struct regmap *regmap = res;
bridge->ops->regmap_exit(regmap, bridge->context);
}
struct regmap *devm_regmap_init_vexpress_config(struct device *dev)
{
struct vexpress_config_bridge *bridge;
struct regmap *regmap;
struct regmap **res;
Annotation
- Immediate include surface: `linux/err.h`, `linux/init.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/of_platform.h`, `linux/sched/signal.h`.
- Detected declarations: `struct vexpress_syscfg`, `struct vexpress_syscfg_func`, `struct vexpress_config_bridge_ops`, `struct vexpress_config_bridge`, `function vexpress_config_set_master`, `function vexpress_config_lock`, `function vexpress_config_unlock`, `function vexpress_config_find_prop`, `function vexpress_config_get_topo`, `function vexpress_config_devres_release`.
- Atlas domain: Driver Families / drivers/bus.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.