Devicetree
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
@ 2026-08-24 22:13 Vincent Jardin via B4 Relay
  2026-08-24 22:17 ` sashiko-bot
  2026-08-28 10:02 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 7+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-08-24 22:13 UTC (permalink / raw)
  To: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Vincent Jardin

From: Vincent Jardin <vjardin@free.fr>

The property is missing, so a board that uses it with a thermal zone fails
with dtbs_check:

  tmp411@4c (ti,tmp411): '#thermal-sensor-cells' does not match any of the
  regexes: '^pinctrl-[0-9]+$'

Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
Changes in v2:
- Drop vcc-supply: tmp401.c has no regulator code, every hwmon binding
  that declares vcc-supply today has a driver consuming it, so declaring it
  as description only does not belong to this patch (Sashiko)
- Adapt the commit message
- Link to v1: https://lore.kernel.org/r/20260824-for-upstream-dt-tmp401-vcc-tsc-v1-1-ecb5ef7898bd@free.fr
---
 Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml b/Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml
index 0e8ddf0ad7890..f283b567d5b6c 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml
@@ -50,6 +50,9 @@ properties:
     minimum: 0
     maximum: 15
 
+  "#thermal-sensor-cells":
+    const: 1
+
 allOf:
   - if:
       properties:

---
base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b
change-id: 20260824-for-upstream-dt-tmp401-vcc-tsc-a16bec8352e4

Best regards,
-- 
Vincent Jardin <vjardin@free.fr>



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
  2026-08-24 22:13 [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells Vincent Jardin via B4 Relay
@ 2026-08-24 22:17 ` sashiko-bot
  2026-08-28 10:02 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-08-24 22:17 UTC (permalink / raw)
  To: Vincent Jardin; +Cc: devicetree, linux-hwmon, robh, conor+dt

