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 14 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 6 times, most recently from 3418827 to 1373835 Compare October 9, 2024 12:45
@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
acusco and others added 11 commits January 27, 2025 11:14
Add defines to improve readability of AD4170 device tree nodes.

Signed-off-by: Ana-Maria Cusco <[email protected]>
Signed-off-by: Marcelo Schmitt <[email protected]>
Add device tree documentation for AD4170 sigma-delta ADCs.

Signed-off-by: Marcelo Schmitt <[email protected]>
The changes introduced by this commit were originally made to
arm/boot/dts/socfpga_cyclone5_de10_nano.dtsi by Dragos Bogdan. Though,
de10_nano device tree includes were latter reorganized by Uwe Kleine-König
(91f1670), making socfpga_cyclone5_de10_nano.dtsi the generic dtsi for
de10_nano and socfpga_cyclone5_de10_nano_hps.dtsi the include file for a
specific FPGA configuration.  Instead of changing the generic dtsi for
de10_nano, create socfpga_cyclone5_de10_nano_hps_pio21.dtsi to have the
configuration for a specific GPIO driver version.

Signed-off-by: Dragos Bogdan <[email protected]>
Signed-off-by: Marcelo Schmitt <[email protected]>
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 <[email protected]>
Signed-off-by: Dragos Bogdan <[email protected]>
Signed-off-by: Marcelo Schmitt <[email protected]>
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/[email protected]/
[2]: https://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html.

Signed-off-by: Marcelo Schmitt <[email protected]>
… node

Add a lable for the SPI-Engine controller node so it can be referenced by
other dts that include socfpga_cyclone5_de10_nano_ad4170.dts in follow up
patches.

Signed-off-by: Marcelo Schmitt <[email protected]>
Copied from socfpga_cyclone5_de10_nano_ad4190.dts.
Only compatible string change.

Signed-off-by: Marcelo Schmitt <[email protected]>
Copied from zynq-coraz7s-ad4170.dts. Only compatible string change.

Signed-off-by: Marcelo Schmitt <[email protected]>
Initial support for AD4190. Same functionality as AD4170 but displays
different name.

Signed-off-by: Marcelo Schmitt <[email protected]>
AD4195 is similar to AD4170.

Signed-off-by: Marcelo Schmitt <[email protected]>
AD4195 is similar to AD4170.

Signed-off-by: Marcelo Schmitt <[email protected]>
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.

2 participants