From: <mike.looijmans@topic.nl>
To: Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>
Cc: Md Shofiqul Islam <shofiqtest@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
nuno.sa@analog.com, andy@kernel.org, andriy.shevchenko@intel.com
Subject: Re: [PATCH v4 3/3] iio: adc: ti-ads1298: Remove unnecessary CONFIG2 write during init
Date: Mon, 11 May 2026 19:59:45 +0200 [thread overview]
Message-ID: <2457ddad-a44a-4563-a51c-7d8d1da72b95@topic.nl> (raw)
In-Reply-To: <20260511170635.4dd3fdc9@jic23-huawei>
On 11-05-2026 18:06, Jonathan Cameron wrote:
> On Sat, 9 May 2026 15:36:19 -0500
> David Lechner <dlechner@baylibre.com> wrote:
>
>> On 5/9/26 10:19 AM, Md Shofiqul Islam wrote:
>>> The driver was enabling the internal test signal (INT_TEST), double
>>> amplitude (TEST_AMP), and fast frequency (TEST_FREQ_FAST) bits in
>>> CONFIG2 during initialization. These bits activate an internal square
>>> wave generator intended for device testing and calibration, not normal
>>> ECG operation.
>>>
>>> CONFIG2 defaults to having only the RESERVED bit set after reset, which
>>> is the correct value for normal operation. Remove the write entirely
>>> since it would just be writing the reset default value.
>>>
>>> Suggested-by: Mike Looijmans <mike.looijmans@topic.nl>
>>> Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
>>> ---
>>> drivers/iio/adc/ti-ads1298.c | 9 ---------
>>> 1 file changed, 9 deletions(-)
>>>
>>> diff --git a/drivers/iio/adc/ti-ads1298.c b/drivers/iio/adc/ti-ads1298.c
>>> index 186bda3087..8957e873e1 100644
>>> --- a/drivers/iio/adc/ti-ads1298.c
>>> +++ b/drivers/iio/adc/ti-ads1298.c
>>> @@ -615,15 +615,6 @@ static int ads1298_init(struct iio_dev *indio_dev)
>>> if (!indio_dev->name)
>>> return -ENOMEM;
>>>
>>> - /* Enable internal test signal, double amplitude, double frequency */
>> This is why comments should say why and not what. If the original author
>> had a plan for this, we don't know what it was.
>>
> Mike, any recollection?
>
> Anyhow I'm going to apply it anyway given Mike suggested it and fairly
> sure it was Mikes' code ;)
I think the idea was to have "some" test signal when setting the mux
into "test" mode.
But indeed, never actually used and as it raises questions, it's better
to leave it out. Hence my suggestion.
>
> Applied.
>> I look at the datasheet and the driver. Seems OK since the test signals
>> aren't used anywhere in the driver right now.
>>
>>> - ret = regmap_write(priv->regmap, ADS1298_REG_CONFIG2,
>>> - ADS1298_MASK_CONFIG2_RESERVED |
>>> - ADS1298_MASK_CONFIG2_INT_TEST |
>>> - ADS1298_MASK_CONFIG2_TEST_AMP |
>>> - ADS1298_MASK_CONFIG2_TEST_FREQ_FAST);
>>> - if (ret)
>>> - return ret;
>>> -
>>> val = ADS1298_MASK_CONFIG3_RESERVED; /* Must write 1 always */
>>> if (!priv->reg_vref) {
>>> /* Enable internal reference */
--
Mike Looijmans
System Expert
TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands
T: +31 (0) 499 33 69 69
E: mike.looijmans@topic.nl
W: www.topic.nl
prev parent reply other threads:[~2026-05-11 17:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 15:19 [PATCH v4 0/3] iio: adc: ti-ads1298: Minor driver cleanups Md Shofiqul Islam
2026-05-09 15:19 ` [PATCH v4 1/3] iio: adc: ti-ads1298: Add parentheses around macro parameter Md Shofiqul Islam
2026-05-09 11:38 ` Stepan Ionichev
2026-05-11 16:05 ` Jonathan Cameron
2026-05-09 15:19 ` [PATCH v4 2/3] iio: adc: ti-ads1298: Fix incorrect timeout comment Md Shofiqul Islam
2026-05-09 20:27 ` David Lechner
2026-05-10 6:59 ` Andy Shevchenko
2026-05-11 5:20 ` mike.looijmans
2026-05-11 10:14 ` Andy Shevchenko
2026-05-09 15:19 ` [PATCH v4 3/3] iio: adc: ti-ads1298: Remove unnecessary CONFIG2 write during init Md Shofiqul Islam
2026-05-09 20:36 ` David Lechner
2026-05-11 16:06 ` Jonathan Cameron
2026-05-11 17:59 ` mike.looijmans [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2457ddad-a44a-4563-a51c-7d8d1da72b95@topic.nl \
--to=mike.looijmans@topic.nl \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=shofiqtest@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox