Skip to content

Ad5529r driver#3234

Open
jansunil wants to merge 3 commits into
mirror_ci/jic23/iio/testingfrom
ad5529r-driver
Open

Ad5529r driver#3234
jansunil wants to merge 3 commits into
mirror_ci/jic23/iio/testingfrom
ad5529r-driver

Conversation

@jansunil
Copy link
Copy Markdown
Collaborator

@jansunil jansunil commented Apr 2, 2026

PR Description

  • Please replace this comment with a summary of your changes, and add any context
    necessary to understand them. List any dependencies required for this change.
  • To check the checkboxes below, insert a 'x' between square brackets (without
    any space), or simply check them after publishing the PR.
  • If you changes include a breaking change, please specify dependent PRs in the
    description and try to push all related PRs simultaneously.

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 compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 4 times, most recently from 0579d93 to a0d5e30 Compare April 6, 2026 00:10
@jansunil jansunil marked this pull request as ready for review April 6, 2026 07:44
@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 3 times, most recently from 59be8ec to 58a740e Compare April 9, 2026 00:12
Copy link
Copy Markdown
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

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

Here it goes my first pass! Make sure to also pass this though AI

One more fundamental observation! This only supports raw writes which does bring too much... Can we at least have support for scale (and possibly offset if there is one)?

Comment thread Documentation/devicetree/bindings/iio/dac/adi,ad5529r.yaml Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch from 58a740e to 12a34eb Compare April 10, 2026 00:10
@jansunil
Copy link
Copy Markdown
Collaborator Author

changelog:

Added Scale and offset implementation
Added reset framework implementation with
Regmap Improvements with regmap access tables, removed lengthly functions
Remove limit checks wherever not needed
Added proper buffer alignment for the SPI tx and Rx buffers
Used memcpy to prepare the data buffers for SPI transactions
Dev_info -> dev_dbg() during probe success message
Removed mutex lock within the driver
Remove additional blank lines and redundant else statements
Made updates to devicetree and iio documentation as per driver updates
Corrected typo in SPI mode information in the devicetree documentaiton

@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 3 times, most recently from 5d18d61 to 353fec2 Compare April 13, 2026 00:12
@gastmaier
Copy link
Copy Markdown
Collaborator

@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 6 times, most recently from 11c5e13 to 6114e4f Compare May 4, 2026 00:11
Copy link
Copy Markdown
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

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

I would really double check the regmap stuff. Im now wondering why we need the custom bus? We might be able to just use custom spi bus with 8 and 16 bit configs

Comment thread drivers/iio/dac/ad5529r.c
Comment thread drivers/iio/dac/ad5529r.c
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch 2 times, most recently from e196cfc to fdad854 Compare May 6, 2026 00:11
@jansunil jansunil force-pushed the ad5529r-driver branch 4 times, most recently from 07586f8 to 05214e5 Compare May 6, 2026 08:56
@jansunil
Copy link
Copy Markdown
Collaborator Author

jansunil commented May 6, 2026

Changelog:

  1. Simplified regmap 8 and 16 bit to use the standard regmap-spi
  2. For 16 bit registers, directly pass the addr + 1 to the regmap bus (thereby handling decremental mode of addressing), so that the custom regmap API can be removed.
  3. Updated documentation reflecting standard regmap-spi implementation

Copy link
Copy Markdown
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

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

For the code, I think we can just send this upstream. But take care about the 12 vs 16 bits variants. It needs better justification, likely in the commit message about why we need two compatibles. I mean, if can just add the second datasheet link, then it becomes clear

Comment thread drivers/iio/dac/ad5529r.c
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread Documentation/devicetree/bindings/iio/dac/adi,ad5529r.yaml
@jansunil jansunil force-pushed the ad5529r-driver branch 2 times, most recently from 1bd11f3 to 784979b Compare May 6, 2026 14:48
@jansunil
Copy link
Copy Markdown
Collaborator Author

jansunil commented May 6, 2026

Changelog:

  1. Remove tx and rx buffers from the ad5529r_state
  2. Modify to one liner functions for ad5529r_debugfs_reg_read() and ad5529r_debugfs_reg_write()
  3. Return regmap_write() directly in the ad5529r_reset()
  4. Remove extra lines wherever applicable
  5. Directly pass register address in the IIO_CHAN_INFO_RAW write function.
  6. Remove necessity of two compatibles.
  7. Detect connected hardware based on the product ID L value

@gastmaier gastmaier force-pushed the mirror_ci/jic23/iio/testing branch from fdad854 to c2f48c4 Compare May 7, 2026 00:12
Comment thread drivers/iio/dac/ad5529r.c
Comment thread drivers/iio/dac/ad5529r.c
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated
@jansunil
Copy link
Copy Markdown
Collaborator Author

jansunil commented May 7, 2026

Changelog:

  1. Remove unused includes and added whatever was missing
  2. Removed unused type field and used static define for number of channels
  3. Removed redundant dev_dbg() from the probe function
  4. Added Software reset as a fallback when there is no Reset GPIO
  5. Simplified scale calculation using IIO_VAL_FRACTIONAL_LOG2
  6. Fixed reset function issues by removing redundant return

Copy link
Copy Markdown
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

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

Alright, AFAICT go ahead and send this upstream

@jansunil
Copy link
Copy Markdown
Collaborator Author

jansunil commented May 7, 2026

Rebased branch with mirror_ci/jic23/iio/testing

jansunil added 3 commits May 7, 2026 17:31
Devicetree bindings for AD5529R 16 channel 12/16 bit high voltage,
buffered voltage output digital-to-analog converter (DAC) with an
integrated precision reference.

Signed-off-by: Janani Sunil <janani.sunil@analog.com>
Add support for AD5529R 16-channel, 12/16 bit Digital to Analog Converter

Signed-off-by: Janani Sunil <janani.sunil@analog.com>
Add documentation for AD5529R high voltage, 16-channel 12/16 bit DAC

Signed-off-by: Janani Sunil <janani.sunil@analog.com>
@jansunil
Copy link
Copy Markdown
Collaborator Author

jansunil commented May 7, 2026

Rebased branch with mirror_ci/jic23/iio/testing, get rid of the CI deploy commit

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