Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1634089rdb; Sat, 10 Feb 2024 10:03:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOsqGfF+x6xgkipapXJrnE4x17d2+VCC3vy2vPIf9UrhLjPdNWfEuh+srRyCQUQzWagvC1 X-Received: by 2002:ac2:55b9:0:b0:511:82f0:6f9 with SMTP id y25-20020ac255b9000000b0051182f006f9mr1046493lfg.58.1707588218170; Sat, 10 Feb 2024 10:03:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUXf9+SixQ4jNoR5XBgvrf3aXQ7s8F4ojUosowUJlNe4FvCacNjb7bPCd9Uo2nqBIrZZccD7N134BuRKhROtNCD+hfGzYH/eH2vQW2+WQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f16-20020a170906561000b00a37679c2e55si2115543ejq.851.2024.02.10.10.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 10:03:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b="vAWob1/N"; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-60510-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60510-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9D3D51F23ECF for ; Sat, 10 Feb 2024 18:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 618A55D48E; Sat, 10 Feb 2024 18:03:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vAWob1/N" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80C315C5E0; Sat, 10 Feb 2024 18:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707588207; cv=none; b=J4yv/006ltf/fF+mvveXDt4aNg5bD3GT/EqdIhM2zQB/fEUi1rX+6Z3LKPcW6ltUTVKuGDsYP0Ts8ay7PJ27ItZLjlLTK8hFz53ZZLtPrxgiTfWT0fgoBFvOvwgj+V08Np9kLnpsrZtIe6CUQKcLuUkWPStrbEK3mSR2kaTcTqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707588207; c=relaxed/simple; bh=F/HvI1bBKYZ8GxyFLiKJuElMro7KT5JI+q4W1Ocubyg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jGqq/pBXnHAy64BZwtsH9DbQF0qlpFKzyzzXEwC88v7VSWG7Ft2seYn0qVNnmTi7f60GTy25iCYXwT+BO2H/MpUkFiRDvxHLor2Vhph6WJThqovsLC6yLNr7LOjUeNJ9jIiu6Td/CQGAr7TNqrpaype0RPE1HOxUMfwue77YeEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vAWob1/N; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 895D7C433F1; Sat, 10 Feb 2024 18:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707588207; bh=F/HvI1bBKYZ8GxyFLiKJuElMro7KT5JI+q4W1Ocubyg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vAWob1/NGPF9cZTUOi+RAvQufsPwRWHo06J78soZ9OTgc4P1DVDuZ6qGpr8u+HjuZ Cpw939x20zmwT3A4i+3DXrQ9Qwhy6F6QILcEeMTBHOEO+026iq6H+Lg89SeKOwMqq5 LslFtzxgwoqPo9Z69LZ0Be7Q0KK7/kBx6izVCyJ2lufBsMduzzH6ZzHHy+ZKBQhVPK 9DMMK4qRWzXUILQhcqoZaNIYaoX8ljMlPLLgfl6FYspu4FFuccbU1X6mJ6s/X3IbHx 4NlCiDNMAaGKBXX7GBe2ao2THnxpJJTeM4tcDB10VQr6/k6SxqR83lp4vKOJlsOk6H 79bHt3wNSmuVw== Date: Sat, 10 Feb 2024 18:03:15 +0000 From: Jonathan Cameron To: Ramona Gradinariu Cc: , , , , Subject: Re: [PATCH v3 2/3] docs: iio: add documentation for device buffers Message-ID: <20240210180315.78ee8135@jic23-huawei> In-Reply-To: <20240208100126.183697-3-ramona.gradinariu@analog.com> References: <20240208100126.183697-1-ramona.gradinariu@analog.com> <20240208100126.183697-3-ramona.gradinariu@analog.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 8 Feb 2024 12:01:25 +0200 Ramona Gradinariu wrote: > Add documentation for IIO device buffers describing buffer > attributes and how data is structured in buffers using > scan elements. > > Signed-off-by: Ramona Gradinariu > --- > changes in v3: > - new patch > Documentation/iio/iio_devbuf.rst | 121 +++++++++++++++++++++++++++++++ > Documentation/iio/index.rst | 1 + > 2 files changed, 122 insertions(+) > create mode 100644 Documentation/iio/iio_devbuf.rst > > diff --git a/Documentation/iio/iio_devbuf.rst b/Documentation/iio/iio_devbuf.rst > new file mode 100644 > index 000000000000..0563b65316cb > --- /dev/null > +++ b/Documentation/iio/iio_devbuf.rst > @@ -0,0 +1,121 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +============================= > +Industrial IIO device buffers > +============================= > + > +1. Overview > +=========== > + > +The Industrial I/O core offers a way for continuous data capture based on a > +trigger source. Multiple data channels can be read at once from > +/dev/iio:deviceX character device node, thus reducing the CPU load. > + > +2. Buffer attributes > +==================== > + > +An IIO buffer has an associated attributes directory under > +/sys/bus/iio/iio:deviceX/buffer/. Here are some of the existing attributes: Given this is new documentation, can we make it compliant from the start with multiple buffer support? bufferY > +3. Scan elements > +================ > + > +The meta information associated with a channel reading placed in a buffer is > +called a scan element. The important bits configuring scan elements are exposed > +to userspace applications via the /sys/bus/iio/iio:deviceX/scan_elements/ Reference the bufferY directory not scan_elements for this as well. .. > + > +A user space application will interpret data samples read from the buffer as two > +byte little endian signed data, that needs a 4 bits right shift before masking > +out the 12 valid bits of data. I can't remember how you do it, but if possible can we have a cross reference to the autogenerated ABI docs. I want those to remain the 'official' definition of ABI with this (excellent btw!) document being the user friendly cut down version. Thanks! Jonathan > diff --git a/Documentation/iio/index.rst b/Documentation/iio/index.rst > index db341b45397f..206a0aff5ca1 100644 > --- a/Documentation/iio/index.rst > +++ b/Documentation/iio/index.rst > @@ -8,6 +8,7 @@ Industrial I/O > :maxdepth: 1 > > iio_configfs > + iio_devbuf > > Industrial I/O Kernel Drivers > ============================= > -- > 2.34.1 >