Skip to content

iio: dac: Add AD5413 support #2786

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions Documentation/devicetree/bindings/iio/dac/adi,ad5413.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5413.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5413 DAC

maintainers:
- Bruce Tsao <bruce.tsao@analog.com>

properties:
compatible:
const: adi,ad5413

reg:
maxItems: 1

spi-max-frequency:
maximum: 50000000

adi,range-microvolt:
Comment on lines +19 to +22
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
spi-max-frequency:
maximum: 50000000
adi,range-microvolt:
spi-max-frequency:
maximum: 50000000
reset-gpios: true
adi,range-microvolt:

description: Voltage output range <min, max> in microvolts
oneOf:
- items:
- const: -10500000
- const: 10500000
Comment on lines +25 to +27
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- items:
- const: -10500000
- const: 10500000
- items:
- const: -10500000
- const: 10500000
- items:
- const: -12600000
- const: 12600000

This needs to include all possibilities.


adi,range-microamp:
description: Current output range <min, max> in microamps
oneOf:
- items:
- const: 0
- const: 24000
Comment on lines +31 to +34
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
oneOf:
- items:
- const: 0
- const: 24000
items:
- const: 0
- const: 24000

oneOf doesn't make sense when there is only one possibility.


adi,slew-time-us:
description: Output digital slew control time in microseconds
minimum: 0
maximum: 1000000

required:
- compatible
- reg
- spi-max-frequency

allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
- oneOf:
- required: ['adi,range-microamp']
- required: ['adi,range-microvolt']

unevaluatedProperties: false

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

dac@0 {
compatible = "adi,ad5413";
reg = <0>;
spi-max-frequency = <1000000>;
adi,range-microvolt = <(-10500000) 10500000>;
Comment on lines +63 to +64
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
spi-max-frequency = <1000000>;
adi,range-microvolt = <(-10500000) 10500000>;
spi-max-frequency = <1000000>;
reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
adi,range-microvolt = <(-10500000) 10500000>;

adi,slew-time-us = <125>;
};
};
11 changes: 10 additions & 1 deletion drivers/iio/dac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ config AD5380
To compile this driver as module choose M here: the module will be called
ad5380.

config AD5413
tristate "Analog Devices AD5413 DAC driver"
depends on SPI_MASTER
help
Say yes here to build support for Analog Devices AD5413 single channel
Digital to Analog Converter.

To compile this driver as a module, choose M here: the
module will be called ad5758.

config AD5421
tristate "Analog Devices AD5421 DAC driver"
depends on SPI
Expand Down Expand Up @@ -563,5 +573,4 @@ config VF610_DAC

This driver can also be built as a module. If so, the module will
be called vf610_dac.

endmenu
2 changes: 2 additions & 0 deletions drivers/iio/dac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ obj-$(CONFIG_AD3552R) += ad3552r.o
obj-$(CONFIG_AD5270) += ad5270.o
obj-$(CONFIG_AD5360) += ad5360.o
obj-$(CONFIG_AD5380) += ad5380.o
obj-$(CONFIG_AD5413) += ad5413.o
obj-$(CONFIG_AD5421) += ad5421.o
obj-$(CONFIG_AD5624R_SPI) += ad5624r_spi.o
obj-$(CONFIG_AD5064) += ad5064.o
Expand Down Expand Up @@ -57,3 +58,4 @@ obj-$(CONFIG_TI_DAC5571) += ti-dac5571.o
obj-$(CONFIG_TI_DAC7311) += ti-dac7311.o
obj-$(CONFIG_TI_DAC7612) += ti-dac7612.o
obj-$(CONFIG_VF610_DAC) += vf610_dac.o

Loading
Loading