Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp487221lqt; Thu, 6 Jun 2024 09:12:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUB2y13D6kGEdYDV+UiCr5fA7/Cd1Y90xZzJ21c/7u420qA7/0bZT5ZG+N2zgydo3rmVnOh2utPl8F05XQiQC8a1KspoV02ne+PAHPpcw== X-Google-Smtp-Source: AGHT+IEwJ3RfQuchhOHPLHqVDr7AntmYlAr3lEVCsDkN6hjTHTyiP/UOy+ZY5/OAjByhe0JMZ1aA X-Received: by 2002:a17:902:ceca:b0:1f6:84b1:d01c with SMTP id d9443c01a7336-1f6d0305cecmr890375ad.41.1717690320201; Thu, 06 Jun 2024 09:12:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717690320; cv=pass; d=google.com; s=arc-20160816; b=pwVwQJUlGjJ23UufMG64s7bzmiuv0tnjy8usD7YZ/ekqKRaS5UPRA7ygaM6DfgFIGc m1FuTqy4C+1ZorUsfLGKyf8gqKM6ZA3pa72AeEcjLptfqdVTf9t7Rj93KKgmoLxbcYJR R29AwStQ2ik4317hGUPpMRhUE3wAef6Z5doZYvEIwxwdJ4I2XSCeYijtxxUK8n8ibj8h GMOFEWSbkckdNLpsyfekIJ9j7Zrg8dWkySSi0kCYqwXOnQ7jCFWu0FvSYtXC3gFFMmmw OCt89VN/cDxoiukRXyvGFggzDIPeBmletL1sDgwpttHSYgsYyayUYlZ/u6qAJgVDb3d/ SJEA== 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=sgGPexu9mN5SdE54iUHGp+1L2X+Twtc4fsxdLmphaDs=; fh=LhdatDguh+IuN1lDyS6rzhx9ubttSYYZpDCGFgekH1E=; b=m862dkS/4C1uXQuwfXvcLsxLYfcPlFYkOJbDYum+hRpI62or4GzX2xJAyzKyLbjbtO S+SrKPO6VLd0PWi3uKvafvkilvQP3GaH7yLbIBGqgAvGZnos4h870cuxJfW3bBsPSGzp eEdfoIISkRBnJEIoyF/CFdCy5C92w7uQyZweEtL+9+CXuOc60omC3FUkqjbs7FuNf3Sv l36Gy7USRKMPVPTuGloDIn/G1ufIOXI3c07VvPtHkPELIsJQP04I3enrdAb6MrWMHwC+ yL/Pq20EU23StVEMsuAkb1W31WOcFITr+RkICBuv/shBZeyaJ25nffAKtBvSbGWLe8Zc abkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gcmM51XP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7e5847si11525265ad.418.2024.06.06.09.11.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 09:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gcmM51XP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204648-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2306A28A780 for ; Thu, 6 Jun 2024 16:09:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9101919924B; Thu, 6 Jun 2024 16:07:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gcmM51XP" 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 5539F19883B; Thu, 6 Jun 2024 16:07:42 +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=1717690062; cv=none; b=gZubbcr7vaq6Z8lyvRr2LsQSPZer1U/OiRCdnzpmZSo1iHs8+8Qan8XLQQQEF/EdqjTaIHTBkNZ0R21hriJTZl+Wfb9PjMiUSG8suKzT7nCYxzBH31siEpEGskqSc4Sr/35zslMX0hH9Fx+0hfKCOV/FBqag45pfum5SKSxF/+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690062; c=relaxed/simple; bh=afsv2fV0gtzsJaTkVEd62/Yxe4pe2uQVIKmzH2c38Kw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tEGwidWiHvSeNPJBOShyPc+n+DvqJ5xdK3yrQxN+sH85yVGfJ6lOfLnJP7hDnCJRscaY1yLf9YRgQt/Qvh7Rkww1ZOcvNx8SJlgr1BhBXKKyOxfV45CtrIba8u+UEa2/E/rjqx33XFkArru5htj/y+xlTrKYgJ5oDevppovu5nM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gcmM51XP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 2C386C4AF1D; Thu, 6 Jun 2024 16:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717690062; bh=afsv2fV0gtzsJaTkVEd62/Yxe4pe2uQVIKmzH2c38Kw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gcmM51XPsZSAc5SqZIU0hg23qK7Z6i/xP1iNFqM9NWNNkmP7R7z6vUVU3eaLobSvT sjnTFNDg95WAYld+m7/rEOSUYDIoiUF4Kcx/ElKrwN40Jhfphc/xVUUr99GgZXJmfM 164qO+BsOBZ5q4rVsyEldc7vgrK8YIynlx2cHMwORgllgu4L9jFxNZHFopGseDUalz 5vliQLpLF+5fXILS8Xmrh03DlPXItSk0SHHqCLlJA5+7X6KYNFDzv41uApy9hpJm59 e1bxV88Ezi10OzxGSZa5PO6ga0CuP8+FYJW7mNoNzlDdx40md4s+mwlhxHz7Hq9WaF VSRdjwc16t+8w== 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 2286CC27C65; Thu, 6 Jun 2024 16:07:42 +0000 (UTC) From: Dumitru Ceclan via B4 Relay Date: Thu, 06 Jun 2024 19:07:47 +0300 Subject: [PATCH v6 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: <20240606-ad4111-v6-8-573981fb3e2e@analog.com> References: <20240606-ad4111-v6-0-573981fb3e2e@analog.com> In-Reply-To: <20240606-ad4111-v6-0-573981fb3e2e@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=1717690059; l=1618; i=dumitru.ceclan@analog.com; s=20240313; h=from:subject:message-id; bh=5A7meMN974lnd3IZ+v3+YKzX36bmXGBNKl55VG1TWLo=; b=vhbwHZSMdCRyNA8RxOKXUcNeTNqYZaTz02kVQ4ip3JBIQveKFzYY1sJ+/GiVnaj/IOe/cUelS CDjv3IwJYyVACNS8MObykH3YVHBttwhyEbIsblfE87VnjnWr4Q+Z8rJ 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 8d008186cd6e..58da5717fd36 100644 --- a/drivers/iio/adc/ad7173.c +++ b/drivers/iio/adc/ad7173.c @@ -740,6 +740,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