Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1096858lqt; Fri, 7 Jun 2024 07:59:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnh3ZmQ9DnJizIaKsCptwLUa/Qqva4WGLW04xugdE6KXhSHY5/ij7WCdPf1o5vgKIiYaUSsJRHQbE3GUcAmhQyD0zGUV3F5JSzcU76aQ== X-Google-Smtp-Source: AGHT+IHjuaY1KP7i8f7agL93dU81Oj/mBBVy5RxEw7r21aio3Pm9MUTXgb4nwwuPUsQeCIQBgBa0 X-Received: by 2002:a17:906:b897:b0:a6e:2c34:6c0e with SMTP id a640c23a62f3a-a6e2c717611mr133429966b.22.1717772367418; Fri, 07 Jun 2024 07:59:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717772367; cv=pass; d=google.com; s=arc-20160816; b=VCTz3cpD+z8x1R02iTxhScHu8EWenj3Yh/rZGQZmPaSG8kf8CMe010P0ricvq1HIr+ C6V1vyeWtWjxkkqUwkVDThuGKUEOjbaxrG8SuACASNrHZiQ8dBRQfaLpMpI7rN5IYkwG lFJcDnUYQBajbhjspmTxzeMvz88j+fRjCDjF2yEJOMcH2ZF3dlPLJwsKhh6qd+8u11ft R0rSbkSG8rVSESbMeUi+yUPQKa9O3KlMx8LxjpmlruivHoVjFfesRcee3LGJ+So3KUpu ZvSC1kDBG1Uhs8nSMbiO6hPiCBAM0+o0RQI+cyYaQ1dAdrt0SfuWQUKjYU81Fv3XSHfc U7Yw== 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=Qws/CAtt6jxFRjefeFlf33+HvZhczP9gbeCJidMrt3Y=; fh=K7HD0VQrnT5duXdZ9yU773h5SI7WYfp4NZK+JacW1GM=; b=UXHnldXQBvgX6EfCb6KprhrUdZZH7ewlTS/rCNvQa+MouwnURCwixVRscR1+p2ffZ3 EZaMZpOSCBees+QkgW01C/CKpKHAwIy0V7g8fz++D+OAShRI1yHpCyrkP+APLaKdxAjh lRaOriiqETky0t7CoL06XVYENTNwnb8xoEi2qcLNVMCOtLdgJcd9Q8v3R5rixTC8ee2N LD4rmTEQwZbMXVd/loDQLihtPsg3utppca2b3n9Z/Xpr6zdCWvy+8KvOzm/HP6ZNIOMF jQ5yUYU90OeQ26X0GPK4zEo841OVhggsA8/sv3/0EsyT7KpNNvSrTGMpaIpyhCqZtwie R0Yw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xmh3mKDT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c806dba44si181844166b.282.2024.06.07.07.59.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206321-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=pass header.i=@kernel.org header.s=k20201202 header.b=Xmh3mKDT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206321-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206321-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 1E5DB1F2550F for ; Fri, 7 Jun 2024 14:59:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 032671A0DF0; Fri, 7 Jun 2024 14:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xmh3mKDT" 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 ABFB319FA70; Fri, 7 Jun 2024 14:53:09 +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=1717771989; cv=none; b=pwtAMQxEHpZgQ1YLFLEhSxNqkb4KxDC39pD2Dj2j1AoF9L4Q+aYTgyTK2GqZ3dgPIPa3pNiDMlBV0heVeGAUdFHb9RC/DzZptBfAA4LACBmguzm7hL1tTJiVlgnk1/udBe/XLcsT9SCGVXQkGAw9ZxduUuVV7+plUBHXp/DaBAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717771989; c=relaxed/simple; bh=hp9z0Ybu/B/EafMmtw/DvgPAfybd4iKKakb+IfmiaR4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ex3NPsRX4JE1zMCB1mJMEVlGGmtjqXzDFS+uLEYPkxQOkRyGtjY9hMRz+lWQx8jP5KlmjuploLTlhgi5JMTU1plKNcGv9iHwWMx0GDcposlGDcVqA4QWCW0frF10oottsDJCmMz5/8P1DJ6NIMqHvlSNt/kO5E8b6/TYCuql7+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xmh3mKDT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 88D96C4AF48; Fri, 7 Jun 2024 14:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717771989; bh=hp9z0Ybu/B/EafMmtw/DvgPAfybd4iKKakb+IfmiaR4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Xmh3mKDT0G+X19km+rkCG90/RDqvOnUunHeC5kto3FKUfAtVqG6qWnponZL3H8JiZ ceCpt75fsi03lFKJ0eWlinW1Njmvm3so5oUSJXbnHQtzFdA6jH/lqq9llEufG6oqRM ux2aEw+RrqEnH35Uji7+No4F5cF2GWkPaf+Zc5pIwVQiwsGlvjRVT9fj+NSsFcWZDS LrQ9GP/lohambEvKby022DO2G5CYi53B5m9+xuCuBiCOzDyTBTtWroiugYe7JkiYfK 857CXCR/AJKZngjXdHgD+RKS49cCKcFDVvDCLcTNtyN6CjDB95O/CjPkSPTpxrsZUQ bCpqc588lbKeg== 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 7BE06C27C6E; Fri, 7 Jun 2024 14:53:09 +0000 (UTC) From: Dumitru Ceclan via B4 Relay Date: Fri, 07 Jun 2024 17:53:14 +0300 Subject: [PATCH v7 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: <20240607-ad4111-v7-8-97e3855900a0@analog.com> References: <20240607-ad4111-v7-0-97e3855900a0@analog.com> In-Reply-To: <20240607-ad4111-v7-0-97e3855900a0@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 , Nuno Sa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717771987; l=1661; i=dumitru.ceclan@analog.com; s=20240313; h=from:subject:message-id; bh=mdKO2dnGlcZH90ri/TM/oMJLgoJ91RNSOsEvtEgKDAE=; b=ssITTpfL4Seggrz3KWXnnpHuG9ukbS4R2iLyMYPBuup1yGCnywGRhUXkj/E6iFDtX5Kj6l+gM kol/veezwmSDnCgal8fTjSB7b95rqbYhId/OvQiL7fgoiHv3wejYv9B 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. Reviewed-by: Nuno Sa 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 6ed5b8fed8c0..22dcf89ef3ef 100644 --- a/drivers/iio/adc/ad7173.c +++ b/drivers/iio/adc/ad7173.c @@ -732,6 +732,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