From: "Nuno Sá" <noname.nuno@gmail.com>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>,
Nuno Sa <nuno.sa@analog.com>
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>
Subject: Re: [RFC PATCH 0/3] Add converter framework
Date: Thu, 31 Aug 2023 10:20:20 +0200 [thread overview]
Message-ID: <d4eead3eedb99e252f7c022ce5572a3a307b9b1e.camel@gmail.com> (raw)
In-Reply-To: <20230830172903.0000027f@Huawei.com>
On Wed, 2023-08-30 at 17:29 +0100, Jonathan Cameron wrote:
> On Fri, 4 Aug 2023 16:53:38 +0200
> Nuno Sa <nuno.sa@analog.com> wrote:
>
> > This is the initial RFC following the discussion in [1]. I'm aware this is
> > by no means ready for inclusion and it's not even compilable since in
> > the RFC I did not included the patch to add component_compare_fwnode()
> > and component_release_fwnode().
>
> Whilst I haven't read this through yet, I suspect Olivier will be able to
> offer some insight on some of this and likewise you may be able to
> point out pitfalls etc in his series (I see you did some review already :)
>
> https://lore.kernel.org/linux-iio/20230727150324.1157933-1-olivier.moysan@foss.st.com/
>
> Both are about multiple interacting components of an overall datapath.
> Whether there is commonality isn't yet clear to me.
>
I made a very general comment in that series but I need to look better at it. Not
sure if we can merge them together but let's see...
> >
> > The goal is to have a first feel on the
> > direction of the framework so that if I need to drastically change it,
> > better do it now. The RFC also brings the ad9647 and the axi_adc core to
> > the same functionality we have now upstream with one extra fundamental
> > feature that is calibrating the digital interface. This would be very
> > difficult to do with the current design. Note that I don't expect any
> > review on those drivers (rather than things related to the framework).
> >
> > I also want to bring up a couple of things that I've
> > been thinking that I'm yet not sure about (so some feedback might make
> > mind in one direction or another).
> >
> > 1) Im yet not sure if I should have different compatibles in the
> > axi-adc-core driver. Note this soft core is a generic core and for every
> > design (where the frontend device changes or has subtle changes like
> > different number of data paths) there are subtle changes. So, the number
> > of channels might be different, the available test patterns might be
> > different, some ops might be available for some designs but not for
> > others, etc...
>
> I don't suppose there is any chance Analog can make at least some of this
> discoverable from the hardware? Capability registers etc in the long
> run. Can't fix what is already out there.
>
Well, it is a soft core so my naive assumption is that it's doable if some HDL guy is
willing to implement it. But yes, it might get supported only for new designs.
> > With a different compatible we could fine tune
> > those differences (with a chip_info like structure) and pass some const
> > converter_config to the framework that would allow it to do more safety
> > checks and potentially reduce the number of converter_ops.
> > OTOH, starting to add all of these compatibles might become messy in the
> > long run and will likely mean that we'll always have to change both
> > drivers in order to support a new frontend. And the frontend devices
> > should really be the ones having all the "knowledge" to configure the
> > soft core even if it means more converter_ops (though devicetree might
> > help as some features are really HW dependent). I more inclined to just
> > leave things as-is in the RFC.
>
> I'm fine with putting this stuff in DT where possible.
>
> >
> > 2) There are some IIO attributes (like scale, frequency, etc) that might
> > be implemented in the soft cores. I still didn't made my mind if I should just
> > have a catch all read_raw() and write_raw() converter_ops or more fine
> > tuned ops. Having the catch all reduces the number of ops but also makes
> > it more easier to add stuff that ends up being not used anymore and then
> > forgotten. There are also cases (eg: setting sampling frequency) where
> > we might need to apply settings in both the frontend and the backend
> > devices which means having the catch all write_raw() would be more
> > awkward in these case. I'm a bit more inclined to the more specific ops.
>
> It's the kernel - we can always change the internal API later as long as we
> don't touch the user space part. Go with your gut feeling today and
> if it changes this sort of refactor usually isn't that bad.
>
Agreed...
>
- Nuno Sá
next prev parent reply other threads:[~2023-08-31 8:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 14:53 [RFC PATCH 0/3] Add converter framework Nuno Sa
2023-08-04 14:53 ` [RFC PATCH 1/3] iio: addac: add new " Nuno Sa
2023-08-30 17:02 ` Jonathan Cameron
2023-08-31 9:32 ` Nuno Sá
2023-09-03 10:56 ` Jonathan Cameron
2023-09-04 14:14 ` Nuno Sá
2023-09-04 15:31 ` Jonathan Cameron
2023-11-13 17:20 ` Olivier MOYSAN
2023-11-14 9:03 ` Nuno Sá
2023-11-16 15:42 ` Olivier MOYSAN
2023-08-04 14:53 ` [RFC PATCH 2/3] iio: adc: ad9647: add based on " Nuno Sa
2023-08-30 17:13 ` Jonathan Cameron
2023-08-04 14:53 ` [RFC PATCH 3/3] iio: adc: adi-axi-adc: add based on new " Nuno Sa
2023-08-30 17:15 ` Jonathan Cameron
2023-08-30 16:29 ` [RFC PATCH 0/3] Add " Jonathan Cameron
2023-08-30 16:30 ` Jonathan Cameron
2023-08-31 8:20 ` Nuno Sá [this message]
2023-08-31 9:28 ` Jonathan Cameron
2023-08-31 10:58 ` 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=d4eead3eedb99e252f7c022ce5572a3a307b9b1e.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.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