drivers/clk/rockchip/clk-rv1126.c

Source file repositories/reference/linux-study-clean/drivers/clk/rockchip/clk-rv1126.c

File Facts

System
Linux kernel
Corpus path
drivers/clk/rockchip/clk-rv1126.c
Extension
.c
Size
48536 bytes
Lines
1198
Domain
Driver Families
Bucket
drivers/clk
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct clk_rv1126_inits {
	void (*inits)(struct device_node *np);
};

static const struct clk_rv1126_inits clk_rv1126_pmucru_init = {
	.inits = rv1126_pmu_clk_init,
};

static const struct clk_rv1126_inits clk_rv1126_cru_init = {
	.inits = rv1126_clk_init,
};

static const struct of_device_id clk_rv1126_match_table[] = {
	{
		.compatible = "rockchip,rv1126-cru",
		.data = &clk_rv1126_cru_init,
	},  {
		.compatible = "rockchip,rv1126-pmucru",
		.data = &clk_rv1126_pmucru_init,
	},
	{ }
};

static int __init clk_rv1126_probe(struct platform_device *pdev)
{
	struct device_node *np = pdev->dev.of_node;
	const struct clk_rv1126_inits *init_data;

	init_data = (struct clk_rv1126_inits *)of_device_get_match_data(&pdev->dev);
	if (!init_data)
		return -EINVAL;

	if (init_data->inits)
		init_data->inits(np);

	return 0;
}

static struct platform_driver clk_rv1126_driver = {
	.driver		= {
		.name	= "clk-rv1126",
		.of_match_table = clk_rv1126_match_table,
		.suppress_bind_attrs = true,
	},
};
builtin_platform_driver_probe(clk_rv1126_driver, clk_rv1126_probe);

Annotation

Implementation Notes