Re: [PATCH 1/4] dt-bindings: hwmon: add binding for adi,adt7470
From: Guenter Roeck
Date: Wed Jul 22 2026 - 14:08:37 EST
On 7/22/26 10:56, Rob Herring wrote:
On Thu, Jul 16, 2026 at 11:33:53PM -0300, Luiz Angelo Daros de Luca wrote:
+ "#cooling-cells":
+ const: 2
+ description: |
+ Cooling device exposing the 4 PWM channels.
Since "thermal/of: Support cooling device ID in cooling-spec", I could
be 2 or 3. I don't know if I should use enum [2, 3] or just go
directly to the new const: 3.
My test device has only the 0 channel in use and 2 is fine for now.
Sashiko also asked to require #pwm-cells, but it would mean to
implement a parser for that too. I don't know if it is worth it but I
can do it if needed.
What does implement a parser mean? You can define the property now, but
support it in a driver later.
FWIW, several hardware monitoring drivers already use "pwms" and
"#pwm-cells". The code doesn't seem overly complex. It is commonly
used to configure pwm frequency and polarity, and sometimes to set
parameters such as the default duty cycle. The code has similar
complexity as reading other device specific properties.
$ git grep pwm-cells drivers/hwmon/
drivers/hwmon/adt7475.c: ret = fwnode_property_get_reference_args(fwnode, "pwms", "#pwm-cells", 0, 0, &rargs);
drivers/hwmon/amc6821.c: if (of_parse_phandle_with_args(fan_np, "pwms", "#pwm-cells", 0, &args))
drivers/hwmon/emc2305.c: ret = of_parse_phandle_with_args(child, "pwms", "#pwm-cells", 0, &args);
drivers/hwmon/nct7363.c: ret = of_parse_phandle_with_args(child, "pwms", "#pwm-cells",
Guenter