iio: adc: ad4691: fixes and devicetree#3302
Open
RaduSabau1 wants to merge 2 commits into
Open
Conversation
nunojsa
reviewed
May 4, 2026
| * CK_IO06: CNV (PWM trigger output, CNV_CLOCK_MODE and CNV_BURST_MODE only) | ||
| * CK_IO04: RESETn | ||
| * | ||
| * Copyright (C) 2025 Analog Devices Inc. |
Collaborator
Author
|
Marking this as draft until (the following) upstream patches are approved. |
Update the driver to match the current upstream revision. Move sampling_frequency and oversampling_ratio from per-channel separate attributes to shared_by_all. All channels share a single OSR and oscillator frequency target; replace the per-channel u8 osr[16] array with a single unsigned int osr. Precompute samp_freq_avail tables at probe time (one row per OSR entry) to avoid recomputing them on every read_avail call. Add dedicated offload channel arrays (AD4691_OFFLOAD_CHANNEL, AD4691_OFFLOAD_MANUAL_CHANNEL) with IIO_CPU endianness for the DMA path where bits_per_word=16 causes the SPI Engine to produce native 16-bit words, distinct from the software-path IIO_BE arrays. Remove the ad4691_offload_state struct and fold its fields directly into ad4691_state, simplifying the offload setup path. Add AD4691_EXIT_COMMAND (0x5000) and an ad4691_transfer() helper for raw 16-bit SPI frames. ad4691_exit_conversion_mode() now sends the proper exit command in manual mode instead of clearing MANUAL_MODE via regmap. Split the CNV burst buffer lifecycle: move IRQ enable/disable from preenable/postdisable to postenable/predisable to prevent a race where a DATA_READY assertion could arrive before the IIO poll function is registered. Add irq_enabled tracking, a trigger reenable callback, and switch to a non-threaded hardirq handler since only disable_irq_nosync() and iio_trigger_poll() are called from it. Signed-off-by: Radu Sabau <radu.sabau@analog.com>
Add initial device-tree file for AD4692 corresponding the the current HDL project which uses SPI Offload. Signed-off-by: Radu Sabau <radu.sabau@analog.com>
Collaborator
Author
|
This PR is now ready for review. Lore link has been updated for the last accepted version of the driver. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Lore: https://patchwork.kernel.org/project/linux-iio/cover/20260529-ad4692-multichannel-sar-adc-driver-v14-0-e93c2747dc1f@analog.com/
PR Type
PR Checklist