drivers/interconnect/samsung/exynos.c
Source file repositories/reference/linux-study-clean/drivers/interconnect/samsung/exynos.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/interconnect/samsung/exynos.c- Extension
.c- Size
- 4916 bytes
- Lines
- 197
- Domain
- Driver Families
- Bucket
- drivers/interconnect
- 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.
- 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/device.hlinux/interconnect-provider.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_qos.hlinux/slab.h
Detected Declarations
struct exynos_icc_privfunction exynos_generic_icc_setfunction exynos_generic_icc_removefunction exynos_generic_icc_probe
Annotated Snippet
struct exynos_icc_priv {
struct device *dev;
/* One interconnect node per provider */
struct icc_provider provider;
struct icc_node *node;
struct dev_pm_qos_request qos_req;
u32 bus_clk_ratio;
};
static struct icc_node *exynos_icc_get_parent(struct device_node *np)
{
struct of_phandle_args args;
struct icc_node_data *icc_node_data;
struct icc_node *icc_node;
int num, ret;
num = of_count_phandle_with_args(np, "interconnects",
"#interconnect-cells");
if (num < 1)
return NULL; /* parent nodes are optional */
/* Get the interconnect target node */
ret = of_parse_phandle_with_args(np, "interconnects",
"#interconnect-cells", 0, &args);
if (ret < 0)
return ERR_PTR(ret);
icc_node_data = of_icc_get_from_provider(&args);
of_node_put(args.np);
if (IS_ERR(icc_node_data))
return ERR_CAST(icc_node_data);
icc_node = icc_node_data->node;
kfree(icc_node_data);
return icc_node;
}
static int exynos_generic_icc_set(struct icc_node *src, struct icc_node *dst)
{
struct exynos_icc_priv *src_priv = src->data, *dst_priv = dst->data;
s32 src_freq = max(src->avg_bw, src->peak_bw) / src_priv->bus_clk_ratio;
s32 dst_freq = max(dst->avg_bw, dst->peak_bw) / dst_priv->bus_clk_ratio;
int ret;
ret = dev_pm_qos_update_request(&src_priv->qos_req, src_freq);
if (ret < 0) {
dev_err(src_priv->dev, "failed to update PM QoS of %s (src)\n",
src->name);
return ret;
}
ret = dev_pm_qos_update_request(&dst_priv->qos_req, dst_freq);
if (ret < 0) {
dev_err(dst_priv->dev, "failed to update PM QoS of %s (dst)\n",
dst->name);
return ret;
}
return 0;
}
static struct icc_node *exynos_generic_icc_xlate(const struct of_phandle_args *spec,
void *data)
{
struct exynos_icc_priv *priv = data;
if (spec->np != priv->dev->parent->of_node)
return ERR_PTR(-EINVAL);
return priv->node;
}
static void exynos_generic_icc_remove(struct platform_device *pdev)
{
struct exynos_icc_priv *priv = platform_get_drvdata(pdev);
icc_provider_deregister(&priv->provider);
icc_nodes_remove(&priv->provider);
}
static int exynos_generic_icc_probe(struct platform_device *pdev)
{
struct device *bus_dev = pdev->dev.parent;
struct exynos_icc_priv *priv;
struct icc_provider *provider;
struct icc_node *icc_node, *icc_parent_node;
Annotation
- Immediate include surface: `linux/device.h`, `linux/interconnect-provider.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_qos.h`, `linux/slab.h`.
- Detected declarations: `struct exynos_icc_priv`, `function exynos_generic_icc_set`, `function exynos_generic_icc_remove`, `function exynos_generic_icc_probe`.
- Atlas domain: Driver Families / drivers/interconnect.
- 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.