Skip to contentSkip to conversation

drm/panthor: attach the driver's multiple power domains

PATCH In review Rain Yang 2 participants 2 messages Oct 22, 2025 – Oct 30, 2025

Subsystems (4)
lore
Share & tools
lore

Rain Yang

author
#0 lore raw

PATCH v3 1/1 drm/panthor: attach the driver's multiple power domains

From: Rain Yang <[email protected]>

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().

---
 drivers/gpu/drm/panthor/panthor_device.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/panthor/panthor_device.c +16 -0
index f0b2da5b2b96..c39b9812eaa7 100644
@@ -64,6 +64,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
@@ -218,6 +228,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;
Signature · 1 line
2.39.5
maintainer Reviewed-by on v3 1/1
#1 lore raw
Quoted 10 lines · Rain Yang

From: Rain Yang <[email protected]>

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().

Best regards,
Liviu

Quoted 41 lines
---
 drivers/gpu/drm/panthor/panthor_device.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/panthor/panthor_device.c +16 -0
index f0b2da5b2b96..c39b9812eaa7 100644
@@ -64,6 +64,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
@@ -218,6 +228,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;
Signature · 1 line
2.39.5
Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