-
Notifications
You must be signed in to change notification settings - Fork 943
Ad5529r driver #3234
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
base: mirror_ci/jic23/iio/testing
Are you sure you want to change the base?
Ad5529r driver #3234
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,217 @@ | ||
| # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
| %YAML 1.2 | ||
| --- | ||
| $id: http://devicetree.org/schemas/iio/dac/adi,ad5529r.yaml# | ||
| $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
|
||
| title: Analog Devices AD5529R 16-Channel 12/16-bit High Voltage DAC | ||
|
|
||
| maintainers: | ||
| - Janani Sunil <janani.sunil@analog.com> | ||
|
|
||
| description: | | ||
| The AD5529R is a 16-channel, 12-bit or 16-bit, high voltage, buffered voltage output | ||
| digital-to-analog converter (DAC) with an integrated precision reference. | ||
| The device operates from unipolar and bipolar supplies. It is guaranteed | ||
| monotonic and has built-in rail-to-rail output buffers that can source or | ||
| sink up to 25mA. | ||
|
|
||
| Specifications: | ||
| * 16 independent 12-bit or 16-bit DAC channels | ||
| * Independently programmable output ranges: 0V to 5V, 0V to 10V, 0V to 20V, | ||
| 0V to 40V, ±5V, ±10V, ±15V, and ±20V | ||
| * The device supports SPI communication with Mode 0 and Mode 3. | ||
| * 4.096V precision reference, 12ppm/°C maximum | ||
| * Built-in function generation: Toggle, Sinusoidal Dither, and Ramp waveforms | ||
| * Multiplexer for output voltage, load current sense and die temperature | ||
|
|
||
| Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad5529r.pdf | ||
|
|
||
| properties: | ||
| compatible: | ||
| enum: | ||
| - adi,ad5529r-16 # 16-bit variant | ||
| - adi,ad5529r-12 # 12-bit variant | ||
|
|
||
| reg: | ||
| maxItems: 1 | ||
|
|
||
| spi-max-frequency: | ||
| maximum: 25000000 | ||
| description: | ||
| Maximum SPI frequency. The device supports SPI Mode 0 and Mode 3. | ||
| Read operations are limited to 25MHz maximum. | ||
|
|
||
| reset-gpios: | ||
| maxItems: 1 | ||
| description: | ||
| GPIO connected to the RESET pin. Active low. When asserted low, | ||
| performs a power-on reset and initializes the device to its default state. | ||
|
|
||
| clear-gpios: | ||
| maxItems: 1 | ||
| description: | ||
| GPIO connected to the CLEAR pin. Active low. When asserted low, | ||
| clears all DAC data registers without affecting configuration settings. | ||
|
|
||
| interrupts: | ||
| maxItems: 1 | ||
| description: | ||
| Interrupt connected to the ALARM pin. Active low interrupt output | ||
| for overtemperature conditions, SPI CRC errors, and function completion. | ||
|
|
||
| tg0-gpios: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those toggle pins might need to be connected to a pwm source, rather than using them as regular gpios (or maybe allow for both). |
||
| maxItems: 1 | ||
| description: | ||
| GPIO connected to the TG0 toggle pin. Pulsing this pin allows all | ||
| selected DACs to be updated synchronously for coordinated output changes. | ||
|
|
||
| tg1-gpios: | ||
| maxItems: 1 | ||
| description: | ||
| GPIO connected to the TG1 toggle pin. Pulsing this pin allows all | ||
| selected DACs to be updated synchronously for coordinated output changes. | ||
|
|
||
| tg2-gpios: | ||
| maxItems: 1 | ||
| description: | ||
| GPIO connected to the TG2 toggle pin. Pulsing this pin allows all | ||
| selected DACs to be updated synchronously for coordinated output changes. | ||
|
|
||
| tg3-gpios: | ||
| maxItems: 1 | ||
| description: | ||
| GPIO connected to the TG3 toggle pin. Pulsing this pin allows all | ||
| selected DACs to be updated synchronously for coordinated output changes. | ||
|
|
||
| io-channels: | ||
| maxItems: 1 | ||
| description: | ||
| ADC channel connected to the MUXOUT pin for monitoring output voltage, | ||
| load current sense, and die temperature. | ||
|
|
||
| io-channel-names: | ||
| const: muxout | ||
|
|
||
| vdd-supply: | ||
| description: Digital power supply (1.08V to 1.98V) | ||
|
|
||
| avdd-supply: | ||
| description: Analog power supply (4.75V to 5.25V) | ||
|
|
||
| hvdd-supply: | ||
| description: | ||
| High voltage positive supply (7V to 45V). Supply voltage should be chosen | ||
| based on configured output ranges (see datasheet Table 9). | ||
|
|
||
| hvss-supply: | ||
| description: | ||
| High voltage negative supply (-22.5V to 0V). Required only when using bipolar | ||
| output ranges (±5V, ±10V, ±15V, ±20V). Supply voltage should be | ||
| chosen based on configured output ranges (see datasheet Table 9). | ||
|
|
||
| vref-supply: | ||
| description: | ||
| External voltage reference supply (4.056V to 4.136V, typically 4.096V). | ||
| When specified, the device uses external reference mode and the VREF pin becomes an | ||
| input. The device uses the internal 4.096V precision reference otherwise. | ||
|
|
||
| "#address-cells": | ||
| const: 1 | ||
|
|
||
| "#size-cells": | ||
| const: 0 | ||
|
|
||
| patternProperties: | ||
| "^channel@([0-9]|1[0-5])$": | ||
| type: object | ||
| description: Child nodes for individual channel configuration | ||
|
|
||
| properties: | ||
| reg: | ||
| description: Channel number. | ||
| minimum: 0 | ||
| maximum: 15 | ||
|
|
||
| adi,output-range-microvolt: | ||
| description: | | ||
| Output voltage range for this channel as [min, max] in microvolts. | ||
| If not specified, defaults to 0V to 5V range. | ||
| oneOf: | ||
| - items: | ||
| - const: 0 | ||
| - enum: [5000000, 10000000, 20000000, 40000000] | ||
| - items: | ||
| - const: -5000000 | ||
| - const: 5000000 | ||
| - items: | ||
| - const: -10000000 | ||
| - const: 10000000 | ||
| - items: | ||
| - const: -15000000 | ||
| - const: 15000000 | ||
| - items: | ||
| - const: -20000000 | ||
| - const: 20000000 | ||
|
|
||
| required: | ||
| - reg | ||
|
|
||
| additionalProperties: false | ||
|
|
||
| required: | ||
| - compatible | ||
| - reg | ||
| - vdd-supply | ||
| - avdd-supply | ||
| - hvdd-supply | ||
|
|
||
| dependencies: | ||
| spi-cpha: [ spi-cpol ] | ||
| spi-cpol: [ spi-cpha ] | ||
|
|
||
| allOf: | ||
| - $ref: /schemas/spi/spi-peripheral-props.yaml# | ||
|
|
||
| unevaluatedProperties: false | ||
|
|
||
| examples: | ||
| - | | ||
| #include <dt-bindings/gpio/gpio.h> | ||
|
|
||
| spi { | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
|
|
||
| dac@0 { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: Although some things can be common, each device can have their own supplies and resources. 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. |
||
| compatible = "adi,ad5529r-16"; | ||
| reg = <0>; | ||
| spi-max-frequency = <25000000>; | ||
|
|
||
| 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>; | ||
| }; | ||
| }; | ||
| }; | ||
| ... | ||
Uh oh!
There was an error while loading. Please reload this page.