drivers/dma/ti/k3-psil.c
Source file repositories/reference/linux-study-clean/drivers/dma/ti/k3-psil.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/ti/k3-psil.c- Extension
.c- Size
- 2999 bytes
- Lines
- 111
- Domain
- Driver Families
- Bucket
- drivers/dma
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/device.hlinux/init.hlinux/mutex.hlinux/of.hlinux/sys_soc.hk3-psil-priv.h
Detected Declarations
function psil_set_new_ep_configexport psil_get_ep_configexport psil_set_new_ep_config
Annotated Snippet
if (soc) {
soc_ep_map = soc->data;
} else {
pr_err("PSIL: No compatible machine found for map\n");
mutex_unlock(&ep_map_mutex);
return ERR_PTR(-ENOTSUPP);
}
pr_debug("%s: Using map for %s\n", __func__, soc_ep_map->name);
}
mutex_unlock(&ep_map_mutex);
if (thread_id & K3_PSIL_DST_THREAD_ID_OFFSET && soc_ep_map->dst) {
/* check in destination thread map */
for (i = 0; i < soc_ep_map->dst_count; i++) {
if (soc_ep_map->dst[i].thread_id == thread_id)
return &soc_ep_map->dst[i].ep_config;
}
}
thread_id &= ~K3_PSIL_DST_THREAD_ID_OFFSET;
if (soc_ep_map->src) {
for (i = 0; i < soc_ep_map->src_count; i++) {
if (soc_ep_map->src[i].thread_id == thread_id)
return &soc_ep_map->src[i].ep_config;
}
}
return ERR_PTR(-ENOENT);
}
EXPORT_SYMBOL_GPL(psil_get_ep_config);
int psil_set_new_ep_config(struct device *dev, const char *name,
struct psil_endpoint_config *ep_config)
{
struct psil_endpoint_config *dst_ep_config;
struct of_phandle_args dma_spec;
u32 thread_id;
int index;
if (!dev || !dev->of_node)
return -EINVAL;
index = of_property_match_string(dev->of_node, "dma-names", name);
if (index < 0)
return index;
if (of_parse_phandle_with_args(dev->of_node, "dmas", "#dma-cells",
index, &dma_spec))
return -ENOENT;
thread_id = dma_spec.args[0];
dst_ep_config = psil_get_ep_config(thread_id);
if (IS_ERR(dst_ep_config)) {
pr_err("PSIL: thread ID 0x%04x not defined in map\n",
thread_id);
of_node_put(dma_spec.np);
return PTR_ERR(dst_ep_config);
}
memcpy(dst_ep_config, ep_config, sizeof(*dst_ep_config));
of_node_put(dma_spec.np);
return 0;
}
EXPORT_SYMBOL_GPL(psil_set_new_ep_config);
MODULE_DESCRIPTION("K3 PSI-L endpoint configuration");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/device.h`, `linux/init.h`, `linux/mutex.h`, `linux/of.h`, `linux/sys_soc.h`, `k3-psil-priv.h`.
- Detected declarations: `function psil_set_new_ep_config`, `export psil_get_ep_config`, `export psil_set_new_ep_config`.
- Atlas domain: Driver Families / drivers/dma.
- 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.