On 6/24/26 12:42, Krzysztof Kozlowski wrote:
[ ... ]
Therefore I still do not see the need of tmd-names. You know the name of
cooling device, because you have strict one-to-one mapping.
There is one remote proc with one or multiple cooling devices attached.
We describe those in the remoteproc node with the tmd-names.
Anyway, we should be able to list the tmd names in the driver itself if
we ensure a consistency with the index by defining them in a shared
header eg. include/dt-bindings/firmware/qcom,cdsp.h
#define HAMOA_TMD_CDSP_SW 0
#define HAMOA_TMD_CDSP_HW 1
#define HAMOA_TMD_CP0UV_RESTRICTION_COLD 2
In the driver:
struct tmd_name {
const char *name;
int id;
bool disabled;
};
static struct tmd_name tmd_names[] = {
{ .name = "cdsp_sw", HAMOA_TMD_CDSP_SW },
{ .name = "cdsp_hw", HAMOA_TMD_CDSP_HW, .disabled = true },
{ .name = "cpuv_restriction_cold", HAMOA_TMD_CP0UV_RESTRICTION_COLD,
.disabled = true },
};
...
for (int i = 0; i < ARRAY_SIZE(tmd_names); i++) {
if (tmd_names[i].disabled)
continue;
devm_cooling_of_device_register(rprocdev,
tmd_names[i].name, tmd_names[i].id, ...);
}
In the device tree:
cooling-maps = <&rproc HAMOA_TMD_CDSP_SW min max>;
I think that is somehow what Konrad and Dmitry were suggesting
Does it sound better ?