Skip to content

Ad5529r driver#3234

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

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

Conversation

@jansunil

@jansunil jansunil commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

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

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

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

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

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

jansunil commented May 6, 2026

Copy link
Copy Markdown
Collaborator Author

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

jansunil commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

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

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

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

jansunil commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased branch with mirror_ci/jic23/iio/testing

@jansunil

jansunil commented May 7, 2026

Copy link
Copy Markdown
Collaborator Author

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

@jansunil

jansunil commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Upstream change requests:

  1. Changed from single adi,ad5529r to variant-specific compatibles
  2. Added information about clear, alarm, tg1,tg2,tg3 GPIOs and mux out in the devicetree binding
  3. Made hvss-supply optional (only needed for bipolar ranges)
  4. Added per channel child node support with Channel-specific adi,output-range-microvolt property
  5. Simplified by using device tree compatible strings instead of reading product ID
  6. Removed many unused register definitions, keeping only essential ones
  7. Use reg stride and make the reaadable ranges table simpler for 16 bits
  8. Added IIO_CHAN_INFO_OFFSET for proper voltage calculation, after the range addition
  9. ad5529r_parse_channel_ranges() for per-channel configuration
  10. Reorganized includes in alphabetical order, removed unused macros
  11. Stick to 80 column
  12. Remove the driver documentation ad5529r.rst, as it does not seem to hold much information.

Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c
@jansunil

Copy link
Copy Markdown
Collaborator Author

Changelog:

  1. Use device properties instead of OF

Upstream suggestions:
2) Move the debug fs function implementations closer to the struct definition
3) Add optional Vref supply. Implement the same on the driver.

Comment thread Documentation/devicetree/bindings/iio/dac/adi,ad5529r.yaml Outdated
#address-cells = <1>;
#size-cells = <0>;

