linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <noname.nuno@gmail.com>,
	jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org,
	robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org
Cc: linux-iio@vger.kernel.org, s32@nxp.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	chester62515@gmail.com, mbrugger@suse.com,
	ghennadi.procopciuc@oss.nxp.com
Subject: Re: [PATCH v1 2/2] iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
Date: Mon, 8 Sep 2025 14:16:17 +0200	[thread overview]
Message-ID: <fd4c81a5-3b99-448c-92d4-9465f0e76db3@linaro.org> (raw)
In-Reply-To: <e5e76789-c8d9-463c-aa01-f2c6ae718f74@baylibre.com>

On 05/09/2025 23:54, David Lechner wrote:
> On 9/5/25 3:58 PM, Daniel Lezcano wrote:
>> On 05/09/2025 17:25, David Lechner wrote:
>>> On 9/5/25 4:44 AM, Daniel Lezcano wrote:
>>>> On 04/09/2025 19:49, David Lechner wrote:
>>>>> On 9/4/25 12:40 PM, Daniel Lezcano wrote:
>>
>> [ ... ]
>>
>>> Taking a step back, what sort of real-world uses cases do you need to support?
>>> Or are you just trying to implement everything that the ADC can do? The latter
>>> can be a bit risky because you might end making something where you can't do
>>> a buffered read and a single channel read at the same time, but later find out
>>> you have a real-world application that needs to do this.
>>>
>>> It looks like it would be possible to implement buffered reads in lots of ways.
>>> IIO devices can have more than one buffer per device so we can add more in the
>>> future if we need to. So I would just drop the DMA part of the implementation
>>> for now and implement the basic triggered buffer using MCR[NSTART] and ECH
>>> (End of Chain) interrupt request and just reading data from the ICDR registers.
>>>
>>> I would wait to have a real-world application that requires DMA to decide the
>>> best way to implement that. There are lots of possibilities, like does it need
>>> an external trigger or is continuous mode good enough? Does it need to be cyclic
>>> (something the IIO subsystem doesn't really support yet) or not. Is exact sample
>>> timing important or do we just need a big buffer? These questions we can't
>>> really answer without a specific application to use it.
>>
>> In the case of this IP, the use cases are in the automotive context. The system running on the APU is supposed to monitor at high rate (or not) the different channels which can be connected to any device the integrator choose to use.
>>
>> For this reason, the driver should be able to support the different modes because the integrator of the car computer can decide to monitor the devices connected to the different channels differently.
>>
>> Said differently, we need these modes because the capture depends on what the integrator decide to connect to the different channels.
> ...
>> We just know all these use cases exist.


The submitted driver supports the three modes.

Nuno asked to use the IIO dma engine API.

However there is few information and examples with the API and I failed 
to use the devm_iio_dmaengine_buffer_setup_with_handle() function.

AFAICT, devm_iio_dmaengine_buffer_setup_ext() can not be used because 
dma_slave_config() is not called, thus the src_addr is not set.

Is there any example somewhere, documentation or guidance to use the API?

Thanks

   -- Daniel


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2025-09-08 12:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03 10:27 [PATCH v1 0/2] NXP SAR ADC IIO driver for s32g2/3 platforms Daniel Lezcano
2025-09-03 10:27 ` [PATCH v1 1/2] dt-bindings: iio: adc: Add the NXP SAR ADC " Daniel Lezcano
2025-09-03 21:52   ` Rob Herring (Arm)
2025-09-04 19:47   ` David Lechner
2025-09-06  7:29   ` Krzysztof Kozlowski
2025-09-03 10:27 ` [PATCH v1 2/2] iio: adc: Add the NXP SAR ADC support for the " Daniel Lezcano
2025-09-03 11:20   ` Nuno Sá
2025-09-03 14:53     ` Daniel Lezcano
2025-09-03 15:41     ` Jonathan Cameron
2025-09-04 17:40     ` Daniel Lezcano
2025-09-04 17:49       ` David Lechner
2025-09-05  9:44         ` Daniel Lezcano
2025-09-05 15:25           ` David Lechner
2025-09-05 20:58             ` Daniel Lezcano
2025-09-05 21:54               ` David Lechner
2025-09-08 12:16                 ` Daniel Lezcano [this message]
2025-09-08 13:58                   ` David Lechner
2025-09-09  9:29                     ` Nuno Sá
2025-09-09 16:22                       ` Daniel Lezcano
2025-09-10 11:57                         ` Nuno Sá
2025-09-10 16:21                           ` Jonathan Cameron
2025-09-03 11:48   ` Andy Shevchenko
2025-09-03 15:28     ` Daniel Lezcano
2025-09-04  7:33       ` Andy Shevchenko
2025-09-04 16:52         ` Daniel Lezcano
2025-09-09  9:04         ` Daniel Lezcano
2025-09-06  7:34   ` Krzysztof Kozlowski

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=fd4c81a5-3b99-448c-92d4-9465f0e76db3@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=andy@kernel.org \
    --cc=chester62515@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=ghennadi.procopciuc@oss.nxp.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=noname.nuno@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=s32@nxp.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;
as well as URLs for NNTP newsgroup(s).