From: Jonathan Cameron <jic23@kernel.org>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "Nuno Sá" <noname.nuno@gmail.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: addac: ad74413: don't set DIN_SINK for functions other than digital input
Date: Sat, 6 May 2023 19:16:36 +0100 [thread overview]
Message-ID: <20230506191636.3cff4b24@jic23-huawei> (raw)
In-Reply-To: <6fcf4997-9d88-7e86-70f7-52f9d296bc6e@rasmusvillemoes.dk>
On Thu, 4 May 2023 12:08:53 +0200
Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
> On 04/05/2023 09.28, Nuno Sá wrote:
> > Hi Rasmus,
> >
>
> > So, I'm not really that familiar with this part and, at this stage, I'm being
> > lazy to check the datasheet.
>
> Well, the data sheet is not particularly helpful here, which is why I
> ended up with this mess.
>
> > My concern is about breaking some other users...
>
> I highly doubt there are users yet (other than my customer); this
> binding+driver implementation only just landed.
>
> > So, does it make any sense for having drive-strength-microamp in a non digital
> > input at all?
>
> That's the problem with the data sheet, it doesn't really say that the
> DIN_SINK register has any effect whatsoever when the channel function is
> set to something other than digital input (either flavor). Perhaps it
> does hint that setting it to something non-zero is probably not a good
> idea, because DIN_SINK is automatically set to 0 whenever the channel
> function is set/changed, so one needs a good reason to change DIN_SINK
> afterwards.
>
> We just experimentally found out that when we added the DIN_SINK to fix
> the digital input functions, when we got around to testing the
> resistance measurement function that ended up broken due to the non-zero
> DIN_SINK.
>
> > Can anyone have a working device by specifying that dt parameter
> > on a non digital channel (or expect something from having that parameter set)?
> > Or the only effect is to actually have some functions misbehaving?
>
> The data sheet doesn't say that the DIN_SINK should have any effect for
> other functions, so I'm pretty sure it's only the latter: some functions
> misbehave.
>
> > On the driver side, if it's never right to have
> > these settings together, then the patch is valid since if someone has this, his
> > configuration is broken anyways (maybe that's also a valid point for the
> > bindings)...
>
> Yes, I do believe that it's a broken description (whether or not the
> bindings specify that), and drivers don't need to go out of their way to
> validate or fixup such brokenness. But in this particular case, there's
> really no extra burden on the driver to not put garbage in DIN_SINK when
> a not-digital-input function has been chosen (the patch is a two-liner
> with 'git show -w').
If we can tighten the DT binding to rule out something that should not be
set than that would be good. Tightening bindings is fine - we don't mind
validation of bindings failing on peoples DTs as long as we didn't 'break'
them actually working.
Jonathan
>
> Rasmus
>
next prev parent reply other threads:[~2023-05-06 18:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 10:50 [PATCH] iio: addac: ad74413: don't set DIN_SINK for functions other than digital input Rasmus Villemoes
2023-05-04 7:28 ` Nuno Sá
2023-05-04 10:08 ` Rasmus Villemoes
2023-05-06 18:16 ` Jonathan Cameron [this message]
2023-05-22 8:44 ` Rasmus Villemoes
2023-05-28 19:13 ` Jonathan Cameron
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=20230506191636.3cff4b24@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=cosmin.tanislav@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=noname.nuno@gmail.com \
/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