dac@0 {

@rodrigo455 rodrigo455 May 22, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

similar to ad5706r, the spi controller can be used for multiple devices (with the same chip sellect!). There are those IDx pins that defines device addressing. I wonder if this node should define #address-cells and #size-cells too. So the main driver that you're putting together might need to handle up to four instances.

Even if your current driver cannot handle this yet, the dt-bindings might need cover that:

spi {
	#address-cells = <1>;
	#size-cells = <0>;

	multi-dac@0 {
		compatible = "adi,ad5529r-16";
		reg = <0>;
		spi-max-frequency = <25000000>;

		#address-cells = <1>;
		#size-cells = <0>;

		dac@0 {
			reg = <0>;
			vdd-supply = <&vdd_regulator>;
			avdd-supply = <&avdd_regulator>;
			hvdd-supply = <&hvdd_regulator>;
			hvss-supply = <&hvss_regulator>;

			reset-gpios = <&gpio0 87 GPIO_ACTIVE_LOW>;

			#address-cells = <1>;
			#size-cells = <0>;

			channel@0 {
				reg = <0>;
				adi,output-range-microvolt = <0 5000000>;
			};

			channel@1 {
				reg = <1>;
				adi,output-range-microvolt = <(-10000000) 10000000>;
			};

			channel@2 {
				reg = <2>;
				adi,output-range-microvolt = <0 40000000>;
			};
		}

		dac@1 {
			reg = <1>;
			vdd-supply = <&vdd_regulator>;
			avdd-supply = <&avdd_regulator>;
			hvdd-supply = <&hvdd_regulator>;
			hvss-supply = <&hvss_regulator>;

			reset-gpios = <&gpio0 88 GPIO_ACTIVE_LOW>;

			#address-cells = <1>;
			#size-cells = <0>;

			channel@0 {
				reg = <0>;
				adi,output-range-microvolt = <0 5000000>;
			};

			channel@1 {
				reg = <1>;
				adi,output-range-microvolt = <(-10000000) 10000000>;
			};
		}
	};
};

Although some things can be common, each device can have their own supplies and resources.
Need to double check if each dac node needs a separate compatible, being a separate driver
(not sure if it would make sense to mix and match ad5529r-16 and ad5529r-12).

In fact, the register map of ad5529r and ad5706r are so similar, we should consider creating a common driver for them (especially if they belong to the same family). @actorreno, what do you think?

EDIT: actually, there some differences. Probably it is fine as separate drivers.

@jansunil

jansunil commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

Changelog:

  1. Moved power supplies from main device to dac@N child nodes in devicetree binding
  2. Changed example device node name from dac@0 to ad5529r@0
  3. Updated ad5529r_parse_supplies() to parse supplies from dac@0 child node
  4. Added dac@N nodes as required to have vdd-supply, avdd-supply, hvdd-supply
  5. Updated function to use temporary device node switching for regulator lookup
  6. Add comments at necessary places
  7. Toggle pins defined as PWMs instead of GPIOs
  8. Removed explicit functions for debugfs

Comment thread Documentation/devicetree/bindings/iio/dac/adi,ad5529r.yaml
Comment thread Documentation/devicetree/bindings/iio/dac/adi,ad5529r.yaml
@jansunil

jansunil commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Changelog: Rebase and address merge conflicts

@rodrigo455 rodrigo455 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Only a few comments. Handling the of nodes manually might be too much trouble, but it looks manageable for now. For multi-device support, we may want to consider devm_of_platform_populate() to create platform device instances from each dac node.

Comment thread drivers/iio/dac/ad5529r.c Outdated
Comment thread drivers/iio/dac/ad5529r.c Outdated

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This brings some significant changes to the bindings. Don't forget to justify it in the cover

enum:
- adi,ad5529r-16 # 16-bit variant
- adi,ad5529r-12 # 12-bit variant
description: Device variant for this DAC device.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can't we have the above outside of the child nodes? I see Rodrigo made some comments regarding this but does it make sense to actually have a multidevice scheme with both 12 and 16 bits variants?

@jansunil jansunil Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is an edge case, but the hardware does technically allow mixing 12 bit and a 16 bit variant on the same SPI bus using the ID pins. This was the only option I could think of, to accommodate this case. Do you suggest keeping it simple and support just one variant in the chain?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Having three different compatibles definitely looks odd to me. What I suggested would make it possible to only care about two compatibles but I still find it a bit odd to have a compatible in here if there is no driver to bind against it.

Maybe just keep it simple. Multi-device is already something that was not asked for now and we can see it already as an edge case and this might be even more niche. Moreover, if adding a compatible in the child nodes is accepted by the maintainers, I don't see a big problem in adding that when really needed.

There's something which is not exactly the same but with some similarities:

https://elixir.bootlin.com/linux/v7.0.11/source/Documentation/devicetree/bindings/iio/dac/adi,axi-dac.yaml#L97

But in the above case we really create a platform device and have a driver for it. But the driver details don't really matter for the bindings

DAC device address (0-3) corresponding to ID[1:0] pin configuration.
For single device, use dac@0.
minimum: 0
maximum: 3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are the ID pins always required? I mean for the normal case where we just want one device? The above makes it feel it's mandatory.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The ID pin should actually map to the SPI command. The user is also allowed to configure it to a value which is not 0, even while operating it as a single device.

The present driver just considers the default value as ID=0 and does not accommodate any other configuration

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see. Well this might be ok as a simplification in the sense that we always end up using the i. But it does seem like unnecessary SPI churn for (maybe?) 99% of the usecases? So making the niche, the rule feels a bit odd.

- required:
- dac@2
- required:
- dac@3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does the above makes sense? Might be hard to actual put this into yaml but I think we're forgetting the normal case where only one device is to be used and ID pins don't really matter? But yeah, might not be a big deal in the end of the day

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Going back to this story maybe we can just treat the parent node (in this case what you have with "Shared chip-select endpoint for one or more AD5529R DAC devices.") as the default dac0 node with implied ID pins = 0 (whether that matters or not) and then we can have optional dac nodes from 1 to 3? And to avoid duplicated property definition we could maybe do something like in here?

https://elixir.bootlin.com/linux/v7.0.11/source/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml#L21

Thougts? @rodrigo455, @jansunil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suppose that works, but it gets the dt-bindings even more complicated. To me that seems like a workaround on a design that didn't foresee future needs. My concern was just not to lock the multi-device feature. I suppose that the device ID should be clear in the device-tree, because even if using only one single device, depending on how those ID pins are connected, the spi message needs to refer to the correct ID, otherwise the part will ignore the payload. The assumption that ID = 0 for the single device case is not necessarily true. Maybe with proper documentation we can get by.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suppose that works, but it gets the dt-bindings even more complicated.

I don't fully agree with it. As it stands right now, it's more complicated and non obvious what's going on. 3 compatibles as we have now looks very odd to me. We could have an explicit adi,pin-id property and only add the dac nodes (or make them required) if that property is given but that would complicate bindings a lot.

I suppose that the device ID should be clear in the device-tree, because even if using only one single device, depending on how those ID pins are connected, the spi message needs to refer to the correct ID, otherwise the part will ignore the payload. The assumption that ID = 0 for the single device case is not necessarily true. Maybe with proper documentation we can get by.

With the above I can agree to some extent. Implying things (even more implying HW) is probably never a good thing. Maybe we just need an explicit ID property and have an explicit value for "don't care"? And that being the default value?

I feel we're discussing a feature that might not be supported at all and even if it does, should account for 1% of usecases? But yes, having proper bindings now can save us some time in the future (possibly :))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yes, an ID property solves the issue for the single device use case, which would be the most common. I also agree with you to some extent. However, I don't understand how we find difficulty on supporting this, as if it would be really that painful... Why not avoid vendor specific property and use address-cells/reg which are meant exactly for this (device addressing).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can use address/reg as we're doing now. But that is only meaningful for when we want multi-device support no? Which is the niche case. So having those sub nodes mandatory seems a bit of extra churn.

Then, we can say, well just do dac@0 for the normal case but then reg has nothing to do with the ID pins given that in the normal scenario, the ID pins are meaningless (so back to where we are now). As said, also don't love the 3 compatible we have in place. The more natural way to me is

dac@0 {
    reg = <0>; //real chip select
    // all other properties
}

Above is normal mode; Then,

dac@0 {
    reg = <0>; //real chip select
    // all other properties and should we have an explicit id pin?
   
   dac@1 {
      reg = <1>;
      // all other properties
   }
}

So the main node always define one device whether we have multi device or not. To avoid duplication defining the same properties, I suggested that way to define a custom node. The above is still not great because there's a clear overlap between a possible vendor id pin and reg so it needs more care! Just an idea...

However, I don't understand how we find difficulty on supporting this, as if it would be really that painful...

Well, that's up to @jansunil but I also don't think it's trivial either (at least proper HW description). And without a proper usecase and way to test it (which would require asking additional chips), you just risk shooting yourself in the foot. Not worth the risk IMHO. And here I just mean the driver implementation

We should also make sure if we really need to duplicate all the properties? I would think that, at least, supplies would be shared between the devices?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

dac@0 {
    reg = <0>; //real chip select
    // all other properties and should we have an explicit id pin?
   
   dac@1 {
      reg = <1>;
      // all other properties
   }
}

This is reasonable when adding multi-device support later, once the initial design didn't consider that at all. Allows for a phased approach (so the dt-bindings can be extended later) but ends up with a weird node hierarchy. The reason that this is not a good design is mostly a "separation of concerns" argument. Having an address field in the SPI command means we kind have virtual layers: bus control and dac control (similar to I2C). A top-level driver handles spi stuff and the lower-level ones handles the dac. I tend to prefer a design meant for extensibility, rather than allow for organic growth. For a simple driver that might not matter much though.

And without a proper usecase and way to test it (which would require asking additional chips), you just risk shooting yourself in the foot. Not worth the risk IMHO.

Analyzing the SPI protocol messages and having it working for a single-device is enough to validate the multi-device use case. The address field just need to have the proper value.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A top-level driver handles spi stuff and the lower-level ones handles the dac. I tend to prefer a design meant for extensibility, rather than allow for organic growth. For a simple driver that might not matter much though.

We are not designing a subsystem in here :). I agree its a bit "weird node hierarchy" but I also don't like much of the virtual top level (with hacky compatible) device that only exists to "create" the real devices. Not really how things are laid down in HW (for this usecase).

If we ever get to implement this we might also try to get this done directly in the spi subsystem. If I'm not missing nothing the only issue is that we can't reuse CS (at least that's how it used to be) so we can just justify support for that. In fact, there might be already something we could use:

https://elixir.bootlin.com/linux/v7.1-rc7/source/drivers/spi/spi.c#L610

Did not looked that deeply but it seems it does not fit our usecase 100% as we can have 4 ID pins + 1 real CS. So, 4 virtual CS. Could be as easy as incrementing:

https://elixir.bootlin.com/linux/v7.1-rc7/source/include/linux/spi/spi.h#L24

And the above would resolve the ID pins. But we would still need to have other properties that would need to map to the proper device and that does not fit that well. @jansunil have you checked with the apps engineer if in this mode we really have different supplies, resets, etc? It seemed to me this mode is more to see the whole thing as an "aggregate" device that can extend to 16 channels...

Could make more sense to just have a spi DT property (together with proper spi core support) to allow devices to share physical CS lines so our bindings would become trivial and we would just have 4 different dac nodes and a vendor ID pin property.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes- while using multi device topology, the system is capable of having their own supplies. pins etc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

But what is the typical case? At least for the supplies, I would be surprised...

Comment thread drivers/iio/dac/ad5529r.c Outdated

if (of_get_available_child_count(dev_of_node(dev)) > 1)
return dev_err_probe(dev, -EOPNOTSUPP,
"Multi-device support not implemented yet\n");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would move this into the firmware parsing function. Also you device_property APIs. With it, I guess of.h can be dropped

Comment thread drivers/iio/dac/ad5529r.c Outdated
ret = dev_err_probe(dev, -EINVAL,
"Unknown compatible in dac@0 child node\n");
goto err_put_dac_node;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, not really sure this compatible per node is easy very nice. Maybe adding platform_devices can be an option as Rodrigo suggested but OTOH having a separate driver for the child nodes seems too much.

So the bigger question again is, does it make sense to have multi device with 16 and 12 bit variants mixed?

Also use device_property APIs where possible.

@jansunil

jansunil commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

Changelog (including upstream comments):

  1. Switch from OF-specific APIs to device property APIs
  2. Remove the two-level DT topology, compatible strings and channel config now live directly under the SPI device node
  3. Switch from manual regulator get/enable/devm-action pattern to devm_regulator_bulk_get_enable()
    and devm_regulator_get_enable_optional()
  4. Use spi_get_device_match_data() instead of of_match_node() to identify the device variant
  5. Add spi_device_id table entries with driver_data for both 12-bit and 16-bit variants
  6. Fix regmap_assign_bits() argument — pass the mask value directly instead of a bool
  7. Rename AD5529R_REF_SEL_INTERNAL → AD5529R_REF_SEL_INTERNAL_REF
  8. Simplify probe error paths by eliminating the err_put_dac_node goto label
  9. Move for loop variable declaration inline (for (unsigned int i = ...))
  10. Add dac@[1-3] pattern for future multi-device support (driver currently returns -EOPNOTSUPP)
  11. Move compatible, supplies, resets, channels at the SPI device node level
  12. Update Kconfig to remove Of and regulator

@nunojsa nunojsa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll stop review for now waiting for your decision on multi device support


additionalProperties: false

"^dac@[1-3]$":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's a lot of duplication below. If @rodrigo455 is fine with it, I would just not bother with this for now. From all the discussions we had so far, it seems we can extend bindings and the driver if we have a real usecase for this. Right now there's no enough consensus :).

