From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 134D6376BEA for ; Thu, 5 Mar 2026 09:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772701793; cv=none; b=SvbVRs+tAKwK6atqE1RvzoYY5eThrfEQQnVk1VSPg3Q1kaSBGMqXYU65xTelAXtrowCZ4mwCZLV+RdVMzC8jAcprqxgJN4V897MlQ724gz1njJy/rkU3cRN4Oe8V8lhCd2PxSbi3wXO/IMxARuyL4dS8YUQLwl+0+UvjRADpWGc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772701793; c=relaxed/simple; bh=paMFccUX70MzLe6EqiSxhQfH8druuhfP7qmrJ+o85/M=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=safOqODphBBqBvwVJAXQ3WR23F99D1ReePhMI8HOyYOahYNfh4DuCX/L9iYoiOEBJ/NMM5ExTFgO7aqOtSpkkPqBr4uP3I+7AAFF5/ZOzE2F1XYtP3fJLcINkp5EUTqMyfbp/KHnvbJmBIuT3sRpYAPSrelWmbgEixfteXU3mrA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=vGPon/50; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="vGPon/50" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-439c9bdc1eeso1531534f8f.3 for ; Thu, 05 Mar 2026 01:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1772701790; x=1773306590; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:to:from:subject:message-id:from:to:cc :subject:date:message-id:reply-to; bh=paMFccUX70MzLe6EqiSxhQfH8druuhfP7qmrJ+o85/M=; b=vGPon/50OBW/mGAU0XCwC1HVXLX9sZ+uree5UA6PUaLeIfPeOcGzfzJs6nseBX1Ufp NGuFyBv1k4W0snG6nBpf+5I4/qfTXaoef5qnmQ1RXY0vF8M51S9gXu4OtdoMYxGJALEW ZPLCmB2EKuIXEywR3qrIJU3rClvZEVBbdiaDlBaZ3hPxR8AzHEqLQ3GIINbDDqv+0Lp4 P9bRm9yJZQIs5RC6/3NT5zXUUDCkuwHaBz/Df/EWH+rkLQvYQ0Ta57aijXn7x0vXxAxE QvpA79g2qwiljYtduHivZI8jRWAHJcuoIOpOI4O3ndjGy540WY+IOgOVDpG9/x3e5fbb i54g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772701790; x=1773306590; h=mime-version:user-agent:content-transfer-encoding:organization :references:in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=paMFccUX70MzLe6EqiSxhQfH8druuhfP7qmrJ+o85/M=; b=BU2mzHqEcxh1/P9LqNYHuCk1qoL0fjxpntbBunntzomR6GiWBBLOn6wI7g4H+vUPaL Po9Hd/Ly435M9F78jpvyLfQuBh0tjzRB91ejah3P65lZqzqdQH8VhVRDRIPpoqPGk8AE D5An1pzoChiZ57ZMVkXbA/vddZmUR3QdG1dmq7fDK7WSLQxYtAxaFM6045ynDGpNVtte sNurytqtCoNgW/H+f0UBE3scNwQjG08DfAXVCJtKDBLbClxHZBG/ZRp/YLWqyzK3N49U 1uU3c36PzdcmzpIgGK3ZpenMKXEETocPPkfwr6gN+aryVbuAssI9X9syAfaCcNiD5flY pAtQ== X-Forwarded-Encrypted: i=1; AJvYcCUCeggl2dgHMcgP1svxT8Nu3ekehNj0YL0O1vBCCbiYWr5FkUeR8Jg+P5FbmTQt7hW03Xm1XR9VU+Mjc7o=@vger.kernel.org X-Gm-Message-State: AOJu0YxAmKeZJ/2i+h5iJ66DUyxgKGt+wgrZ2fylvpVR5GKDEm1vLWqa 6wjgnOXxVdMZu23lEo+vakfKoSN2H5mbKUgwWPjJTRO0GwGVsDTKy1pFf2ax8m4/fV4= X-Gm-Gg: ATEYQzwLtuKX5L+8Lxkb1IrHVYdNZxJFm4i2xZqxqyXRajUqkYiSRsCvcVx0A12N4wC uUNkdQWTTTimqme7OXl4ytfmbSzY5t6eHIyaNQ4kKc3tEmiiSoyHqhER0y69d82RmVakA0TKAAW fM4Gjnri64Nyzo12afrZNxvBVHEOORI36t0mYSWZC2UaIV6VZ1ajrKfuYFB7YoF+bXQ7O0SDYqs 8uv6hEC8Yvq8cIQ277g6MIN408U5gL0a6fOFSAiJLdaLVA5MWBiAp175PK2mgbujOnG0u9v6KUg J7tXcevILcj8YbI1AzJeQw0ZjU3bFs26zx8sMiijtB7Pf/u7fjemCwoj2dgTb7P6MD9NYnVi54R TQ6DdG9qmJWKd4FUNhI/1GXpSoe+gzOzR4G0fCqa1ZWEGpkj3lbdZOsRN2XoMj8YBWrlFCQK+E3 13RYWHQw== X-Received: by 2002:a05:600c:6309:b0:483:7eea:b172 with SMTP id 5b1f17b1804b1-48519888cbamr87753395e9.23.1772701790412; Thu, 05 Mar 2026 01:09:50 -0800 (PST) Received: from [10.203.83.244] ([151.19.52.192]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4851a8955c1sm42457995e9.1.2026.03.05.01.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2026 01:09:50 -0800 (PST) Message-ID: <098886563f5fdcde837989d0556ed9a2d8d3203b.camel@baylibre.com> Subject: Re: [PATCH v7 4/6] iio: ABI: Add support for floating-point numbers in buffer scan elements From: Francesco Lavra To: David Lechner , Jonathan Cameron , Nuno =?ISO-8859-1?Q?S=E1?= , Andy Shevchenko , Jonathan Corbet , Shuah Khan , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Date: Thu, 05 Mar 2026 10:09:47 +0100 In-Reply-To: <70f25902-5c79-46f9-8c67-99633b22b5ac@baylibre.com> References: <20260304080519.2844101-1-flavra@baylibre.com> <20260304080658.2844434-1-flavra@baylibre.com> <70f25902-5c79-46f9-8c67-99633b22b5ac@baylibre.com> Organization: BayLibre Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-03-04 at 16:45 -0600, David Lechner wrote: > On 3/4/26 2:06 AM, Francesco Lavra wrote: > > In the data storage description of a scan element, the first character > > after the colon can have the values 's' and 'u' to specify signed and > > unsigned integers, respectively. > > Add 'f' as an allowed value to specify floating-point numbers formatted > > according to the IEEE 754 standard. > >=20 > ... >=20 > > diff --git a/Documentation/driver-api/iio/buffers.rst > > b/Documentation/driver-api/iio/buffers.rst > > index f36e6d00173f..2fc9c2951a9d 100644 > > --- a/Documentation/driver-api/iio/buffers.rst > > +++ b/Documentation/driver-api/iio/buffers.rst > > @@ -37,9 +37,10 @@ directory contains attributes of the following form: > > =C2=A0* :file:`index`, the scan_index of the channel. > > =C2=A0* :file:`type`, description of the scan element data storage with= in > > the buffer > > =C2=A0=C2=A0 and hence the form in which it is read from user space. > > -=C2=A0 Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] . > > +=C2=A0 Format is [be|le]:[f|s|u]bits/storagebits[Xrepeat][>>shift] . > > =C2=A0 > > =C2=A0=C2=A0 * *be* or *le*, specifies big or little endian. > > +=C2=A0 * *f*, specifies if floating-point. > > =C2=A0=C2=A0 * *s* or *u*, specifies if signed (2's complement) or unsi= gned. >=20 > I would keep all of the format options on one bullet point. That's what I did initially, but Andy suggested doing differently [1]. > > =C2=A0=C2=A0 * *bits*, is the number of valid data bits. > > =C2=A0=C2=A0 * *storagebits*, is the number of bits (after padding) tha= t it > > occupies in the > > diff --git a/Documentation/iio/iio_devbuf.rst > > b/Documentation/iio/iio_devbuf.rst > > index dca1f0200b0d..e91730fa3cea 100644 > > --- a/Documentation/iio/iio_devbuf.rst > > +++ b/Documentation/iio/iio_devbuf.rst > > @@ -83,9 +83,10 @@ and the relevant _type attributes to establish the > > data storage format. > > =C2=A0 > > =C2=A0Read-only attribute containing the description of the scan elemen= t > > data storage > > =C2=A0within the buffer and hence the form in which it is read from > > userspace. Format > > -is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift], where: > > +is [be|le]:[f|s|u]bits/storagebits[Xrepeat][>>shift], where: > > =C2=A0 > > =C2=A0- **be** or **le** specifies big or little-endian. > > +- **f** specifies if floating-point. > > =C2=A0- **s** or **u** specifies if signed (2's complement) or unsigned= . >=20 > same here [1] https://lore.kernel.org/linux-iio/aZ7dCdLs5xcJ4UGW@smile.fi.intel.com/ >=20