Re: [PATCH v3 09/17] drm/spacemit: add Saturn DPU hardware backend
From: Guodong Xu
Date: Sat Nov 28 2026 - 22:31:44 EST
Hi Cody,
On Sat, 21 Nov 2026 15:40:48 +0800, Cody Kang via B4 Relay wrote:
[...]
> +int spacemit_dpu_enable_clocks(struct spacemit_drm_private *priv)
> +{
> + struct dpu_clk_context *clk_ctx = &priv->clk_ctx;
> + int ret;
> +
> + /*
> + * Rate left alone: the mode's pixel clock is the DP PHY's PLL. This
> + * input only has to run for the "lcd" reset to reach the DPU.
> + */
> + ret = clk_prepare_enable(clk_ctx->pxclk);
> + if (ret)
> + goto err;
> +
> + ret = clk_prepare_enable(clk_ctx->mclk);
> + if (ret)
> + goto err_pxclk;
> + spacemit_dpu_clk_set_rate(priv->dev, clk_ctx->mclk, DPU_MCLK_DEFAULT,
> + "mclk");
> +
> + /* The escape clock only has to run for the "esc" reset to propagate. */
> + ret = clk_prepare_enable(clk_ctx->escclk);
> + if (ret)
> + goto err_mclk;
> +
> + ret = clk_prepare_enable(clk_ctx->aclk);
> + if (ret)
> + goto err_escclk;
> + spacemit_dpu_clk_set_rate(priv->dev, clk_ctx->aclk, DPU_AXICLK_DEFAULT,
> + "aclk");
> +
> + ret = clk_prepare_enable(clk_ctx->dscclk);
> + if (ret)
> + goto err_aclk;
Could these five calls be one call with the clk bulk API?
> +
> + return 0;
> +
> +err_aclk:
> + clk_disable_unprepare(clk_ctx->aclk);
> +err_escclk:
> + clk_disable_unprepare(clk_ctx->escclk);
> +err_mclk:
> + clk_disable_unprepare(clk_ctx->mclk);
> +err_pxclk:
> + clk_disable_unprepare(clk_ctx->pxclk);
Then these labels could go as well.
Guodong