[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d8363b4-e817-40f1-9265-16018b14497c@linaro.org>
Date: Thu, 4 Jul 2024 11:49:23 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Petar Stoykov <pd.pstoykov@...il.com>
Cc: linux-iio@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/3] iio: pressure: Add driver for Sensirion SDP500
On 04/07/2024 09:49, Petar Stoykov wrote:
> On Tue, Jul 2, 2024 at 5:17 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@...aro.org> wrote:
>>
>> On 02/07/2024 16:59, Petar Stoykov via B4 Relay wrote:
>>> From: Petar Stoykov <pd.pstoykov@...il.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
Powered by blists - more mailing lists