devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Slawomir Stepien <sst@poczta.fm>
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	jdelvare@suse.com, linux@roeck-us.net, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, przemyslaw.cencner@nokia.com,
	krzysztof.adamski@nokia.com, alexander.sverdlin@nokia.com,
	Slawomir Stepien <slawomir.stepien@nokia.com>
Subject: Re: [PATCH 3/8] dt-bindings: hwmon: Allow specifying channels for lm90
Date: Fri, 20 May 2022 15:34:58 +0200	[thread overview]
Message-ID: <a3e0fb6b-064a-c0a5-2189-488c6f19cb96@linaro.org> (raw)
In-Reply-To: <YoeWXEb+iNIpFZVR@t480s.localdomain>

On 20/05/2022 15:23, Slawomir Stepien wrote:
>>>>>  
>>>>> +patternProperties:
>>>>
>>>> Which models use this?
>>>
>>> This is used in tmp421 model.
>>
>> Then please add allOf:if:then disallowing the property for other models.
> 
> A misunderstanding. The channel node can be used by every device supported by lm90. At least each
> channel of each device can have label.

OK

> 
>>>>> +  "^channel@([0-2])$":
>>>>> +    type: object
>>>>> +    description: |
>>>>
>>>> No need for |
>>>
>>> Will fix in v2.
>>>
>>>>> +      Represents channels of the device and their specific configuration.
>>>>> +
>>>>> +    properties:
>>>>> +      reg:
>>>>> +        description: |
>>>>
>>>> The same.
>>>
>>> Will fix in v2.
>>>
>>>>> +          The channel number. 0 is local channel, 1-2 are remote channels.
>>>>> +        items:
>>>>> +          minimum: 0
>>>>> +          maximum: 2
>>>>> +
>>>>> +      label:
>>>>> +        description: |
>>>>
>>>> The same.
>>>
>>> Will fix in v2.
>>>
>>>>> +          A descriptive name for this channel, like "ambient" or "psu".
>>>>> +
>>>>> +      offset:
>>>>> +        description: |
>>>>
>>>> This does not look like standard property, so you need vendor and unit
>>>> suffix.
>>>
>>> Currently in lm90 we have support for devices that have different width (including sign) for offset
>>> register. We have 10 bits, 11 bits and 12 bits. Do I understand correctly that I can use the same
>>> vendor prefix if the width is the same? Just like "ti" was used for adi and ti in
>>> "ti,extended-range-enable"?
>>>
>>> For example:
>>>
>>> adi,10-bit-offset-millicelsius # (only for adt7481)
>>> adi,11-bit-offset-millicelsius # (for adt7461 but also for lm90 and others)
>>> ti,12-bit-offset-millicelsius  # (ti - since only tmp451 and tmp461 supports 12 bit)
>>
>> Wait, these are then strictly per-compatible, so there is no sense in DT
>> property at all.
> 
> But isn't the value of offset a hardware-design-time calculation? So if I have a piece of
> hardware that describes itself using device-tree, then offset information should be stored on the
> device-tree rather then be "calculated" by the software running on that piece of hardware?
> 
> And what if such piece of hardware has been changed (e.g. new PCB version) and now the offset are
> different? Then if device-tree is on hardware (e.g. on EEPROM) with new offsets, then software would
> not require a change to support this new hardware version.

OK, I misunderstood.

This should be only one property then, choose some reasonable vendor,
and in allOf:if:then you can put constraints about minimum/maximum
values per model.

Best regards,
Krzysztof

  reply	other threads:[~2022-05-20 13:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  9:32 [PATCH 0/8] Add support for ADT7481 in lm90 Slawomir Stepien
2022-05-20  9:32 ` [PATCH 1/8] dt-bindings: hwmon: " Slawomir Stepien
2022-05-20 10:08   ` Krzysztof Kozlowski
2022-05-20  9:32 ` [PATCH 2/8] dt-bindings: hwmon: Add 'extended-range-enable' property support " Slawomir Stepien
2022-05-20 10:09   ` Krzysztof Kozlowski
2022-05-20 10:57     ` Slawomir Stepien
2022-05-20  9:32 ` [PATCH 3/8] dt-bindings: hwmon: Allow specifying channels for lm90 Slawomir Stepien
2022-05-20 10:13   ` Krzysztof Kozlowski
2022-05-20 12:38     ` Slawomir Stepien
2022-05-20 12:47       ` Krzysztof Kozlowski
2022-05-20 13:23         ` Slawomir Stepien
2022-05-20 13:34           ` Krzysztof Kozlowski [this message]
2022-05-20 14:02       ` Guenter Roeck
2022-05-20 13:42     ` Guenter Roeck
2022-05-20 14:09       ` Krzysztof Kozlowski
2022-05-20 14:22         ` Guenter Roeck
2022-05-24 11:53           ` Slawomir Stepien
2022-05-24 12:17             ` Slawomir Stepien
2022-05-24 17:27               ` Slawomir Stepien
2022-05-24 17:59                 ` Krzysztof Kozlowski
2022-05-25  7:07                   ` Slawomir Stepien
2022-05-20  9:32 ` [PATCH 4/8] hwmon: (lm90) add support for ADT7481 Slawomir Stepien
2022-05-20  9:32 ` [PATCH 5/8] hwmon: (lm90) define maximum number of channels that are supported Slawomir Stepien
2022-05-21  2:36   ` Guenter Roeck
2022-05-22 14:59     ` Slawomir Stepien
2022-05-20  9:32 ` [PATCH 6/8] hwmon: (lm90) enable the extended temperature range Slawomir Stepien
2022-05-20  9:32 ` [PATCH 7/8] hwmon: (lm90) read the channel's label from device-tree Slawomir Stepien
2022-05-20 10:15   ` Krzysztof Kozlowski
2022-05-20 11:01     ` Slawomir Stepien
2022-05-20 11:41       ` Krzysztof Kozlowski
2022-05-20  9:32 ` [PATCH 8/8] hwmon: (lm90) read the channel's offset " Slawomir Stepien
2022-05-20 13:45 ` [PATCH 0/8] Add support for ADT7481 in lm90 Guenter Roeck
2022-05-20 16:01   ` Guenter Roeck
2022-05-22 14:52     ` Slawomir Stepien
2022-05-22 15:00       ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3e0fb6b-064a-c0a5-2189-488c6f19cb96@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alexander.sverdlin@nokia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.adamski@nokia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=przemyslaw.cencner@nokia.com \
    --cc=robh+dt@kernel.org \
    --cc=slawomir.stepien@nokia.com \
    --cc=sst@poczta.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).