On 10/13/25 6:54 PM, Frank Li wrote:
On Sat, Oct 11, 2025 at 06:51:19PM +0200, Marek Vasut wrote:
Switch to bulk clock operations, as many of the blocks present in DC

s/operations/API

use multiple clock on i.MX95. The use of bulk clock operations allows
the driver to seamlessly handle one or multiple clock.

Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Abel Vesa <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Liu Ying <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
  drivers/gpu/drm/imx/dc/dc-drv.c | 14 ++++++++------
  drivers/gpu/drm/imx/dc/dc-ic.c  | 14 ++++++++------
  drivers/gpu/drm/imx/dc/dc-pe.c  | 12 ++++++------
  drivers/gpu/drm/imx/dc/dc-pe.h  |  3 ++-
  4 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/imx/dc/dc-drv.c b/drivers/gpu/drm/imx/dc/dc-drv.c
index f108964bf89f4..2717c92aba6c5 100644
--- a/drivers/gpu/drm/imx/dc/dc-drv.c
+++ b/drivers/gpu/drm/imx/dc/dc-drv.c
@@ -31,7 +31,8 @@

  struct dc_priv {
        struct drm_device *drm;
-       struct clk *clk_cfg;
+       struct clk_bulk_data *clk_cfg;
+       int clk_cfg_count;
  };

  DEFINE_DRM_GEM_DMA_FOPS(dc_drm_driver_fops);
@@ -163,10 +164,11 @@ static int dc_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;

-       priv->clk_cfg = devm_clk_get(&pdev->dev, NULL);
-       if (IS_ERR(priv->clk_cfg))
-               return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk_cfg),
+       ret = devm_clk_bulk_get_all(&pdev->dev, &priv->clk_cfg);
+       if (ret < 0)
+               return dev_err_probe(&pdev->dev, ret,
                                     "failed to get cfg clock\n");
+       priv->clk_cfg_count = ret;

        dev_set_drvdata(&pdev->dev, priv);

@@ -201,7 +203,7 @@ static int dc_runtime_suspend(struct device *dev)
  {
        struct dc_priv *priv = dev_get_drvdata(dev);

-       clk_disable_unprepare(priv->clk_cfg);
+       clk_bulk_disable_unprepare(priv->clk_cfg_count, priv->clk_cfg);

        return 0;
  }
@@ -211,7 +213,7 @@ static int dc_runtime_resume(struct device *dev)
        struct dc_priv *priv = dev_get_drvdata(dev);
        int ret;

-       ret = clk_prepare_enable(priv->clk_cfg);
+       ret = clk_bulk_prepare_enable(priv->clk_cfg_count, priv->clk_cfg);
        if (ret)
                dev_err(dev, "failed to enable cfg clock: %d\n", ret);

diff --git a/drivers/gpu/drm/imx/dc/dc-ic.c b/drivers/gpu/drm/imx/dc/dc-ic.c
index a270ae4030cdc..67441b349a7d2 100644
--- a/drivers/gpu/drm/imx/dc/dc-ic.c
+++ b/drivers/gpu/drm/imx/dc/dc-ic.c
@@ -30,7 +30,8 @@

  struct dc_ic_data {
        struct regmap           *regs;
-       struct clk              *clk_axi;
+       struct clk_bulk_data    *clk_axi;

I am not sure if "axi' is good name for bulk clks. Maybe use 'clks'. _axi
quite specific to special 'axi' clocks.
Fixed both, thanks.

Reply via email to