devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] dt-bindings: hwmon: common schema
@ 2024-02-16  7:55 Krzysztof Kozlowski
  2024-02-16  7:55 ` [PATCH 1/2] dt-bindings: hwmon: add common properties with label Krzysztof Kozlowski
  2024-02-16  7:55 ` [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema Krzysztof Kozlowski
  0 siblings, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-16  7:55 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski,
	Krzysztof Kozlowski

All device bindings could soon get a label like:
https://lore.kernel.org/all/20240215-mbly-i2c-v1-3-19a336e91dca@bootlin.com/

Add a common binding. If this gets acked/accepted, I can add $ref to all
existing hwmon devices.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (2):
      dt-bindings: hwmon: add common properties with label
      dt-bindings: hwmon: ti,ina2xx: use common hwmon schema

 .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml   |  8 ++++----
 2 files changed, 20 insertions(+), 4 deletions(-)
---
base-commit: ae00c445390b349e070a64dc62f08aa878db7248
change-id: 20240216-dt-bindings-hwmon-common-897970b393f2

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


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

* [PATCH 1/2] dt-bindings: hwmon: add common properties with label
  2024-02-16  7:55 [PATCH 0/2] dt-bindings: hwmon: common schema Krzysztof Kozlowski
@ 2024-02-16  7:55 ` Krzysztof Kozlowski
  2024-02-16 17:11   ` Guenter Roeck
  2024-02-16  7:55 ` [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema Krzysztof Kozlowski
  1 sibling, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-16  7:55 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski,
	Krzysztof Kozlowski

Linux hwmon core code parses "label" property for each device, so add a
common schema for that.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
new file mode 100644
index 000000000000..d83f4180f622
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/hwmon-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hardware Monitoring Devices Common Properties
+
+maintainers:
+  - Guenter Roeck <linux@roeck-us.net>
+
+properties:
+  label:
+    description: A descriptive name for this device.
+
+additionalProperties: true

-- 
2.34.1


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

* [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema
  2024-02-16  7:55 [PATCH 0/2] dt-bindings: hwmon: common schema Krzysztof Kozlowski
  2024-02-16  7:55 ` [PATCH 1/2] dt-bindings: hwmon: add common properties with label Krzysztof Kozlowski
@ 2024-02-16  7:55 ` Krzysztof Kozlowski
  2024-02-16 17:12   ` Guenter Roeck
  2024-02-22 19:53   ` Rob Herring
  1 sibling, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-16  7:55 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski,
	Krzysztof Kozlowski

Reference common hwmon schema which brings the "label" property.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index a099bb71415e..df86c2c92037 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -36,9 +36,6 @@ properties:
   "#io-channel-cells":
     const: 1
 
-  label:
-    description: A descriptive name for this device.
-
   shunt-resistor:
     description:
       Shunt resistor value in micro-Ohm.
@@ -73,7 +70,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: hwmon-common.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |

-- 
2.34.1


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

* Re: [PATCH 1/2] dt-bindings: hwmon: add common properties with label
  2024-02-16  7:55 ` [PATCH 1/2] dt-bindings: hwmon: add common properties with label Krzysztof Kozlowski
@ 2024-02-16 17:11   ` Guenter Roeck
  2024-02-17  8:21     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2024-02-16 17:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Jean Delvare, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski

On 2/15/24 23:55, Krzysztof Kozlowski wrote:
> Linux hwmon core code parses "label" property for each device, so add a
> common schema for that.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

 From hwmon perspective:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
> new file mode 100644
> index 000000000000..d83f4180f622
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
> @@ -0,0 +1,16 @@
> +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/hwmon-common.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Hardware Monitoring Devices Common Properties
> +
> +maintainers:
> +  - Guenter Roeck <linux@roeck-us.net>
> +
> +properties:
> +  label:
> +    description: A descriptive name for this device.
> +

Would it make sense to also add shunt-resistor-micro-ohms ?

Thanks,
Guenter


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

* Re: [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema
  2024-02-16  7:55 ` [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema Krzysztof Kozlowski
@ 2024-02-16 17:12   ` Guenter Roeck
  2024-02-22 19:53   ` Rob Herring
  1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2024-02-16 17:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Jean Delvare, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski

On 2/15/24 23:55, Krzysztof Kozlowski wrote:
> Reference common hwmon schema which brings the "label" property.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> index a099bb71415e..df86c2c92037 100644
> --- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> @@ -36,9 +36,6 @@ properties:
>     "#io-channel-cells":
>       const: 1
>   
> -  label:
> -    description: A descriptive name for this device.
> -
>     shunt-resistor:
>       description:
>         Shunt resistor value in micro-Ohm.
> @@ -73,7 +70,10 @@ required:
>     - compatible
>     - reg
>   
> -additionalProperties: false
> +allOf:
> +  - $ref: hwmon-common.yaml#
> +
> +unevaluatedProperties: false
>   
>   examples:
>     - |
> 


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

* Re: [PATCH 1/2] dt-bindings: hwmon: add common properties with label
  2024-02-16 17:11   ` Guenter Roeck
@ 2024-02-17  8:21     ` Krzysztof Kozlowski
  2024-02-17 15:30       ` Guenter Roeck
  2024-02-22 19:50       ` Rob Herring
  0 siblings, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-17  8:21 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski

On 16/02/2024 18:11, Guenter Roeck wrote:
> On 2/15/24 23:55, Krzysztof Kozlowski wrote:
>> Linux hwmon core code parses "label" property for each device, so add a
>> common schema for that.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
>  From hwmon perspective:
> 
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> 
>> ---
>>   .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
>> new file mode 100644
>> index 000000000000..d83f4180f622
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
>> @@ -0,0 +1,16 @@
>> +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/hwmon/hwmon-common.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Hardware Monitoring Devices Common Properties
>> +
>> +maintainers:
>> +  - Guenter Roeck <linux@roeck-us.net>
>> +
>> +properties:
>> +  label:
>> +    description: A descriptive name for this device.
>> +
> 
> Would it make sense to also add shunt-resistor-micro-ohms ?

It's not present on many devices, I think, so it is also not parsed by
hwmon core. I plan to add above $ref to hwmon-common to each hwmon
binding, so this would mean all of them will get shunt-resistor. I would
not add it, but I also don't mind if I am overruled.

Best regards,
Krzysztof


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

* Re: [PATCH 1/2] dt-bindings: hwmon: add common properties with label
  2024-02-17  8:21     ` Krzysztof Kozlowski
@ 2024-02-17 15:30       ` Guenter Roeck
  2024-02-22 19:50       ` Rob Herring
  1 sibling, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2024-02-17 15:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Jean Delvare, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski

On 2/17/24 00:21, Krzysztof Kozlowski wrote:
> On 16/02/2024 18:11, Guenter Roeck wrote:
>> On 2/15/24 23:55, Krzysztof Kozlowski wrote:
>>> Linux hwmon core code parses "label" property for each device, so add a
>>> common schema for that.
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>>   From hwmon perspective:
>>
>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>
>>> ---
>>>    .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
>>>    1 file changed, 16 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
>>> new file mode 100644
>>> index 000000000000..d83f4180f622
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
>>> @@ -0,0 +1,16 @@
>>> +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/hwmon/hwmon-common.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Hardware Monitoring Devices Common Properties
>>> +
>>> +maintainers:
>>> +  - Guenter Roeck <linux@roeck-us.net>
>>> +
>>> +properties:
>>> +  label:
>>> +    description: A descriptive name for this device.
>>> +
>>
>> Would it make sense to also add shunt-resistor-micro-ohms ?
> 
> It's not present on many devices, I think, so it is also not parsed by
> hwmon core. I plan to add above $ref to hwmon-common to each hwmon
> binding, so this would mean all of them will get shunt-resistor. I would
> not add it, but I also don't mind if I am overruled.
> 

No problem, I just don't know how such common rules are supposed
to be understood. Thanks a lot for the clarification.

Thanks,
Guenter



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

* Re: [PATCH 1/2] dt-bindings: hwmon: add common properties with label
  2024-02-17  8:21     ` Krzysztof Kozlowski
  2024-02-17 15:30       ` Guenter Roeck
@ 2024-02-22 19:50       ` Rob Herring
  2024-02-24  9:24         ` Krzysztof Kozlowski
  1 sibling, 1 reply; 10+ messages in thread
From: Rob Herring @ 2024-02-22 19:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Guenter Roeck, Jean Delvare, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski

On Sat, Feb 17, 2024 at 09:21:46AM +0100, Krzysztof Kozlowski wrote:
> On 16/02/2024 18:11, Guenter Roeck wrote:
> > On 2/15/24 23:55, Krzysztof Kozlowski wrote:
> >> Linux hwmon core code parses "label" property for each device, so add a
> >> common schema for that.
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > 
> >  From hwmon perspective:
> > 
> > Acked-by: Guenter Roeck <linux@roeck-us.net>
> > 
> >> ---
> >>   .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
> >>   1 file changed, 16 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
> >> new file mode 100644
> >> index 000000000000..d83f4180f622
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
> >> @@ -0,0 +1,16 @@
> >> +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/hwmon/hwmon-common.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: Hardware Monitoring Devices Common Properties
> >> +
> >> +maintainers:
> >> +  - Guenter Roeck <linux@roeck-us.net>
> >> +
> >> +properties:
> >> +  label:
> >> +    description: A descriptive name for this device.
> >> +
> > 
> > Would it make sense to also add shunt-resistor-micro-ohms ?
> 
> It's not present on many devices, I think, so it is also not parsed by
> hwmon core. I plan to add above $ref to hwmon-common to each hwmon
> binding, so this would mean all of them will get shunt-resistor. I would
> not add it, but I also don't mind if I am overruled.

I count 11 users. That's enough for me to add it here.

I care less if a device uses a defined property it doesn't need. I'm 
more worried about having any undefined property allowed.

Rob


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

* Re: [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema
  2024-02-16  7:55 ` [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema Krzysztof Kozlowski
  2024-02-16 17:12   ` Guenter Roeck
@ 2024-02-22 19:53   ` Rob Herring
  1 sibling, 0 replies; 10+ messages in thread
From: Rob Herring @ 2024-02-22 19:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, devicetree, Jean Delvare, linux-kernel,
	Conor Dooley, Krzysztof Kozlowski, linux-hwmon, Guenter Roeck


On Fri, 16 Feb 2024 08:55:47 +0100, Krzysztof Kozlowski wrote:
> Reference common hwmon schema which brings the "label" property.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>


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

* Re: [PATCH 1/2] dt-bindings: hwmon: add common properties with label
  2024-02-22 19:50       ` Rob Herring
@ 2024-02-24  9:24         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-24  9:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: Guenter Roeck, Jean Delvare, Krzysztof Kozlowski, Conor Dooley,
	linux-hwmon, devicetree, linux-kernel, Krzysztof Kozlowski

On 22/02/2024 20:50, Rob Herring wrote:
> On Sat, Feb 17, 2024 at 09:21:46AM +0100, Krzysztof Kozlowski wrote:
>> On 16/02/2024 18:11, Guenter Roeck wrote:
>>> On 2/15/24 23:55, Krzysztof Kozlowski wrote:
>>>> Linux hwmon core code parses "label" property for each device, so add a
>>>> common schema for that.
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>
>>>  From hwmon perspective:
>>>
>>> Acked-by: Guenter Roeck <linux@roeck-us.net>
>>>
>>>> ---
>>>>   .../devicetree/bindings/hwmon/hwmon-common.yaml          | 16 ++++++++++++++++
>>>>   1 file changed, 16 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
>>>> new file mode 100644
>>>> index 000000000000..d83f4180f622
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/hwmon/hwmon-common.yaml
>>>> @@ -0,0 +1,16 @@
>>>> +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/hwmon/hwmon-common.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: Hardware Monitoring Devices Common Properties
>>>> +
>>>> +maintainers:
>>>> +  - Guenter Roeck <linux@roeck-us.net>
>>>> +
>>>> +properties:
>>>> +  label:
>>>> +    description: A descriptive name for this device.
>>>> +
>>>
>>> Would it make sense to also add shunt-resistor-micro-ohms ?
>>
>> It's not present on many devices, I think, so it is also not parsed by
>> hwmon core. I plan to add above $ref to hwmon-common to each hwmon
>> binding, so this would mean all of them will get shunt-resistor. I would
>> not add it, but I also don't mind if I am overruled.
> 
> I count 11 users. That's enough for me to add it here.
> 
> I care less if a device uses a defined property it doesn't need. I'm 
> more worried about having any undefined property allowed.

Ack, I'll send a v2.

Best regards,
Krzysztof


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

end of thread, other threads:[~2024-02-24  9:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-16  7:55 [PATCH 0/2] dt-bindings: hwmon: common schema Krzysztof Kozlowski
2024-02-16  7:55 ` [PATCH 1/2] dt-bindings: hwmon: add common properties with label Krzysztof Kozlowski
2024-02-16 17:11   ` Guenter Roeck
2024-02-17  8:21     ` Krzysztof Kozlowski
2024-02-17 15:30       ` Guenter Roeck
2024-02-22 19:50       ` Rob Herring
2024-02-24  9:24         ` Krzysztof Kozlowski
2024-02-16  7:55 ` [PATCH 2/2] dt-bindings: hwmon: ti,ina2xx: use common hwmon schema Krzysztof Kozlowski
2024-02-16 17:12   ` Guenter Roeck
2024-02-22 19:53   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).