Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AD4170 sigma-delta ADCs #2573

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

machschmitt
Copy link
Contributor

@machschmitt machschmitt commented Aug 7, 2024

PR Description

Add support for AD4170 Sigma-Delta ADC.
This ADC supports many configurations.
One tricky part is supporting different channel setups (differential / pseudo-differential) and voltage reference supplies.
The added documentation aims to help review this driver by explaining the many possible ADC channel configurations and tries to generalize the consolidated knowledge so it may be useful for other ADCs.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have tested the changes on the relevant hardware - Tested differential channels with AD4170 on de10 nano and with AD4170 on cora. The eval-board seems to be filtering the analog input to some channels. Due to that pseudo-differential channel configurations were not tested yet.
  • I have updated the documentation outside this repo accordingly (the new docs are intended to help understand this new driver)

@machschmitt machschmitt force-pushed the staging/ad4170 branch 5 times, most recently from b978385 to 3418827 Compare October 8, 2024 18:20
acusco and others added 6 commits October 9, 2024 09:43
Add defines to improve readability of AD4170 device tree nodes.

Signed-off-by: Ana-Maria Cusco <ana-maria.cusco@analog.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Add device tree documentation for AD4170 sigma-delta ADCs.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Add support for the AD4170 ADC with the following features:
- Single-shot read (read_raw), scale, sampling freq
- Multi channel buffer support
- Buffered capture in triggered mode
- Buffered capture with SPI-Engine
- Gain and offset calibration
- Support for gpio controller
- chop_iexc and chop_adc device configuration
- Powerdown switch configuration

Signed-off-by: Ana-Maria Cusco <ana-maria.cusco@analog.com>
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
ADCs can have different input configurations such that developers can get
confused when trying to model some of them into IIO channels.

For example, some differential ADCs can have their channels configured as
pseudo-differential channels. In that configuration, only one input
connects to the signal of interest as opposed to using two inputs of a
differential input configuration. Datasheets sometimes also refer to
pseudo-differential inputs as single-ended inputs even though they have
distinct physical configuration and measurement procedure. There has been
some previous discussion in the mailing list about pseudo-differential and
single-ended channels [1].

Documenting the many possible ADC channel configurations should provide two
benefits:
A) Consolidate the knowledge from [2] and from [1], and hopefully reduce
the reviewing time of forthcoming ADC drivers.
B) Help Linux developers figure out quicker how to better support
differential ADCs, specially those that can have channels configured as
pseudo-differential inputs.

Add documentation about common ADC characteristics and IIO support for them.

[1]: https://lore.kernel.org/linux-iio/0fef36f8-a7db-40cc-86bd-9449cb4ab46e@gmail.com/
[2]: https://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
@machschmitt
Copy link
Contributor Author

machschmitt commented Oct 9, 2024

Currently, the CI complains about not finding dt-bindings/iio/adc/adi,ad4170.h but it is being included in the first patch.
Also, checkpatch check/warning is just about reusing macro parameters which is not a real issue.

@machschmitt machschmitt changed the title Staging/ad4170 Add support for AD4170 sigma-delta ADCs Oct 9, 2024
@machschmitt machschmitt marked this pull request as ready for review October 9, 2024 13:25
Copied from socfpga_cyclone5_de10_nano_ad4190.dts.
Only compatible string change.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Copied from zynq-coraz7s-ad4170.dts. Only compatible string change.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Initial support for AD4190. Same functionality as AD4170 but displays
different name.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants