From: David Lechner <dlechner@baylibre.com>
To: "Tomas Melin" <tomas.melin@vaisala.com>,
"Nuno Sá" <noname.nuno@gmail.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sa" <nuno.sa@analog.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Jonathan Cameron" <jic23@kernel.org>,
"Andy Shevchenko" <andy@kernel.org>,
"Olivier Moysan" <olivier.moysan@foss.st.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/4] iio: industrialio-backend: support backend capabilities
Date: Tue, 3 Feb 2026 19:07:35 -0600 [thread overview]
Message-ID: <c9a5b1b3-760e-4d55-b058-e461507fcad0@baylibre.com> (raw)
In-Reply-To: <e9f9e1b0-4cd7-4d6c-a7b9-25ea0e6e774a@vaisala.com>
On 2/3/26 3:50 AM, Tomas Melin wrote:
> Hi,
>
> On 02/02/2026 17:50, David Lechner wrote:
>> On 2/2/26 7:04 AM, Tomas Melin wrote:
>>> Hi,
>>>
>>> On 02/02/2026 14:40, Nuno Sá wrote:
>>>> On Mon, 2026-02-02 at 13:08 +0200, Tomas Melin wrote:
>>>>> Hi,
>>>>>
>>>>> On 02/02/2026 12:28, Nuno Sá wrote:
>>>>>> On Sat, 2026-01-31 at 14:30 -0600, David Lechner wrote:
>>>>>
>>>>>>>
>>>>>>> Do we actually need this one? Alternative could be, for example:
>>>>>>>
>>>>>>> int iio_backend_enable(struct iio_backend *back)
>>>>>>> {
>>>>>>> int ret;
>>>>>>>
>>>>>>> ret = iio_backend_op_call(back, enable);
>>>>>>>
>>>>>>> return ret == -EOPNOTSUPP ? 0 : ret;
>>>>>>> }
>>>>>>
>>>>>> I would prefer not to assume we can ignore the backend not supporting
>>>>>> the call. It opens up the question for other operations.
>>>>>>
>>>>>> My preferred way for this kind of fundamental operation (enabling/disabling)
>>>>>> would be to check with DT maintainers if we could have some kind of fixed-backend
>>>>>> (fixed in the sense the HW is present but not controlled by Linux) dummy device that
>>>>>> with implement a no-OP enable/disable().
>>>>>
>>>>> There is also use cases for the always_on cap with a configurable
>>>>> non-dummy backend. Some applications are such that the driver should
>>>>> leave the enabling/disabling up to the user space consuming the data.
>>>>> For this case it's great to have the frontend leave the backend enable
>>>>> alone using this capability.
>>>>>
>>>>
>>>> I would argue the above would be something to take care at the frontend level. The way
>>>> I see it, the always_on cap is pretty much saying that we can't really control the on/off state
>>>> of the backing device and we just assume it's on.
>>>>
>>>> If we can control it but we need it always on (for some specific usecase), I would say that should
>>>> be handled at the frontend and just enable the backend once. Also note that as of now, I think all
>>>> of the users (or most at least) we have just enable the backend during probe and leave it on until
>>>> we unbind the device.
>>>
>>> Yes, this is debatable. It's not necessarily always on, but should not
>>> be enabled/touched by the frontend during probe.
>>> But anyways, having a capability that says if the enable/disable feature
>>> is available, is in any case useful and what I was planning on
>>> leveraging in my use case.
>>> Fundamentally, with the capabilites as now proposed, it is possible to
>>> select what features of the ad9467 are available, in addition to the
>>> basic requirements.
>>>
>>> The ALWAYS_ON capability could be inverted, like CAP_HAS_ENABLE_DISABLE,
>>> but to me, the ALWAYS_ON naming still seems the better option.
>>>
>>
>> Ah, this is what Jonathan mentioned before about this really being a
>> restriction rather than a capability.
>>
>> Perhaps we should have a separate restrictions/quirks flag? If the flag
>> means "do not enable during probe" then a better name would be
>> *_DO_NOT_ENABLE_AT_PROBE.
>>
>> And I agree with Nuno that if the backend can be enabled/disabled later
>> (after probe), it should still be managed through the frontend driver.
>> There should be no usespace access directly to the backend without going
>> through the frontend.
>
> Thanks for the input, that use case is slightly different from normal
> usage, let's keep it in mind if actually required. For now, the option
> to just leave the enable/disable alone is what would help to solve
> smooth integration with this device for me.
>
> ALWAYS_ON does not seem to get much votes here, but how about calling it
> something like IIO_BACKEND_CAP_AUTO_ENABLE or
> IIO_BACKEND_CAP_HAS_ENABLE_DISABLE?
>
IIO_BACKEND_CAP_HAS_ENABLE_DISABLE seems the most sensible given the
way it is used in the ad9467 patch. Although IIO_BACKEND_CAP_ENABLE_DISABLE
would be more consistent with the other flags being added since they
don't say _HAS_.
Probably IIO_BACKEND_CAP_ENABLE is enough to imply both if we want
to keep it shorter.
next prev parent reply other threads:[~2026-02-04 1:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 9:16 [PATCH v5 0/4] iio: adc: ad9467: Support alternative backends Tomas Melin
2026-01-30 9:16 ` [PATCH v5 1/4] iio: industrialio-backend: support backend capabilities Tomas Melin
2026-01-31 20:30 ` David Lechner
2026-02-02 10:28 ` Nuno Sá
2026-02-02 11:08 ` Tomas Melin
2026-02-02 12:40 ` Nuno Sá
2026-02-02 13:04 ` Tomas Melin
2026-02-02 15:50 ` David Lechner
2026-02-03 9:50 ` Tomas Melin
2026-02-04 1:07 ` David Lechner [this message]
2026-02-04 11:15 ` Tomas Melin
2026-02-03 10:01 ` Nuno Sá
2026-02-03 10:45 ` Tomas Melin
2026-02-02 10:58 ` Tomas Melin
2026-02-02 15:17 ` David Lechner
2026-01-30 9:17 ` [PATCH v5 2/4] iio: adc: adi-axi-adc: define supported iio-backend capabilities Tomas Melin
2026-02-02 10:33 ` Nuno Sá
2026-01-30 9:17 ` [PATCH v5 3/4] iio: dac: adi-axi-dac: " Tomas Melin
2026-02-02 10:33 ` Nuno Sá
2026-01-30 9:17 ` [PATCH v5 4/4] iio: adc: ad9467: check for backend capabilities Tomas Melin
2026-01-31 20:40 ` David Lechner
2026-02-02 11:18 ` Tomas Melin
2026-02-02 10:42 ` Nuno Sá
2026-02-02 12:03 ` Tomas Melin
2026-02-03 9:51 ` 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=c9a5b1b3-760e-4d55-b058-e461507fcad0@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noname.nuno@gmail.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=tomas.melin@vaisala.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
all inboxes | Powered by JetHome®