]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panthor: attach the driver's multiple power domains
authorRain Yang <jiyu.yang@nxp.com>
Wed, 22 Oct 2025 09:26:04 +0000 (17:26 +0800)
committerLiviu Dudau <liviu.dudau@arm.com>
Mon, 3 Nov 2025 14:25:22 +0000 (14:25 +0000)
Some platforms, such as i.MX95, utilize multiple power domains that need
to be attached explicitly. This patch ensures that the driver properly
attaches all available power domains using devm_pm_domain_attach_list().

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Steven Price <steven.price@arm.com>
Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
Signed-off-by: Rain Yang <jiyu.yang@nxp.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20251022092604.181752-1-jiyu.yang@oss.nxp.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/panthor/panthor_device.c

index 83adacaa5760d6c9c5e7be09dcab0d0c92f1f019..31fb8ed68199b4ab30bdfb1f2166126a120387eb 100644 (file)
@@ -66,6 +66,16 @@ static int panthor_clk_init(struct panthor_device *ptdev)
        return 0;
 }
 
+static int panthor_init_power(struct device *dev)
+{
+       struct dev_pm_domain_list  *pd_list = NULL;
+
+       if (dev->pm_domain)
+               return 0;
+
+       return devm_pm_domain_attach_list(dev, NULL, &pd_list);
+}
+
 void panthor_device_unplug(struct panthor_device *ptdev)
 {
        /* This function can be called from two different path: the reset work
@@ -222,6 +232,12 @@ int panthor_device_init(struct panthor_device *ptdev)
        if (ret)
                return ret;
 
+       ret = panthor_init_power(ptdev->base.dev);
+       if (ret < 0) {
+               drm_err(&ptdev->base, "init power domains failed, ret=%d", ret);
+               return ret;
+       }
+
        ret = panthor_devfreq_init(ptdev);
        if (ret)
                return ret;