Le 25/06/2026 à 08:48, Krzysztof Kozlowski a écrit :
On 24/06/2026 17:56, Daniel Lezcano wrote:
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 ?

Yes and I am surprised that it came now. So you had TMD index available
thus the ID was defined. If device has unique and fixed ID, you should
not have any more properties defining it, because that ID is enough. Any
names could be only for users, e.g. label, but that is not the case here.
Yes indeed, having the constraint of cooling index and tmd(name, id) for the connection between the cooling device and the thermal zone was a bit confusing in our discussion.

Thanks for the review


Reply via email to