Re: [PATCH v2 02/11] dt-bindings: hwmon: Add Apple System Management Controller hwmon schema

Guenter Roeck
2025-09-28T02:09:21Z

On 9/27/25 17:36, James Calligeros wrote:
> Hi Rob,
>
> On Friday, 26 September 2025 7:43:23 am Australian Eastern Standard Time Rob
> Herring wrote:
>> On Thu, Sep 25, 2025 at 3:49 PM Janne Grunau <j@jannau.net> wrote:
>>> On Fri, Aug 29, 2025 at 11:40:57AM -0500, Rob Herring wrote:
>>>>
>>>> This should be something like this:
>>>>
>>>> "^current-[A-Za-z0-9]{4}$":
>>>> $ref: "#/$defs/sensor"
>>>> unevaluatedProperties: false
>>>>
>>>> With the $defs/sensor being:
>>>>
>>>> $defs:
>>>> sensor:
>>>> type: object
>>>>
>>>> properties:
>>>> apple,key-id:
>>>> $ref: /schemas/types.yaml#/definitions/string
>>>> pattern: "^[A-Za-z0-9]{4}$"
>>>>
>>>> description:
>>>> The SMC FourCC key of the desired sensor. Must match the
>>>> node's suffix.
>>>>
>>>> label:
>>>> description: Human-readable name for the sensor
>>>>
>>>> required:
>>>> - apple,key-id
>>>> - label
>>>>
>>>> Though in general, 'label' should never be required being just for human
>>>> convenience.
>>>
>>> That does not sound as it would be compatible with skipping nodes in the
>>> driver if the node misses label. The driver could of course fall back
>>> to create a hwmon sensors without labels.
>>
>> The driver absolutely should.
>
> The original submission (and our downstream version) do this, but I changed
> it for v2 per Sven's feedback [1]. Outside of development/experimentation,
> we will (should) never have a sensor in the Devicetree of uknown utility.
> If we know what a sensor is for, then we should have a label for it.
>

Label attributes are optional in hwmon drivers. Period.

Guenter