mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Petar Stoykov <pd.pstoykov@gmail.com>
Cc: linux-iio@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>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] iio: pressure: Add driver for Sensirion SDP500
Date: Thu, 4 Jul 2024 11:49:23 +0200	[thread overview]
Message-ID: <8d8363b4-e817-40f1-9265-16018b14497c@linaro.org> (raw)
In-Reply-To: <CADFWO8FF24UyoD9cfF5NL1OzcHErx8+=bJYLrajrJNHFseK2HQ@mail.gmail.com>

On 04/07/2024 09:49, Petar Stoykov wrote:
> On Tue, Jul 2, 2024 at 5:17 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 02/07/2024 16:59, Petar Stoykov via B4 Relay wrote:
>>> From: Petar Stoykov <pd.pstoykov@gmail.com>
>>>
>>> Sensirion SDP500 is a digital differential pressure sensor. The sensor is
>>> accessed over I2C.
>>>
>>
>> ...
>>
>>> +
>>> +static const struct of_device_id sdp500_of_match[] = {
>>> +     { .compatible = "sensirion,sdp500" },
>>> +     { .compatible = "sensirion,sdp510" },
>>
>> Devices look compatible, so express it in the bindings with fallback to
>> sdp500 (oneOf, see example-schema).
> 
> Hi Krzysztof,
> I tried to understand the explanation in the example-schema. I must say it is
> a bit confusing, but I can't offer improvement because I'm not sure I
> understand it fully yet.
> Can you verify if this is what you expect the bindings file to read?
> properties:
>   compatible:
>     oneOf:
>       - items:
>         - const: sensirion,sdp510
>         - const: sensirion,sdp500
>       - items:
>         - const: sensirion,sdp500

Almost.

    oneOf:
      - items:
          - const: sensirion,sdp510
          - const: sensirion,sdp500
      - const: sensirion,sdp500

> 
> So the device tree should have either this
>   compatible = "sensirion,sdp510", "sensirion,sdp500"
> Or
>   compatible = "sensirion,sdp500"
> The first would mean that 510 falls back to 500, right?

Yes

> 
> From what I've seen it is rare to have two strings in "compatible" so I didn't

Rare? It's everywhere in SoC and in many places for standalone
devices/hardware.

> know of this mechanism of "fallback" in the dts. I expected to just write the
> name of my device (let's say "sensirion,sdp510") and the driver would handle it.
> But I'm learning. Expectations change.



Best regards,
Krzysztof


  reply	other threads:[~2024-07-04  9:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02 14:59 [PATCH v3 0/3] Add support " Petar Stoykov via B4 Relay
2024-07-02 14:59 ` [PATCH v3 1/3] dt-bindings: iio: pressure: Add " Petar Stoykov via B4 Relay
2024-07-02 15:15   ` Krzysztof Kozlowski
2024-07-04  8:18     ` Petar Stoykov
2024-07-04  9:47       ` Krzysztof Kozlowski
2024-07-02 16:30   ` Rob Herring (Arm)
2024-07-04  8:38     ` Petar Stoykov
2024-07-02 20:18   ` Jonathan Cameron
2024-07-04  8:35     ` Petar Stoykov
2024-07-07 15:30       ` Jonathan Cameron
2024-07-02 14:59 ` [PATCH v3 2/3] iio: pressure: Add driver for " Petar Stoykov via B4 Relay
2024-07-02 15:17   ` Krzysztof Kozlowski
2024-07-04  7:49     ` Petar Stoykov
2024-07-04  9:49       ` Krzysztof Kozlowski [this message]
2024-07-02 20:16   ` Jonathan Cameron
2024-07-04  8:09     ` Petar Stoykov
2024-07-07 15:34       ` Jonathan Cameron
2024-08-09 15:28   ` Andy Shevchenko
2024-07-02 14:59 ` [PATCH v3 3/3] MAINTAINERS: Add " Petar Stoykov via B4 Relay
2024-07-02 15:15   ` Krzysztof Kozlowski
2024-07-04  7:39     ` Petar Stoykov
2024-07-02 17:55   ` 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=8d8363b4-e817-40f1-9265-16018b14497c@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=conor+dt@kernel.org \
    --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=pd.pstoykov@gmail.com \
    --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®