Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1076163lqj; Mon, 3 Jun 2024 09:25:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrqSEjPL+FWQO3dHVrkl3/GREQwfiyk+oM7CMFgPVezzQ6drZz3Edu9imW8AZyhw9JrjPB0FKzyoXY91/B+NwEUtA1eylV9IUWHbVXvQ== X-Google-Smtp-Source: AGHT+IFfodja7IEvi/6BA47bKDnm8Wx+lkuxbT8nsdznH27TLCIS0UPb8oTwE8XXelxn5i+qHuy/ X-Received: by 2002:a67:f4cb:0:b0:48b:c5ed:7ab with SMTP id ada2fe7eead31-48bc5ed0b33mr7217799137.25.1717431908474; Mon, 03 Jun 2024 09:25:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717431908; cv=pass; d=google.com; s=arc-20160816; b=nDD83Uu7M1fdO+T2df0KlKwVzsfvY00SUpDYLOBUOQnRIByGdmQaRANHXAvcuTvDg4 7WhSJW93KS5tJdBlb3uzeQwtQQpYJStpl/V6s74llyIKtnZce3zOBa5P45mq7B45E7Te KwbprrOTm1RuI3zAfQEJkUZIVHxoAj/4KAosljrGTMM23ezAcdnIAKan2BiugaviYwsj 6P/Z4DtfjZP67FGZ6vLq694kaZibKbi6sGRAnRv34hDDiyFu2fcdeuDg5ialDwRahJ3P VvHg1eFQS8JfasDYnQoA6KMDCg02EQYazCTzXUGRaAyAHlDTts/w0Ku7QWpRp7Wk51wj bAMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=ONfJ2B9WCkri1kiWbvFY1gzEv49J0HIfsNn8zPP0mSk=; fh=LhdatDguh+IuN1lDyS6rzhx9ubttSYYZpDCGFgekH1E=; b=JDBDniejqPhOsUbz1QeY9Ek2UQuL5gIcECiuqC54f7LQ3ayWKFwnDHAbxXac1GTuBU IgK0nB6gD26W8Mqk5E34BS1XiGh1DoIS0PQSlDp7TbEinH0er0xQuRsJtieDqSKuTkI+ 6qWUrtJgicrM5CVUB2Nd0JgkZqDheAW06l8rv/CliKRNJTj2GDDEoi92JqUf5ca0nqcp HCyXEbsivALd5NSfDcKh/uQ/Vdgc9hXRz+SzamcEfvlppW5OkefV8o+Oio/Z1a3KqKbh TzifEY43paKxL8zhbYqi3Wr6Db+6AM3BYM5kAUQ59dFMr/MCJVl+rZ2ALfa/Nr2r9jiJ Zogw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ng1tRoRy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48be8100561si345042137.331.2024.06.03.09.25.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 09:25:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ng1tRoRy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199440-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3368B1C216E6 for ; Mon, 3 Jun 2024 16:25:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EE1B13B280; Mon, 3 Jun 2024 16:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ng1tRoRy" 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 BEEA3136E2A; Mon, 3 Jun 2024 16:23:14 +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=1717431794; cv=none; b=XAztUgY2maSvZ/5FthI5AtbazHw0xZxaN1TCZh0gYzKuAquVye0b5wXI1LO700cIkEv5PyaX8SM8VaRSmzLvvXviQXw41TwXhimWDDVFWVi3/RHLWhpAPPCqUqjMguH6n7UIIgkWszM7W52CirUTcPkiEOXOjinr3KBigbz9mW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717431794; c=relaxed/simple; bh=PU9CGgziLdFhXBzpFlmp5+t+whnb8pPpl3fL8FrJUo4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CvMUh83+P7EZZ/pu1tqxT6td2bb+7mvlw1tqfj3PJcU0m5swnrrJ0HCVlv2PJlYNJb6rSIC3uBdZ25U3PDSCg0x5ePexbo0IOAWE47tbiOq5Ngi8qPzGgVsxYegTipjKfw9loYki22xP8lDugNxNyV1brjBulasLpffN39tqEWo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ng1tRoRy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 5093DC4AF54; Mon, 3 Jun 2024 16:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717431794; bh=PU9CGgziLdFhXBzpFlmp5+t+whnb8pPpl3fL8FrJUo4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ng1tRoRyka2FVZyNJvgc3anQzqOgKLIDFNUkdNTF36qiJ7xopmPobAcVEez0wvfpW co4Cjohy8y9f2RxLrR7WafYLdCfjUzb+THYxP+Slin/J5QFJUC7dZEJ1JGc+r49hal MP90JF1SH3eGv4SHrYTDELosLXvgFcr355H6aYLNETA1e83K2xPc1UdZxe088wFm+0 vNtN3FmKyOXLstfA+4rKH54UIqOKOTqJbK53swurpN0gWtv9rCry4NDAIkLUZNvP2s iYH94Kq4f4Md8zp0ql7hTfh0xJqpGYtK5tvbmlIo2Rk/gaXWGh9kYfLOy9VxFdj5Rl DPvOCAHn5MFuA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44A4AC25B75; Mon, 3 Jun 2024 16:23:14 +0000 (UTC) From: Dumitru Ceclan via B4 Relay Date: Mon, 03 Jun 2024 19:23:06 +0300 Subject: [PATCH v5 8/9] iio: adc: ad7173: document sampling frequency behaviour 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240603-ad4111-v5-8-9a9c54d9ac78@analog.com> References: <20240603-ad4111-v5-0-9a9c54d9ac78@analog.com> In-Reply-To: <20240603-ad4111-v5-0-9a9c54d9ac78@analog.com> To: Ceclan Dumitru Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , David Lechner , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dumitru Ceclan X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717431792; l=1618; i=dumitru.ceclan@analog.com; s=20240313; h=from:subject:message-id; bh=2nPfloQlqJU5+9wFX+IL8WDN+iCUelg+ZAepCt2X+L0=; b=SsK8XFss3iJYziP1y5sS5l3QzebH9uY+AORf8T9s/7lhH8rpA6oEnNUH1DfBCn/Ic65KvcZWb jZ+cb59m+lmBUzYSlGSJ9TGhySH/gYyl04gwy6fYROu4F8rXClT5uUx X-Developer-Key: i=dumitru.ceclan@analog.com; a=ed25519; pk=HdqMlVyrcazwoiai7oN6ghU+Bj1pusGUFRl30jhS7Bo= X-Endpoint-Received: by B4 Relay for dumitru.ceclan@analog.com/20240313 with auth_id=140 X-Original-From: Dumitru Ceclan Reply-To: dumitru.ceclan@analog.com From: Dumitru Ceclan The ADCs supported by this driver feature a sequencer that read in a loop all the enabled chanels. When setting the individual sampling frequency for each channel and enabling multiple channels, the effective of each channel will be lower than the actual set value. Document this behaviour in a comment. Signed-off-by: Dumitru Ceclan --- drivers/iio/adc/ad7173.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c index 5ade166814d7..fb18acc83f39 100644 --- a/drivers/iio/adc/ad7173.c +++ b/drivers/iio/adc/ad7173.c @@ -742,6 +742,21 @@ static int ad7173_write_raw(struct iio_dev *indio_dev, return ret; switch (info) { + /* + * This attribute sets the sampling frequency for each channel individually. + * There are no issues for raw or buffered reads of an individual channel. + * + * When multiple channels are enabled in buffered mode, the effective + * sampling rate of a channel is lowered in correlation to the number + * of channels enabled and the sampling rate of the other channels. + * + * Example: 3 channels enabled with rates CH1:6211sps CH2,CH3:10sps + * While the reading of CH1 takes only 0.16ms, the reading of CH2 and CH3 + * will take 100ms each. + * + * This will cause the reading of CH1 to be actually done once every + * 200.16ms, an effective rate of 4.99sps. + */ case IIO_CHAN_INFO_SAMP_FREQ: freq = val * MILLI + val2 / MILLI; for (i = st->info->odr_start_value; i < st->info->num_sinc5_data_rates - 1; i++) -- 2.43.0