drivers/clk/starfive/clk-starfive-jh71x0.c

Source file repositories/reference/linux-study-clean/drivers/clk/starfive/clk-starfive-jh71x0.c

File Facts

System
Linux kernel
Corpus path
drivers/clk/starfive/clk-starfive-jh71x0.c
Extension
.c
Size
9656 bytes
Lines
340
Domain
Driver Families
Bucket
drivers/clk
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (max & JH71X0_CLK_MUX_MASK) {
			if (max & JH71X0_CLK_ENABLE)
				return &jh71x0_clk_gmd_ops;
			return &jh71x0_clk_mdiv_ops;
		}
		if (max & JH71X0_CLK_ENABLE)
			return &jh71x0_clk_gdiv_ops;
		if (max == JH71X0_CLK_FRAC_MAX)
			return &jh71x0_clk_fdiv_ops;
		return &jh71x0_clk_div_ops;
	}

	if (max & JH71X0_CLK_MUX_MASK) {
		if (max & JH71X0_CLK_ENABLE)
			return &jh71x0_clk_gmux_ops;
		return &jh71x0_clk_mux_ops;
	}

	if (max & JH71X0_CLK_ENABLE)
		return &jh71x0_clk_gate_ops;

	return &jh71x0_clk_inv_ops;
}
EXPORT_SYMBOL_GPL(starfive_jh71x0_clk_ops);

struct clk_hw *jh71x0_clk_get(struct of_phandle_args *clkspec, void *data)
{
	struct jh71x0_clk_priv *priv = data;
	unsigned int idx = clkspec->args[0];

	if (idx < priv->num_reg)
		return &priv->reg[idx].hw;

	return ERR_PTR(-EINVAL);
}
EXPORT_SYMBOL_GPL(jh71x0_clk_get);

Annotation

Implementation Notes