From: "Ceclan, Dumitru" <mitrutzceclan@gmail.com>
To: "Nuno Sá" <noname.nuno@gmail.com>, "Conor Dooley" <conor@kernel.org>
Cc: dumitru.ceclan@analog.com, Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
David Lechner <dlechner@baylibre.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/6] dt-bindings: adc: ad7173: add support for ad411x
Date: Thu, 30 May 2024 14:55:00 +0300 [thread overview]
Message-ID: <17280af8-186d-47f1-a0c3-368f39e7c76a@gmail.com> (raw)
In-Reply-To: <e0be3356bf809035963c4801f05b9db2675c111e.camel@gmail.com>
On 30/05/2024 10:50, Nuno Sá wrote:
> On Wed, 2024-05-29 at 17:04 +0100, Conor Dooley wrote:
>> On Wed, May 29, 2024 at 04:38:53PM +0300, Ceclan, Dumitru wrote:
>>> On 28/05/2024 20:52, Conor Dooley wrote:
>>>> On Tue, May 28, 2024 at 03:16:07PM +0300, Ceclan, Dumitru wrote:
>>>>> On 27/05/2024 20:48, Conor Dooley wrote:
>>>>>> On Mon, May 27, 2024 at 08:02:34PM +0300, Dumitru Ceclan via B4 Relay
>>>>>> wrote:
>>>>>>> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
>>>>>>> + adi,channel-type:
>>>>>>> + description:
>>>>>>> + Used to differentiate between different channel types as the
>>>>>>> device
>>>>>>> + register configurations are the same for all usage types.
>>>>>>> + Both pseudo-differential and single-ended channels will use
>>>>>>> the
>>>>>>> + single-ended specifier.
>>>>>>> + $ref: /schemas/types.yaml#/definitions/string
>>>>>>> + enum:
>>>>>>> + - single-ended
>>>>>>> + - differential
>>>>>>> + default: differential
>>>>>>
>>>>>> I dunno if my brain just ain't workin' right today, or if this is not
>>>>>> sufficiently explained, but why is this property needed? You've got
>>>>>> diff-channels and single-channels already, why can you not infer the
>>>>>> information you need from them? What should software do with this
>>>>>> information?
>>>>>> Additionally, "pseudo-differential" is not explained in this binding.
>>>>>
>>>>> In previous thread we arrived to the conclusion single-ended and
>>>>> pseudo-differential channels should be marked with the flag
>>>>> "differential=false" in the IIO channel struct. This cannot
>>>>> really be inferred as any input pair could be used in that
>>>>> manner and the only difference would be in external wiring.
>>>>>
>>>>> Single-channels cannot be used to define such a channel as
>>>>> two voltage inputs need to be selected. Also, we are already
>>>>> using single-channel to define the current channels.
>>>>
>>>> If I understand correctly, the property could be simplified to a flag
>>>> then, since it's only the pseudo differential mode that you cannot be
>>>> sure of?
>>>> You know when you're single-ended based on single-channel, so the
>>>> additional info you need is only in the pseudo-differential case.
>>>>
>>> Yes, it could just be a boolean flag. The only thing I have against
>>> that is the awkwardness of having both diff-channels and
>>> differential=false within a channel definition.
>>
>> What I was suggesting was more like "adi,pseudo-differential" (you don't
>> need to set the =false or w/e, flag properties work based on present/not
>> present). I think that would avoid the awkwardness?
>>
>
> Yeah, that was also my understanding of your reply... But I think you're also
> mentioning to have this flag together with the single-channel property?
>
> I'm a bit confused because it seems to me that single-channel only gets one input
> while we need to select two for pseudo-differential/single-ended. Is this correct
> Dumitru?
>
Yes, that is correct.
> FWIW, I think we already have that awkwardness in the current form. If I'm not
> missing anything, what we have in the driver is pretty much:
>
> if (not diff && single-channel)
> // then current channel
> else
> // relies on the channel-type stuff
>
> So, effectively with the above we have
>
> diff-channels = <1 0>;
>
> but then wait, not so fast
>
This comment properly and comically describes the hot mess
that I've come up with :)))
> adi,channel-type = "single-ended"
>
> To me the above is equally awkward (not sure if there's any precedence in using diff-
> channels like this though)...
>
> I would like for this to be explicit... If we have diff-channels, then it's surely
> differential.
>
> If not we could use the single-channel property and instead of using an extra flag we
> could make the property having either 1 or 2 items. If we have 1, then it's a current
> channel. If we have 2, then it's voltage single-ended/pseudo-differential.
>
> David's suggestion is also pretty good (and I like it's more explicit about what's
> going on) so I would likely go with it...
>
> - Nuno Sá
>
>
Yup, as neat as it could be, I'll do it that way.
next prev parent reply other threads:[~2024-05-30 11:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 17:02 [PATCH v3 0/6] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-05-27 17:02 ` [PATCH v3 1/6] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-05-27 17:48 ` Conor Dooley
2024-05-28 12:16 ` Ceclan, Dumitru
2024-05-28 17:52 ` Conor Dooley
2024-05-29 13:38 ` Ceclan, Dumitru
2024-05-29 16:04 ` Conor Dooley
2024-05-30 7:50 ` Nuno Sá
2024-05-30 11:55 ` Ceclan, Dumitru [this message]
2024-05-29 22:04 ` David Lechner
2024-05-30 7:12 ` Nuno Sá
2024-05-27 17:02 ` [PATCH v3 2/6] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-05-29 12:24 ` Nuno Sá
2024-05-27 17:02 ` [PATCH v3 3/6] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-05-29 12:27 ` Nuno Sá
2024-05-29 12:49 ` Nuno Sá
2024-05-30 14:45 ` Ceclan, Dumitru
2024-05-31 7:10 ` Nuno Sá
2024-06-01 18:40 ` Jonathan Cameron
2024-05-27 17:02 ` [PATCH v3 4/6] iio: adc: ad7173: add support for special inputs Dumitru Ceclan via B4 Relay
2024-05-29 12:29 ` Nuno Sá
2024-05-27 17:02 ` [PATCH v3 5/6] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-05-29 12:46 ` Nuno Sá
2024-05-29 14:03 ` Ceclan, Dumitru
2024-05-29 20:59 ` David Lechner
2024-05-30 6:19 ` Nuno Sá
2024-06-01 18:43 ` Jonathan Cameron
2024-05-27 17:02 ` [PATCH v3 6/6] iio: adc: ad7173: Reduce device info struct size Dumitru Ceclan via B4 Relay
2024-05-29 12:23 ` Nuno Sá
2024-05-29 20:32 ` David Lechner
2024-05-30 6:17 ` Nuno Sá
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=17280af8-186d-47f1-a0c3-368f39e7c76a@gmail.com \
--to=mitrutzceclan@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=dumitru.ceclan@analog.com \
--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=noname.nuno@gmail.com \
--cc=robh@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;
as well as URLs for NNTP newsgroup(s).