Skip to content

Conversation

@PIoandan
Copy link
Collaborator

@PIoandan PIoandan commented Aug 5, 2025

Add ada4355 pyadi-iio support for the linux driver.

https://github.com/analogdevicesinc/linux/blob/34bb38377c9daa30d2abc632b82b4b654a32e90b/drivers/iio/adc/ada4355.c

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Hardware: Zedboard + EVAL-ADA4355
  • OS: Linux

Documentation

If this is a new feature or example please mention or link any documentation. All new hardware interface classes require documentation.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have signed off all commits and they contain "Signed-off by: "
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@PIoandan PIoandan requested a review from tfcollins August 5, 2025 10:51
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

Test Results

1 715 tests  +1     462 ✅ ±0   12m 3s ⏱️ -1s
    1 suites ±0   1 253 💤 +1 
    1 files   ±0       0 ❌ ±0 

Results for commit 4f448e2. ± Comparison against base commit b89168a.

This pull request removes 4 and adds 5 tests. Note that renamed tests count towards both.
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=rx_hardwaregain_chan0-val=[0.5, 11.0, 33.0, 31.0, 30.0, 14.0, 11.0, 4.0, 10.5, 1.0]-depends={'gain_control_mode_chan0': 'spi', 'rx_ensm_mode_chan0': 'rf_enabled'}-classname=adi.adrv9002]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=rx_hardwaregain_chan0-val=[8.0, 7.0, 12.0, 5.0, 19.5, 21.5, 25.0, 19.5, 24.5, 24.5]-depends={'gain_control_mode_chan1': 'spi', 'rx_ensm_mode_chan1': 'rf_enabled'}-classname=adi.adrv9002]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=tx_hardwaregain_chan0-val=[-32.7, -23.7, -3.0, -31.25, -6.9, -28.45, -1.05, -18.0, -19.4, -1.45]-depends={'atten_control_mode_chan0': 'spi'}-classname=adi.adrv9002]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=tx_hardwaregain_chan1-val=[-5.55, -17.9, -11.85, -33.15, -25.7, -37.1, -16.25, -2.5, -29.4, -22.25]-depends={'atten_control_mode_chan1': 'spi'}-classname=adi.adrv9002]
test.test_ada4355 ‑ test_ada4355_rx_data[channel=0-classname=adi.ada4355]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=rx_hardwaregain_chan0-val=[21.5, 20.5, 17.0, 15.5, 14.5, 12.5, 2.0, 9.0, 17.5, 4.0]-depends={'gain_control_mode_chan1': 'spi', 'rx_ensm_mode_chan1': 'rf_enabled'}-classname=adi.adrv9002]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=rx_hardwaregain_chan0-val=[24.5, 11.0, 17.5, 22.5, 26.5, 32.0, 23.5, 31.5, 33.0, 12.0]-depends={'gain_control_mode_chan0': 'spi', 'rx_ensm_mode_chan0': 'rf_enabled'}-classname=adi.adrv9002]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=tx_hardwaregain_chan0-val=[-37.4, -4.4, -24.15, -29.35, -2.65, -26.45, -7.9, -21.0, -9.8, -25.25]-depends={'atten_control_mode_chan0': 'spi'}-classname=adi.adrv9002]
test.test_adrv9002_p ‑ test_adrv9002_hardware_gain[attr=tx_hardwaregain_chan1-val=[-9.35, -5.15, -1.25, -8.9, -25.3, -11.05, -11.45, -17.3, -26.6, -17.35]-depends={'atten_control_mode_chan1': 'spi'}-classname=adi.adrv9002]

♻️ This comment has been updated with latest results.

@PIoandan PIoandan force-pushed the ada4355_pyadi branch 8 times, most recently from c893d3b to 87f83be Compare August 21, 2025 10:59
@PIoandan PIoandan requested a review from gastmaier August 22, 2025 07:52
adi/ada4355.py Outdated
@property
def test_mode(self):
"""Get test mode register value (0x0D)"""
return int(self.ada4355_register_read(0x0D), 0) # returns integer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not part of the driver? We rarely add register specific attributes as they point out deficiencies in the drivers. This returns are value as well, so how do we know what it means? If this doesn't get into the driver it needs to be at least documented what the return (and written) values can be

Comment on lines 82 to 78
class _channel(attribute):
""" ada4355 channel """

def __init__(self, ctrl, channel_name):
self.name = channel_name
self._ctrl = ctrl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this code?

Copy link
Collaborator

@tfcollins tfcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

Add ada4355 pyadi-iio support for the linux driver.

https://github.com/analogdevicesinc/linux/blob/34bb38377c9daa30d2abc632b82b4b654a32e90b/drivers/iio/adc/ada4355.c

Signed-off-by: Pop Ioan Daniel <pop.ioan-daniel@analog.com>
@PIoandan
Copy link
Collaborator Author

V2:

  • Remove test_mode property
  • Update _channel class to include relevant attributes
  • Resolve conflicts

@PIoandan PIoandan requested a review from tfcollins October 30, 2025 09:19
@github-actions
Copy link

Generated documentation for this PR is available at Link

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