But up to you! You had the work already so if you want to bring this upstream, your call

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah... In this state I would not even add those. As adding them later would not break the ABI, and would tell a better story on why this strategy took place.

Repetition is avoided adding the $defs Nuno pointed out before.

I still do not agree with all of this though! Something we may want to discuss upstream with dt folks.

minItems: 1
maxItems: 4
items:
enum: [ tg0, tg1, tg2, tg3 ]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the pass, these toggle pins were also handled by clocks. What does the datasheet states in here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

TG0-TG3 are plain digital inputs as per the DS. They need to be pulsed to trigger DAC updates for function generation in case of non transparent mode. These connect to a PWM peripheral.

- required:
- dac@2
- required:
- dac@3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

But what is the typical case? At least for the supplies, I would be surprised...

@jansunil

jansunil commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

Hi All, I have reverted the driver and devicetree to keep it simple and only support a single device, as we neither have a hardware not a specific ask for adding multi-device support. The functionality can be added once we have a specific use case. The latest version of the driver and bindings just have the upstream comments addressed.

Please let me know if this is good to go

@jansunil

jansunil commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

Changelog:

Reword comments and stick to 80 col width in dt binding. No code/binding changes otherwise

jansunil added 2 commits June 9, 2026 16:25
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>
@jansunil

jansunil commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

Changelog: Toggle pins configured as PWM pins in the dt binding

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.

4 participants