Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp430984lqj; Sun, 2 Jun 2024 05:22:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVY3+a5MjFuQdZk6SR31nysvN4p74H7wsxA6mfSY/rkp8+pA55shcUzDZpYRKBANETs6GqqF6+g6qOBlz17bfirjHWi9k5GlqOsS/GocQ== X-Google-Smtp-Source: AGHT+IGIBeuiCdebo/M1e9+uYzMpL59HCH54g/vxKNbrklYLAeJUKJmytGa1f91GmZWnUV//KDsw X-Received: by 2002:a17:902:ecd0:b0:1f6:3596:7c61 with SMTP id d9443c01a7336-1f636fe071cmr77109505ad.2.1717330943066; Sun, 02 Jun 2024 05:22:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717330943; cv=pass; d=google.com; s=arc-20160816; b=HXR+2Zzm2/mdHF9erUTynDfkXTH4bwkGfhxB4yBFRTzsLETtf2QswN1wtM6QgiyBDc oczDOhIVQOqqLiQwY7vSuWZwH4Rshu0X57UmAKsaSaC8VMIZt6JCzokYhVZtbSV/7nRQ MBR66XtUV9ukqnobO5kGSh0541NTeQc2ECCDRmMZCwera0wfeS4Fv6rgu5BqBhg5sCTs OlEvakDRYF26y2k2CYVw80Y0CvPT475IvIGKo/hy1sa3xFpTwtm9lTwj5/K1CUIQBSF4 0a0fgeHtygPYKB7GZwGUUYE0YYuOc0WaicrkwzuKAlLCwDCevc7hC9O4OH5qGlFyfLUk gn/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=8pbZaYNbWKyuQ458gb9RTcKBsuXbg+qmI5obLClHyv4=; fh=eQyTtpjgzetjZCIeJ2dJRvAcxTjaQrm2oWiHfVMOtjw=; b=hsbPjrOERgC4xAAKy3RxNQTEb21HIFoV7r2rFc8wNzGIn6lLFZk/RDMPvFUdnqO47z yZl2/GBOHsbkzG845d6tthQZ/UYFjrkAiElv7GJjqoMLatjvd+/2Wo9vEv7NDgOXAl5e jPX9t91KQLkAtxCl3VguCePX60ovDfpmT/KQ1rphdzwO5uL4qDz6MfZOMiIJ0pH9odcP Pg1SPnrdNe1mXcBZRpcj6R3dmtI+P41DJhjw/LRC8P30HcoV01CU9E4nRPhfx/W68+Ji MPnBdYjHfIfo9OYqKycILfK04iXaQWeVZwqY1p4M3gt+NjjIW2zimq6hxABnbDnYBcda o7Fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZVzsVrmF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198229-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198229-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. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323eb056si49360235ad.375.2024.06.02.05.22.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 05:22:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198229-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZVzsVrmF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198229-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198229-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 A5707281DA0 for ; Sun, 2 Jun 2024 12:22:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A2763A267; Sun, 2 Jun 2024 12:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZVzsVrmF" 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 AFB613BBC1; Sun, 2 Jun 2024 12:22:15 +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=1717330935; cv=none; b=VqvENPPLC0taRFh7fFKVA9movcYVCuJCajE76EfGjyy6ymbCL7iCttDdjNaomxi+vi94gwvMWXj2tYA/cs/deQ/M/GyEyIbXK22FJrs6wE3oweyjjAS01zQltZRuQ/C4V/29yWDlSS6pop3bZryBfpQ/3j30gsIDFtqrln4ad64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717330935; c=relaxed/simple; bh=Oz+eUMzrFK1pqjnUuwR3DSFiO4JwSF1BbKfu9Qe9I9w=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LaSUEuGl3ISXcL4yV76/Cl1FWRK80pAOma9OEUveam3kb1T5e1yVpnS1psxwi6y4VdGuKQsc5sulBzWs8HfImz+PDFvasXfFXBparxDCvn/I2LduL604r3UYgWLNmbiocu6+Sp+KK9ZyiOEp2HQRux6B/tQ9MdJHHRWtsNfQtmw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZVzsVrmF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5D57C2BBFC; Sun, 2 Jun 2024 12:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717330935; bh=Oz+eUMzrFK1pqjnUuwR3DSFiO4JwSF1BbKfu9Qe9I9w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZVzsVrmF3SitwiP2xiLG3lZr2i19mUCKMFENb0qG8Wb2dTqO/o+sZgYCD6CxN5jsa hXjghpCv5+aO+YkIxGX//4sCBFaO2TI4M1B7+2LL1NzLwzRk7UXvk7Prsz5Wt+Hr9j HNm8/WKPKwnoDkSuHWhMpHCrQmXhL2pMsTZLXUSfci2BDJkc+KJklegMCGcFOKUNr/ G0YXJjT7ETygRQc3qG3A2dedj+TBBZOIV83gwoEfF7fGn/AWAmeb1S0ED6K93pS3xK tTZKm2EdyrVJtbQE1KCtaA9auJJtJEs/h0TqIsWkEV7/mcL+5aamJj3a35AiGsDf1Z wtqfcava8hfHQ== Date: Sun, 2 Jun 2024 13:22:04 +0100 From: Jonathan Cameron To: Dumitru Ceclan via B4 Relay Cc: dumitru.ceclan@analog.com, Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Dumitru Ceclan Subject: Re: [PATCH v3 5/5] iio: adc: ad7173: Fix sampling frequency setting Message-ID: <20240602132204.385d689a@jic23-huawei> In-Reply-To: <20240530-ad7173-fixes-v3-5-b85f33079e18@analog.com> References: <20240530-ad7173-fixes-v3-0-b85f33079e18@analog.com> <20240530-ad7173-fixes-v3-5-b85f33079e18@analog.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; 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, 30 May 2024 15:07:53 +0300 Dumitru Ceclan via B4 Relay wrote: > From: Dumitru Ceclan > > This patch fixes two issues regarding the sampling frequency setting: > -The attribute was set as per device, not per channel. As such, when > setting the sampling frequency, the configuration was always done for > the slot 0, and the correct configuration was applied on the next > channel configuration call by the LRU mechanism. > -The LRU implementation does not take into account external settings of > the slot registers. When setting the sampling frequency directly to a > slot register in write_raw(), there is no guarantee that other channels > were not also using that slot and now incorrectly retain their config > as live. > > Set the sampling frequency attribute as separate in the channel templates. > Do not set the sampling directly to the slot register in write_raw(), > just mark the config as not live and let the LRU mechanism handle it. > As the reg variable is no longer used, remove it. > > Fixes: 8eb903272f75 ("iio: adc: ad7173: add AD7173 driver") > Signed-off-by: Dumitru Ceclan Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan