Re: [PATCH 2/3] powercap: qcom: Add SPEL powercap driver

From: Daniel Lezcano

Date: Mon Jun 15 2026 - 08:12:02 EST


Hi Konrad,

Le 09/06/2026 à 15:31, Konrad Dybcio a écrit :
On 6/9/26 3:23 PM, Manaf Meethalavalappu Pallikunhi wrote:
Hi Konrad,


On 5/21/2026 4:46 PM, Konrad Dybcio wrote:
On 5/19/26 12:49 PM, Manaf Meethalavalappu Pallikunhi wrote:
The Qualcomm SoC Power and Electrical Limits (SPEL) provides hardware
based power monitoring and limiting capabilities for various power
domains including System, SoC, CPU clusters, GPU, and various other
subsystems.

The driver integrates with the Linux powercap framework, exposing SPEL
capabilities through powercap sysfs interfaces.

Signed-off-by: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@xxxxxxxxxxxxxxxx>
---

[...]

+static void spel_remove(struct platform_device *pdev)
+{
+    struct spel_system *sp = platform_get_drvdata(pdev);
+    int i;
+
+    if (!sp)
+        return;
+
+    /* Unregister in reverse order: children first, then SOC, then SYS */
+    for (i = SPEL_DOMAIN_MAX - 1; i >= 0; i--)
+        powercap_unregister_zone(sp->control_type, &sp->domains[i].power_zone);

Could you try adding a devm_ variant of these register functions?

Powercap framework doesn't support any devm_* API, you meant add this support in framework in this series ?

Yes, this should be fairly trivial - look at e.g.

drivers/regulator/devres.c : devm_of_regulator_get

Given how structured is the powercap framework, I'm not sure it is so trivial. May be it is, but I doubt.

I don't think it is worth to investigate adding devm_ variant now (for a few lines saved) and diverge from the objective of this series

-- Daniel