From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 786281A840A for ; Tue, 3 Feb 2026 10:00:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770112824; cv=none; b=f2/qIIdk/TXkQ1YMlDwpzFMtXgF3Hqoaqe2v7mZ9C7M0bdWrHU1ySPT88xTT3WGDYUFEarVF0U6mTZ96Vzvcd0j2xZzmENeR0wEQr7DnoSgfgVfi2RR60vqOxTg0IQ8ilsv7HrjxnoXa80655FerywOScKc7CfwProhZuWNix5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770112824; c=relaxed/simple; bh=iz24nR5NMqwSrDzIRWRtWHL14HbCI+xVTEpjTjZ3dg4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ErHPLuWdXIlFy7DSY1f86YDhBj+1/JnEpOz3pCJ5JSIn3pR1sOzoaZgWwcsp7s0uwrrII8rWKTs6sTM1jIowUBsvmiAD+oDzvMZnwaWqa4ZP3KcnJ+QNWUSl+cVB8drNSjkgtIQl0YZEH2ngxnla7S2tXOme/sul5QW59OKz3Do= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HivoMLZX; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HivoMLZX" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4805ef35864so46403685e9.0 for ; Tue, 03 Feb 2026 02:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770112821; x=1770717621; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=cyM4dj54s9l5Yb4t6lpV7sb0GJU5YCf0GHIh3AwADRQ=; b=HivoMLZXU/2cd2ozdOnYJAbcFiPy05C95HPXahmmCahf2h7mhlNoFIuYbKxvMFohzF Kwj6H1gRADlzqlGgGOrzEL8o2UsUXsoK6qCAK6YP99nDEHF5oldG1TLk4H4pQmUnjJ2q AunOfM8FKEkfB8t1t7Oh/I4MFZxMe+5yNatAqsFIxb6EMY+BcWmhFQARewlp4lEQYI86 lZzAPnDRG0wcGgYhr1OZFMo7Mcnccd2lDTj8EuCS2ut8BDNPpqO7HtII4dJgHqbHFa97 yp81mLMgmlB4RHtnwkCGMeetkQB3koFNj9aXF2ZZfsJQfd65fEsaeL42QLiIi0pY+EHp rd8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770112821; x=1770717621; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cyM4dj54s9l5Yb4t6lpV7sb0GJU5YCf0GHIh3AwADRQ=; b=xP91YTJ57Q/fmg+11dt4V40a6jIudiV2KU/ekirf7TSyxw5PCg6epj3COC3PARvRug UyfQMjx2BWIODyVfp0E4kuOtTSexq6iRK9B63GNJLTVv01aR5zhwn1wXAzVPX33G2Cst jOPq6GXLNiybZgmzSQtxE0sTm2voqM0lNDAJ/kjs99DoLi7myiA1nbY5t6CmVx9GEQ6i 1LCsTizwVd2pxMY+AQCoKfkmGsukIrzZMlmI9y5DLlOJnjJXPOw5V1/ZhwqtS7i+7KQY IONxf6hoCH5x4MlmrIs2FGIlhGLzuuDCQ+to4ZCTBtqoBaGcfGMFVe+Zpr+LK54eCBus n0ig== X-Forwarded-Encrypted: i=1; AJvYcCU9ugtHXjfAtUUDfwvW+vC6FscbKvh1Nlbv9bcJubFZXYoilObRP0/alGxF4g63HUjSB+Teks4t/MFaKtc=@vger.kernel.org X-Gm-Message-State: AOJu0YxH3oAK5X9cUaCpSFo9hP+RDzwXW3pWAZzzeoBuv5T46ikoUGK2 rsSCDFVuK56sP0ZtVYDlXJy5yr6QW298CxG6mN7AWgsQU68OC8suq1gC X-Gm-Gg: AZuq6aK2O2sJlCqE8tvLMUdNysYVS0gEN1Vno+eot0woMDGCdsihE7zGrnwRCe4xr+w c4Cx80w8cNnwOZv/hxNDnt8SvcNsuxx5/tAKHExJtTKEdoGmE41vqPnhRTnHVxWch3FZcJs2qda 7KSO2L12UZhCbmXRcbCDDqDrHmptG7E5WPGmTpLswJX9BG9N5s1wJKADGUsU0QXueOcTSIQJQxn LmLk/FuVxzVuKrkVT0Zzc5DVIMenOJni9n9xiy4I3TBqng1gxlJ7t9N84NA42QF3z2dfV5nDD9W 2srUBTnQ45LFDdAHbzVYDrYg7UsKWr34r8j2Uwwn6yzMED7k1V8f3qPrWej3Mf9LWzAdPP7KGtE 957bFKYDNso7rtLbcVJCjCLdTS0G78rSgChaCDMi5ohmFEOMtjpq4CETgd7jI/7X7CpWcyhpLKO oSLNbHVWJQZliv3gIslnj1qUqLhv3sMg== X-Received: by 2002:a05:6000:18a6:b0:435:b732:771b with SMTP id ffacd0b85a97d-435f3a7e7c7mr25504053f8f.20.1770112820708; Tue, 03 Feb 2026 02:00:20 -0800 (PST) Received: from [192.168.1.187] ([148.63.225.166]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e10e483asm49068216f8f.3.2026.02.03.02.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Feb 2026 02:00:20 -0800 (PST) Message-ID: Subject: Re: [PATCH v5 1/4] iio: industrialio-backend: support backend capabilities From: Nuno =?ISO-8859-1?Q?S=E1?= To: Tomas Melin , David Lechner , Michael Hennerich , Nuno Sa , Lars-Peter Clausen , Jonathan Cameron , Andy Shevchenko , Olivier Moysan Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 03 Feb 2026 10:01:03 +0000 In-Reply-To: References: <20260130-b4-ad9467-optional-backend-v5-0-7da803ba7326@vaisala.com> <20260130-b4-ad9467-optional-backend-v5-1-7da803ba7326@vaisala.com> <688cbfb1-0944-492a-929d-91ebb9ab22fb@baylibre.com> <812a8c408c2e3a87ebe1ddc983acdc2cebe3b36b.camel@gmail.com> <30cf63eb-50ba-445d-a78b-d6532aacdc8e@vaisala.com> <177d62446d9c2098bbfe8b0f7fd9418d5afb60fc.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2026-02-02 at 15:04 +0200, Tomas Melin wrote: > Hi, >=20 > On 02/02/2026 14:40, Nuno S=C3=A1 wrote: > > On Mon, 2026-02-02 at 13:08 +0200, Tomas Melin wrote: > > > Hi, > > >=20 > > > On 02/02/2026 12:28, Nuno S=C3=A1 wrote: > > > > On Sat, 2026-01-31 at 14:30 -0600, David Lechner wrote: > > >=20 > > > > >=20 > > > > > Do we actually need this one? Alternative could be, for example: > > > > >=20 > > > > > int iio_backend_enable(struct iio_backend *back) > > > > > { > > > > > int ret; > > > > >=20 > > > > > ret =3D iio_backend_op_call(back, enable); > > > > > =09 > > > > > return ret =3D=3D -EOPNOTSUPP ? 0 : ret; > > > > > } > > > >=20 > > > > I would prefer not to assume we can ignore the backend not supporti= ng > > > > the call. It opens up the question for other operations. > > > >=20 > > > > My preferred way for this kind of fundamental operation (enabling/d= isabling) > > > > 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(). > > >=20 > > > 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 enabl= e > > > alone using this capability. > > >=20 > >=20 > > 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.=C2=A0 > >=20 > > If we can control it but we need it always on (for some specific usecas= e), 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. >=20 > 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. Yeah but this is just tweaking for your special case. Like you said, if we = ever have something like "but should not be enabled/touched by the frontend during pr= obe." then what David suggests in his reply makes more sense to me and clearly fits the usecase. = That's not what we have here. Here we have a fixed, non (linux) managed hardware and we do have a p= attern in other subsystems for HW like this. That is why my preferred approach would be a f= ixed-backend kind of thing (naturally to be discussed with DT maintainers likely). >=20 > The ALWAYS_ON capability could be inverted, like CAP_HAS_ENABLE_DISABLE, > but to me, the ALWAYS_ON naming still seems the better option. > >=20 But ok, I don't feel strong enough to be pushing for the above even though = (and for the record :)) it's not my preferred approach. If every one else is fine with it, I won't = object either. - Nuno S=C3=A1