Re: [RFC PATCH v3 3/5] iio: buffer: Extend DMAengine buffer interfaces to take extra sysfs attributes

From: David Lechner

Date: Fri Jun 19 2026 - 10:20:02 EST


On 6/19/26 8:57 AM, Marcelo Schmitt wrote:
> On 06/18, Nuno Sá wrote:
>> On Wed, Jun 17, 2026 at 04:43:18PM -0500, David Lechner wrote:
>>> On 6/16/26 9:03 PM, Marcelo Schmitt wrote:
>>>> Some devices using DMAengine buffers are connected to extra hardware that
>>>> allows setting how fast data is transferred to/from the buffer. However,
>>>> those extra pieces of harwdware are external to the sensor chip such that
>>>> supporting the transfer speed as a sensor property is a bit of an
>>>> inaccuracy. Expand IIO DMAengine buffer interfaces to take arguments for
>>>> extra sysfs attributes, enabling the transfer speed to be configured
>>>> through the buffer interface.
>>>
>>> This message is a bit confusing. It sounds like it is attempting to
>>> control something about the DMA controller itself. But based on the
>>> later patches, it looks like this is just so we can add arbitrary
>>> sysfs attributes to the bufferX directory. And in this specific case,
>>> a sampling_frequency attribute.
>>
>> Agreed. Seems like rate control comes from the buffer.
>
> For this series, that was the actual result. Since we already have extra
> sysfs attributes for kfifo and for triggered buffers, I thought of trying it
> wish DMAengine buffers as well. The intent is to decouple the sampling frequency
> sysfs attributes (which depend on SPI offload and PWM availability) from the ADC
> IIO device. And the reason for that is to avoid making the device driver
> directly select SPI_OFFLOAD and/or depend on PWM because these devices can be
> used without offloading.
>
Selecting SPI_OFFLOAD when it isn't needed isn't a big deal IMHO, it just isn't
very much code at all. And PWM is quite common for fans and backlights, so it
seems like it would be rare to have a system that didn't have PWM enabled for
something else already. So it just seems like extra work to me to try to make
things optional when it may never be needed in practice.