> From: Vincent Jardin <vjardin@free.fr>
> 
> The property is missing, so a board that uses it with a thermal zone fails
> with dtbs_check:
> 
>   tmp411@4c (ti,tmp411): '#thermal-sensor-cells' does not match any of the
>   regexes: '^pinctrl-[0-9]+$'
> 
> Signed-off-by: Vincent Jardin <vjardin@free.fr>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825-for-upstream-dt-tmp401-vcc-tsc-v2-1-cbc360ec51d9@free.fr?part=1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
  2026-08-24 22:13 [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells Vincent Jardin via B4 Relay
  2026-08-24 22:17 ` sashiko-bot
@ 2026-08-28 10:02 ` Krzysztof Kozlowski
  2026-09-02 13:28   ` Guenter Roeck
  2026-09-02 14:11   ` Vincent Jardin
  1 sibling, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-08-28 10:02 UTC (permalink / raw)
  To: Vincent Jardin
  Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel

On Tue, Aug 25, 2026 at 12:13:18AM +0200, Vincent Jardin wrote:
> The property is missing, so a board that uses it with a thermal zone fails
> with dtbs_check:
> 
>   tmp411@4c (ti,tmp411): '#thermal-sensor-cells' does not match any of the

Cannot find such node.

How can I reproduce this warning? If it is non-reproducible, then it is
not a valid reason for a change and instead driver implementing thermal
sensor would be the proper reason.


>   regexes: '^pinctrl-[0-9]+$'

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
  2026-08-28 10:02 ` Krzysztof Kozlowski
@ 2026-09-02 13:28   ` Guenter Roeck
  2026-09-02 14:26     ` Vincent Jardin
  2026-09-02 14:11   ` Vincent Jardin
  1 sibling, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2026-09-02 13:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Vincent Jardin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-hwmon,
	devicetree, linux-kernel

On 8/28/26 03:02, Krzysztof Kozlowski wrote:
> On Tue, Aug 25, 2026 at 12:13:18AM +0200, Vincent Jardin wrote:
>> The property is missing, so a board that uses it with a thermal zone fails
>> with dtbs_check:
>>
>>    tmp411@4c (ti,tmp411): '#thermal-sensor-cells' does not match any of the
> 
> Cannot find such node.
> 
> How can I reproduce this warning? If it is non-reproducible, then it is
> not a valid reason for a change and instead driver implementing thermal
> sensor would be the proper reason.
> 

The driver does register thermal zones. Since #thermal-sensor-cells is
mandatory for using it, I would think that the property is needed.

However, not all chips supported by the driver (and this bindings file)
have more than one channel, so I suspect that the value range might
need to be "enum: [0, 1]".

Thanks,
Guenter


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
  2026-08-28 10:02 ` Krzysztof Kozlowski
  2026-09-02 13:28   ` Guenter Roeck
@ 2026-09-02 14:11   ` Vincent Jardin
  1 sibling, 0 replies; 7+ messages in thread
From: Vincent Jardin @ 2026-09-02 14:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel

Hi Krzysztof,

Le 28/08/26 12:02, Krzysztof Kozlowski a écrit :
> On Tue, Aug 25, 2026 at 12:13:18AM +0200, Vincent Jardin wrote:
> > The property is missing, so a board that uses it with a thermal zone fails
> > with dtbs_check:
> > 
> >   tmp411@4c (ti,tmp411): '#thermal-sensor-cells' does not match any of the
> 
> Cannot find such node.
> 
> How can I reproduce this warning? If it is non-reproducible, then it is
> not a valid reason for a change and instead driver implementing thermal
> sensor would be the proper reason.

Hmm, you are right, it is not reproducible from the main tree, I was confused
with my ongoing developments: no in-tree DTS uses a tmp401-family
chip as a thermal sensor, so dtbs_check has nothing to complain about.

The warning came from a DTS that does, which is exactly the usage the
driver now supports and you are right that the driver, not the
warning, is the proper reason.

Since commit
  a3b61ba2558e ("hwmon: (tmp401) register with thermal subsystem"),
in v7.3-rc1, tmp401 sets HWMON_C_REGISTER_TZ

-> the hwmon core calls devm_thermal_of_zone_register() for every
temperature channel.

My goal is to unify/follow the other ones such as national,lm90.yaml,
ti,tmp102.yaml or adi,adt7470.yaml already pair "const: 1" with drivers
that set HWMON_C_REGISTER_TZ.

v3 justifies the change from the driver and drops the dtbs_check excerpt.
The diff is unchanged.

Thanks for catching it and sorry for the confusions,
  Vincent

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
  2026-09-02 13:28   ` Guenter Roeck
@ 2026-09-02 14:26     ` Vincent Jardin
  2026-09-02 18:04       ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Vincent Jardin @ 2026-09-02 14:26 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-hwmon, devicetree, linux-kernel

Hi Guenter,

> The driver does register thermal zones. Since #thermal-sensor-cells is
> mandatory for using it, I would think that the property is needed.

agree. thanks.

> However, not all chips supported by the driver (and this bindings file)
> have more than one channel, so I suspect that the value range might
> need to be "enum: [0, 1]".

I could switch to "enum: [0, 1]" if you would still prefer it, but
tmp401_probe() sets temp_channel_config[0] and [1] unconditionally (local plus
one remote diode) and tmp432 adds [2] for its second remote.
So each case in this binding has at least two channels and the channel index is always
meaningful. That is why "const: 1" is used, matching national,lm90.yaml,
which covers a mix of 2 and 3 channel chips.

I'll send a v3, that does not change the yaml by that applies the proper comments
per Krzysztof's feedbacks.

best regards,
  Vincent

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells
  2026-09-02 14:26     ` Vincent Jardin
@ 2026-09-02 18:04       ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2026-09-02 18:04 UTC (permalink / raw)
  To: Vincent Jardin
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-hwmon, devicetree, linux-kernel

On 9/2/26 07:26, Vincent Jardin wrote:
> Hi Guenter,
> 
>> The driver does register thermal zones. Since #thermal-sensor-cells is
>> mandatory for using it, I would think that the property is needed.
> 
> agree. thanks.
> 
>> However, not all chips supported by the driver (and this bindings file)
>> have more than one channel, so I suspect that the value range might
>> need to be "enum: [0, 1]".
> 
> I could switch to "enum: [0, 1]" if you would still prefer it, but
> tmp401_probe() sets temp_channel_config[0] and [1] unconditionally (local plus
> one remote diode) and tmp432 adds [2] for its second remote.
> So each case in this binding has at least two channels and the channel index is always
> meaningful. That is why "const: 1" is used, matching national,lm90.yaml,
> which covers a mix of 2 and 3 channel chips.
> 
Makes sense. Sorry, I missed that all chips have at least two sensors.

Thanks,
Guenter

> I'll send a v3, that does not change the yaml by that applies the proper comments
> per Krzysztof's feedbacks.
> 
> best regards,
>    Vincent


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-02 18:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 22:13 [PATCH v2] dt-bindings: hwmon: ti,tmp401: add #thermal-sensor-cells Vincent Jardin via B4 Relay
2026-08-24 22:17 ` sashiko-bot
2026-08-28 10:02 ` Krzysztof Kozlowski
2026-09-02 13:28   ` Guenter Roeck
2026-09-02 14:26     ` Vincent Jardin
2026-09-02 18:04       ` Guenter Roeck
2026-09-02 14:11   ` Vincent Jardin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox