Re: [PATCH v2 2/3] powercap: qcom: Add SPEL powercap driver
From: Konrad Dybcio
Date: Tue Jun 23 2026 - 07:11:42 EST
On 6/23/26 12:58 PM, Manaf Meethalavalappu Pallikunhi wrote:
> Hi Konrad,
>
>
> On 6/22/2026 4:31 PM, Konrad Dybcio wrote:
>> On 6/19/26 10:39 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>
>>> ---
[...]
>>> +/* Domain configuration */
>>> +static const struct spel_domain_info domain_info[SPEL_DOMAIN_MAX] = {
>>> + [SPEL_DOMAIN_SYS] = { "sys", 0x40 },
>>> + [SPEL_DOMAIN_SOC] = { "soc", 0x00 },
>>> + [SPEL_DOMAIN_CL0] = { "cl0", 0x5c },
>>> + [SPEL_DOMAIN_CL1] = { "cl1", 0x60 },
>>> + [SPEL_DOMAIN_CL2] = { "cl2", 0x64 },
>>> + [SPEL_DOMAIN_IGPU] = { "igpu", 0x08 },
>>> + [SPEL_DOMAIN_DGPU] = { "dgpu", 0x44 },
>>> + [SPEL_DOMAIN_NSP] = { "nsp", 0x0c },
>>> + [SPEL_DOMAIN_MMCX] = { "mmcx", 0x10 },
>>> + [SPEL_DOMAIN_INFRA] = { "infra", 0x18 },
>>> + [SPEL_DOMAIN_DRAM] = { "dram", 0x1c },
>>> + [SPEL_DOMAIN_MDM] = { "mdm", 0x48 },
>>> + [SPEL_DOMAIN_WLAN] = { "wlan", 0x4c },
>>> + [SPEL_DOMAIN_USB1] = { "usb1", 0x50 },
>>> + [SPEL_DOMAIN_USB2] = { "usb2", 0x54 },
>>> + [SPEL_DOMAIN_USB3] = { "usb3", 0x58 },
>>> +};
>>
>> I would expect that the names are going to stay common, but the offsets
>
> Names also can be different here. For example, hawi, It has only subset of these domain and it doesn't have dgpu, it has only "gpu". cpu domain
> names also different there.
Presumably we can unify the names (i.e. use SPEL_DOMAIN_IGPU on both
hawi and glymur)
>
>> will be different. This array should probably be called
>> glymur_domain_info[]. We may have another LUT just for names of indices
>
> ACK for glymur_domain_info.
>> (i.e. [SPEL_DOMAIN_xxx] = "xxx")
This approach would still save us quite some bytes for the names that are
the same
i.e.
foobar_names_lut[] = {
[SPEL_DOMAIN_xxx] = "xxx",
[SPEL_DOMAIN_yyy] = "yyy",
[SPEL_DOMAIN_zzz] = "zzz"
};
glymur_domain_offsets[] = {
[SPEL_DOMAIN_xxx] = 0x20,
[SPEL_DOMAIN_yyy] = 0x24,
[SPEL_DOMAIN_zzz] = 0x28
};
Konrad