From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.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 8ACDF3659F1 for ; Wed, 4 Mar 2026 22:45:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772664339; cv=none; b=RM9R6lLsMFLacbTWCzF/H0fC6X9ARIyjQv0NLESPDRUU/HV0+8ew3LMSMbgM4GlDqaLEj3jAAs3brLU6VGObxdLB/1UnhKwbixVAzF90l1PZ2Yek1UY3iRhH5omtC4+tUL7CHgXlVLZbTlGk7PThLbHzkG48+/sqzBpgiX2hTws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772664339; c=relaxed/simple; bh=8y0AY7pdxF3ZXmno3d6a1Z5FLbl7EiDCsNEdPAYxEaE=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=m32FxyclNOAeBK8BInPimwLoPDNFsXAdTN0Kb8GyOkBWmBnePxfrHcbPJ4T3UVs5TcP9/MxgYHFPOzQnjqScR7qHSo5/tf8QMBLyrbknG+TYQ0XFrWlc8YQlSedhWL4HgeLKIMMldj3x7q1jOmoRLz3INwJQh80kRAeK5bZxbAY= 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=2B9LJhDG; arc=none smtp.client-ip=209.85.161.49 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="2B9LJhDG" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-66f747175d8so4293647eaf.0 for ; Wed, 04 Mar 2026 14:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1772664337; x=1773269137; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=zoM9auab0e4iB9I2DJCod95IuvSIckvHaF9+CeqFu54=; b=2B9LJhDGgt6X+2BIjREDLxJWz6cud0LC5cmM9CLWENS31rZEZmH38Pm60H6AY5cU10 SooEd6MQcakVsCMUpWqFrOo8N9bs4/HkkBuV88Ddele2nHXqJjwO9pAtnFzIb7gTVyQl KenJiDQutwP5DB11ua6qpt+x9YaypR3ONBtk3kJ5KWuVT5SR5YndRsBnoX3qdmEYBv7t CLaC/h6od5yT+YZ29hcrd51NieXPjO25OtTeTt01hPXUPW6nqxggqfgyEE+dqiNI+jhk EB3bnKVYWZ3sGXkB0xJZjNOeHS/uEDnyfEONTcjfEi11Nl6JOY5qh6RL4ijdvxOu8Lg0 YHIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772664337; x=1773269137; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zoM9auab0e4iB9I2DJCod95IuvSIckvHaF9+CeqFu54=; b=Q0oi9NNysF8Td1yCI9uw7OFhRqzJKW5gf8YO5gGuH4TnKNhGHwhGL4YjOJzwP/n4iu ARar1qYDSTj0IzkfEskuj3rQGjBAqeP72ge1jQAzgSR6d3JS25bNxkfizD861hu3S/Oc 1D0br3llMMMd0JNYTUiALlJQUNIRry/ND0T6YakIXSXNtAMzQlT6Wd6O2UtZ80crX1c/ qU5inC48D8KUWUBSiSZbk3ln41whc/5yLP50xYWt3bVBc1tw59SPb+nu37dGxoN5ApW6 utrz61HsGwHO03+stzG93BJokGfVSWhRJ1ogBw7n48zo3kVom9Ula+MvOWlg/3ISKSVn +QtQ== X-Forwarded-Encrypted: i=1; AJvYcCVfZXLOgzNU+vyN2DgpMgCE2q0fxFGQa7PTAFoY1V01avcOQj5UnduDjsaN/2QA5BcY7TKvSsljFY4IYRI=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9n2VPqy2ZvzJGW5WsAdkYNKK/bVFJqHvSAEVZhUjDhOSA36oe KB9wI6XarOwpinPKXAK5xKdIDUUORBhVVD7yrhqiDMeezD5bY0Wu2tTuUy4cqdLB9sU= X-Gm-Gg: ATEYQzwh1CibkQaUe3mLW1RJ+cAE1mXRBxvCPw2auGqSPofjBLXXW+hZhchIJyICs4k KTYvQgqUhqjDxPTepPoKham6W9z9wAiVOLTCQdIKpCv0JoSKk3Ut5WGcS3zoHL6UhbPTOxsOljq YfYSQapoPBHSx10KX3G7NpvGUfqcBV9lYfMREfz5V7XjiBNOpYExWGSIjvJb9zZAkDyI8woln4l U1urjzIDml84cxdjyMyUUQrtKNVPdBl/0hNCJkfxmaBvYxkVOzXCKZGLWFyTh+bUDsNUZIgTeIo zaYNTzvYhqW8sDWu8LcV3QPGQwIWEnr8Pc9oEMLuBqqxEFEr6su7SCDlJhsxVYdwBUDCGo66Xsg jzZNzKYKfRoGjfvK2ANBp8IzO9fNhlXviUAzI3URaqK8HFLLxRTMv/jRAFxQ6eMTn4wNtpoMKkJ sxf6lcuzMiUpJY/i+AQMqqY4mWbG+R7EqzJ2+5Py0RezCqVvSWbQVXGwh8XOzi++yQsXdyBW2kd w== X-Received: by 2002:a05:6820:987:b0:679:e59a:8b8c with SMTP id 006d021491bc7-67b176f9d8dmr2082246eaf.26.1772664337436; Wed, 04 Mar 2026 14:45:37 -0800 (PST) Received: from ?IPV6:2600:8803:e7e4:500:d719:8353:352f:b2e0? ([2600:8803:e7e4:500:d719:8353:352f:b2e0]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-679f2d84dacsm13903905eaf.9.2026.03.04.14.45.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2026 14:45:37 -0800 (PST) Message-ID: <70f25902-5c79-46f9-8c67-99633b22b5ac@baylibre.com> Date: Wed, 4 Mar 2026 16:45:36 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 4/6] iio: ABI: Add support for floating-point numbers in buffer scan elements To: Francesco Lavra , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Jonathan Corbet , Shuah Khan , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20260304080519.2844101-1-flavra@baylibre.com> <20260304080658.2844434-1-flavra@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: <20260304080658.2844434-1-flavra@baylibre.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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. > ... > 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: > * :file:`index`, the scan_index of the channel. > * :file:`type`, description of the scan element data storage within the buffer > and hence the form in which it is read from user space. > - Format is [be|le]:[s|u]bits/storagebits[Xrepeat][>>shift] . > + Format is [be|le]:[f|s|u]bits/storagebits[Xrepeat][>>shift] . > > * *be* or *le*, specifies big or little endian. > + * *f*, specifies if floating-point. > * *s* or *u*, specifies if signed (2's complement) or unsigned. I would keep all of the format options on one bullet point. > * *bits*, is the number of valid data bits. > * *storagebits*, is the number of bits (after padding) that 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. > > Read-only attribute containing the description of the scan element data storage > within 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: > > - **be** or **le** specifies big or little-endian. > +- **f** specifies if floating-point. > - **s** or **u** specifies if signed (2's complement) or unsigned. same here > - **bits** is the number of valid data bits. > - **storagebits** is the number of bits (after padding) that it occupies in the