From: David Lechner <dlechner@baylibre.com>
To: "Trevor Gamblin" <tgamblin@baylibre.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/3] iio: adc: ad4695: add new regmap callbacks, timing improvements
Date: Wed, 13 Nov 2024 14:58:55 -0600 [thread overview]
Message-ID: <1390b66e-a9dc-42ee-a692-34a98146213f@baylibre.com> (raw)
In-Reply-To: <20241113-tgamblin-ad4695_improvements-v2-0-b6bb7c758fc4@baylibre.com>
On 11/13/24 2:52 PM, Trevor Gamblin wrote:
> The AD4695 driver currently operates all SPI reads/writes at the speed
> appropriate for register access, rather than the max rate for the bus.
> Data reads should ideally operate at the latter speed, but making this
> change universally makes it possible for data to be corrupted during use
> and for unexpected behavior to occur on driver subsequent driver
> binds/unbinds. To solve this, introduce custom regmap bus callbacks for
> the driver that explicitly set a lower speed only for these operations.
>
> The first patch in this series is a fix introduced after discovering the
> corresponding issue during testing of the callbacks. This is a timing
> fix that ensures the AD4695 datasheet's timing specs are met, as before
> the busy signal would sometimes fail to toggle again following the end
> of the conversion sequence. Adding an extra delay in the form of a blank
> transfer before every CS deassert in ad4695_buffer_preenable() allows
> this requirement to be met. The patch also makes similar changes in
> ad4695_read_one_sample() (while also tidying that function somewhat) to
> make sure that single reads are still functional with the regmap change.
>
> The second patch is an improvement that increases the robustness of the
> exit message in ad4695_exit_conversion_mode(), this time by adding a
> delay before the actual exit command. This helps avoid the possibility
> that the exit message will be read as data, causing corruption on some
> buffered reads.
>
> For additional context, see:
> https://lore.kernel.org/linux-iio/20241028163907.00007e12@Huawei.com/
>
> Suggested-by: David Lechner <dlechner@baylibre.com>
> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
> ---
Reviewed-by: David Lechner <dlechner@baylibre.com>
Tested-by: David Lechner <dlechner@baylibre.com>
prev parent reply other threads:[~2024-11-13 20:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 20:52 [PATCH v2 0/3] iio: adc: ad4695: add new regmap callbacks, timing improvements Trevor Gamblin
2024-11-13 20:52 ` [PATCH v2 1/3] iio: adc: ad4695: fix buffered read, single sample timings Trevor Gamblin
2024-11-24 12:52 ` Jonathan Cameron
2024-11-25 20:32 ` Trevor Gamblin
2024-11-13 20:52 ` [PATCH v2 2/3] iio: adc: ad4695: make ad4695_exit_conversion_mode() more robust Trevor Gamblin
2025-01-18 17:12 ` Jonathan Cameron
2025-01-20 2:46 ` Trevor Gamblin
2024-11-13 20:53 ` [PATCH v2 3/3] iio: adc: ad4695: add custom regmap bus callbacks Trevor Gamblin
2024-11-13 20:58 ` David Lechner [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=1390b66e-a9dc-42ee-a692-34a98146213f@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=tgamblin@baylibre.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