Re: [PATCH v5 3/6] clk: siflower: Add SF19A2890 clock manager driver

From: Brian Masney

Date: Tue Nov 24 2026 - 12:05:31 EST


Hi Joseph,

> Add a driver for the clock manager of the Siflower SF19A2890: the CPU,
> DDR and common PLLs, and the muxes with dividers that derive the bus,
> CPU and peripheral clocks from them. The GIC timer probes before the
> platform bus and needs the CPU clock, so the driver registers that clock
> and its PLLs early, from CLK_OF_DECLARE_DRIVER, and the other clocks from
> a platform driver.
>
> Based on the driver in Chuanhong Guo's SF19A2890 branch.
>
> Link: https://github.com/981213/linux/commit/0466d6303c25
> Co-developed-by: Chuanhong Guo <gch981213@xxxxxxxxx>
> Signed-off-by: Chuanhong Guo <gch981213@xxxxxxxxx>
> Signed-off-by: Joseph Telaak <joseph@xxxxxxxxxx>
> ---
> MAINTAINERS | 1 +
> drivers/clk/Kconfig | 1 +
> drivers/clk/Makefile | 1 +
> drivers/clk/siflower/Kconfig | 11 +
> drivers/clk/siflower/Makefile | 2 +
> drivers/clk/siflower/clk-sf19a2890.c | 494 +++++++++++++++++++++++++++++++++++
> 6 files changed, 510 insertions(+)

[snip]

> static unsigned long sf19a28_muxdiv_recalc_rate(struct clk_hw *hw,
> unsigned long parent_rate)
> {
> struct sf_clk_common *cmn_priv = hw_to_sf_clk_common(hw);
> struct sf19a2890_clk *priv = cmn_to_clk(cmn_priv);
> u32 div;
>
> div = sf_readl(cmn_priv, priv->offset + REG_MUXDIV_RATIO) + 1;
> return parent_rate / div;

Newline before the return. There's other places where this is needed as
well.

> +static int sf19a2890_clk_probe(struct platform_device *pdev)
> +{
> + struct clk_hw_onecell_data *data = sf19a2890_clk_data;
> + struct device *dev = &pdev->dev;
> + unsigned int i;
> + int ret;
> +
> + if (!data)
> + return -ENODEV;
> +
> + for (i = 0; i < data->num; i++) {
> + struct clk_hw *hw = sf19a2890_hws[i];
> +
> + /* Registered early */
> + if (!IS_ERR(data->hws[i]))
> + continue;
> +
> + hw_to_sf_clk_common(hw)->base = sf19a2890_clk_base;
> + ret = devm_clk_hw_register(dev, hw);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to register clock %u\n", i);
> +
> + data->hws[i] = hw;

You can assign this before the devm_clk_hw_register().

Brian

--
Brian Masney <masneyb@xxxxxxxxxx>