mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Andreas Klinger <ak@it-klinger.de>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Angel Iglesias <ang.iglesiasg@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] dt-bindings: iio: pressure: Support Honeywell mpr sensors
Date: Fri, 14 Apr 2023 09:52:39 +0200	[thread overview]
Message-ID: <7f2716c6-ea0c-d55b-490c-7fe0e0a14c65@linaro.org> (raw)
In-Reply-To: <ZDkAYZV9z6cKCZQo@arbad>

On 14/04/2023 09:27, Andreas Klinger wrote:
> Hi Krzysztof,
> 
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> schrieb am Sa, 01. Apr 11:42:
>> On 01/04/2023 11:09, Andreas Klinger wrote:
>>> Honeywell mpr is a pressure sensor family. There are many different
>>> types with different pressure ranges. The range needs to be set up in
>>> the dt. Therefore new properties honeywell,pmin and honeywell,pmax are
>>> introduced.
>>>
>>> Add dt-bindings.
>>>
>>> Signed-off-by: Andreas Klinger <ak@it-klinger.de>
>>> ---
>>>  .../bindings/iio/pressure/honeywell,mpr.yaml  | 74 +++++++++++++++++++
>>>  1 file changed, 74 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/iio/pressure/honeywell,mpr.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/pressure/honeywell,mpr.yaml b/Documentation/devicetree/bindings/iio/pressure/honeywell,mpr.yaml
>>> new file mode 100644
>>> index 000000000000..d6fad6f841cf
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/iio/pressure/honeywell,mpr.yaml
>>> @@ -0,0 +1,74 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/iio/pressure/honeywell,mpr.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Honeywell mpr pressure sensor
>>> +
>>> +maintainers:
>>> +  - Andreas Klinger <ak@it-klinger.de>
>>> +
>>> +description: |
>>> +  Honeywell pressure sensor of type mpr. This sensor has an I2C and SPI interface. Only the I2C
>>
>> Doesn't look wrapped according to Linux coding style (see Coding style).
>>
>>> +  interface is implemented.
>>> +
>>> +  There are many subtypes with different pressure ranges available. Therefore the minimum and
>>> +  maximum pressure values of the specific sensor needs to be specified in Pascal.
>>> +
>>> +  Specifications about the devices can be found at:
>>> +    https://prod-edam.honeywell.com/content/dam/honeywell-edam/sps/siot/en-us/products/sensors/  \
>>> +      pressure-sensors/board-mount-pressure-sensors/micropressure-mpr-series/documents/          \
>>> +      sps-siot-mpr-series-datasheet-32332628-ciid-172626.pdf
>>
>> Lines are not continued, so drop \
>>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: honeywell,mpr
>>
>> You need device specific compatible, not some generic one. Rename also
>> then the filename (should match the compatible).
>>
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  interrupts:
>>> +    maxItems: 1
>>> +
>>> +  reset-gpios:
>>> +    description:
>>> +      Optional GPIO for resetting the device. If not present the device is not resetted.
>>
>> Are you sure it is wrapped properly?
>>
>>> +    maxItems: 1
>>> +
>>> +  honeywell,pmin:
>>> +    description:
>>> +      Minimum pressure value the sensor can measure in pascal.
>>
>> Use standard unit suffix:
>> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
> 
> There are only kilopascal as standard unit suffix. But with kilopascal as
> integer the accuracy of the driver is very rough. Therefore I would like to use
> pascal. E. g.:
> 
> honeywell,pmin-pascal
> 
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>> +
>>> +  honeywell,pmax:
>>> +    description:
>>> +      Maximum pressure value the sensor can measure in pascal.
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>
>> Same.
>>
>> Why these values are suitable for DT?
> 
> Technically from the software perspective the sensors are identical with the
> only difference of having different pressure ranges, measurement units and
> transfer functions.
> 
> If we omit the pressure values and transfer function we'll need 96 compatibles
> and also 96 I2C ids.

Compatibles are expected to be specific. You used something generic, so
not correct, although I understand the reason behind.

If we go with generic compatible, do you guarantee that all Honeywell
mpr sensors - now and in 50 years - will be 100% compatible with this
set here?

Your description calls it "type mpr", not "model mpr", so I assume you
can have entirely different sensors coming soon which will not be
compatible.

> 
> But there are also custom sensor types. For covering them we'll need another
> compatible and just for this case the pressure values and transfer function.

OK, but isn't this the case in all devices? I could accept family of
identical devices with identical programming model where difference in
supported measurement range is described via this property.

Unfortunately you did not model it that way. Instead it represents all
possible devices even with incompatible programming model.

Best regards,
Krzysztof


  reply	other threads:[~2023-04-14  7:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01  9:09 Andreas Klinger
2023-04-01  9:42 ` Krzysztof Kozlowski
2023-04-01 15:27   ` Jonathan Cameron
2023-04-06 20:15     ` Andreas Klinger
2023-04-07  6:45       ` Krzysztof Kozlowski
2023-04-14  7:27   ` Andreas Klinger
2023-04-14  7:52     ` Krzysztof Kozlowski [this message]
2023-04-01 15:22 ` Jonathan Cameron
2023-04-01  9:10 [PATCH 2/3] iio: pressure: Honeywell mpr pressure sensor Andreas Klinger
2023-04-01 12:05 ` kernel test robot
2023-04-01 17:57 ` Jonathan Cameron
2023-04-06 19:43   ` Andreas Klinger
2023-04-08 11:29     ` Jonathan Cameron
2023-04-01 18:29 ` Lars-Peter Clausen
2023-04-02  3:02 ` kernel test robot

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=7f2716c6-ea0c-d55b-490c-7fe0e0a14c65@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=ak@it-klinger.de \
    --cc=ang.iglesiasg@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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

all inboxes | Powered by JetHome®