From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796316032; b=ykM2gopABRWUmwxFjnHKghFMTMUyoqbcxj8ICcdvbaaAMdZ1l+jVSG599a6immgaNUwL 8V1QY1LBUpn6u8cZ0C/FQnIAwn/8AIoRypK90kTC3cz8ygN0T+8HYNkDNZ5AW7egICvpq GdQh8FR8o3JUohUxNA+SwpP5/VTTEI6NyZsjdOtq8hu2kAvft7IMgb57CHzbH0IHKPIaD bhlsOFo6gxZQ0cklqWk2QHrtvPMgdi6Isoj9kowG8CJizE+tqaRWlUs7jm9tcn1IguP50 WkLdE8Dw1DmMSij4iEWjlA64GAH7T/cAX+dMiiz52aaKyTMdPLDO91mPlQyiDu7nFow== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796316032; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=BZATLgZ3lNYM9ItHfSsuzEBxCoC38cJ6axP9/l21hkU=; b=4tY0p3oq+fFXNL3isKj72QQTfUDl6Oo8Rh1b9QgZvbRGZBtKGHmTHPOi1G8E9KnOndLy 8TfXVBDdviwvLZYtGDFX7XjOnG8iqLASpaKVGVuOX6Obpig27bMKYGyiONc9SmxD2qWDR FLWW398LdG1lLG7V9QW0BXZkSDLavInHQmJiSQeFwoaI5tkYtaXjVkAxu7Ir4ofDq2MUR ckeyPbI+Z76L9NHzl0fgwejbhIWUMPd7lqKl4+CQJTrQ7D981QvhMmfjFNWD4eHNb+B0k p9KU26EUfEDCZsE96+hf33iBn8RCTqjZvYU/febRLZZgQ2NLcVuJEGMNU694dCfZcJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=daylnOLu; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 842E7606A322 for ; Thu, 3 Dec 2026 16:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=daylnOLu Received: by smtp.kernel.org (Postfix) with ESMTPSA id 372FF1F0089B; Thu, 3 Dec 2026 16:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796316032; bh=BZATLgZ3lNYM9ItHfSsuzEBxCoC38cJ6axP9/l21hkU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=daylnOLuBXfSAJo03q0LQfn+u0V6isdDvB/vVVAB5waCrMLRHDm1MBdSoXrmmUu7l bOR4gNjE3YwGreVUY1i1X9LKl0fa1O5lk4QB7O3H18WDQtqJXgqYPioWeB8uMP+yzk sTj5n5vel7zJSlbFAwmYKgjGvA+Sh7Ew9IEmdx91AoTij8KQaHo4Ob/YlWdkFCAWg5 H/pPtFz/iP/pE1SmVtot4CVE1TrP/HwB2RiewJXAax/aRIt4nxp16Q8K+oQ0CKKhE4 UDTrpDFlPLDzYKig0BIBTFIoCknRW51qLvKkt5VxLWodUY6yrOdT729FF2aAtTemZZ LROY6D+TLsMAw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 08/18] iio: adc: ad4170-4: Fix output data rate on AD4190-4 and AD4195-4 Reply-To: sashiko-reviews@lists.linux.dev To: "Janani Sunil" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203-ad419x-release-v1-8-18578ab50524@analog.com> References: <20261203-ad419x-release-v1-0-18578ab50524@analog.com> <20261203-ad419x-release-v1-8-18578ab50524@analog.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 16:40:31 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] iio: adc: ad4170-4: regmap_write() to CLOCK_CTRL clears CLOCKDIV bits -- commit 84752f37f843ed1d5b601d76f07823a7fc84e2bf Author: Janani Sunil iio: adc: ad4170-4: Fix output data rate on AD4190-4 and AD4195-4 This commit adds a per-device clock_div to chip_info to divide the main clock on AD4190-4 and AD4195-4, and initializes each channel's FILTER_FS to its reset value instead of setting a fixed default sampling frequency. > diff --git a/drivers/iio/adc/ad4170-4.c b/drivers/iio/adc/ad4170-4.c > index 575ac8d613014..0a5d29200ff2e 100644 > --- a/drivers/iio/adc/ad4170-4.c > +++ b/drivers/iio/adc/ad4170-4.c [ ... ] > @@ -2479,7 +2484,7 @@ static int ad4170_clock_select(struct iio_dev *indi= o_dev) > =20 > if (!ext_clk) { > /* Use internal clock reference */ > - st->mclk_hz =3D AD4170_INT_CLOCK_16MHZ; > + st->mclk_hz =3D AD4170_INT_CLOCK_16MHZ / st->chip->clock_div; > st->clock_ctrl |=3D FIELD_PREP(AD4170_CLOCK_CTRL_CLOCKSEL_MSK, > AD4170_CLOCK_CTRL_CLOCKSEL_INT_OUT); > =20 > @@ -2506,6 +2511,8 @@ static int ad4170_clock_select(struct iio_dev *indi= o_dev) > st->mclk_hz); > } > =20 > + st->mclk_hz /=3D st->chip->clock_div; > + > return 0; > } [Severity: Medium] Does writing st->clock_ctrl to AD4170_CLOCK_CTRL_REG clear the hardware CLOCKDIV default? st->clock_ctrl starts at zero and ad4170_clock_select() only populates AD4170_CLOCK_CTRL_CLOCKSEL_MSK. ad4170_parse_firmware() then writes all 16 bits via regmap_write(st->regmap, AD4170_CLOCK_CTRL_REG, st->clock_ctrl), zeroing bits 15:2 (as does ad4170_sel_clk()). If CLOCKDIV encodes divide-by-2 as a non-zero value on AD4190-4 and AD4195-4, clearing it defeats the divider that st->chip->clock_div assumes, leaving st->mclk_hz mismatched with the actual ADC clock and potentially clocking the ADC core above its rated frequency. Using regmap_update_bits() with AD4170_CLOCK_CTRL_CLOCKSEL_MSK (or programming CLOCKDIV in st->clock_ctrl) would keep the hardware divider in sync with st->chip->clock_div. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-ad419x-rel= ease-v1-0-18578ab50524@analog.com?part=3D8