diff mbox series

[1/2] dt-bindings: hwmon: add common properties with label

Message ID 20240216-dt-bindings-hwmon-common-v1-1-3c2c24ff1260@linaro.org
State Changes Requested
Headers show
Series dt-bindings: hwmon: common schema | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Krzysztof Kozlowski Feb. 16, 2024, 7:55 a.m. UTC
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(+)

Comments

Guenter Roeck Feb. 16, 2024, 5:11 p.m. UTC | #1
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
Krzysztof Kozlowski Feb. 17, 2024, 8:21 a.m. UTC | #2
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
Guenter Roeck Feb. 17, 2024, 3:30 p.m. UTC | #3
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
Rob Herring Feb. 22, 2024, 7:50 p.m. UTC | #4
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
Krzysztof Kozlowski Feb. 24, 2024, 9:24 a.m. UTC | #5
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
diff mbox series

Patch

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