-
Notifications
You must be signed in to change notification settings - Fork 877
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
base: main
Are you sure you want to change the base?
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,72 @@ | ||||||||||||||||||||||||||||
# 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 <[email protected]> | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
properties: | ||||||||||||||||||||||||||||
compatible: | ||||||||||||||||||||||||||||
const: adi,ad5413 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
reg: | ||||||||||||||||||||||||||||
maxItems: 1 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
spi-max-frequency: | ||||||||||||||||||||||||||||
maximum: 50000000 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
adi,range-microvolt: | ||||||||||||||||||||||||||||
description: Voltage output range <min, max> in microvolts | ||||||||||||||||||||||||||||
enum: | ||||||||||||||||||||||||||||
- [-10500000, 10500000] | ||||||||||||||||||||||||||||
- [-12600000, 12600000] | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
adi,range-microamp: | ||||||||||||||||||||||||||||
description: Current output range <min, max> in microamps | ||||||||||||||||||||||||||||
enum: | ||||||||||||||||||||||||||||
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. Same here. Will also want to call out in the commit message why there is only one option here (and why |
||||||||||||||||||||||||||||
- [0, 24000] | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
adi,slew-time-us: | ||||||||||||||||||||||||||||
description: | | ||||||||||||||||||||||||||||
Output digital slew control time in microseconds | ||||||||||||||||||||||||||||
Comment on lines
+34
to
+35
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.
Suggested change
|
||||||||||||||||||||||||||||
minimum: 0 | ||||||||||||||||||||||||||||
maximum: 1000000 | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
required: | ||||||||||||||||||||||||||||
- compatible | ||||||||||||||||||||||||||||
- reg | ||||||||||||||||||||||||||||
- spi-max-frequency | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
allOf: | ||||||||||||||||||||||||||||
- $ref: /schemas/spi/spi-peripheral-props.yaml# | ||||||||||||||||||||||||||||
- if: | ||||||||||||||||||||||||||||
required: [adi, range-microamp] | ||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||
then: | ||||||||||||||||||||||||||||
properties: | ||||||||||||||||||||||||||||
adi,range-microvolt: false | ||||||||||||||||||||||||||||
- if: | ||||||||||||||||||||||||||||
required: [adi, range-microvolt] | ||||||||||||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||||||||||||
then: | ||||||||||||||||||||||||||||
properties: | ||||||||||||||||||||||||||||
adi,range-microamp: false | ||||||||||||||||||||||||||||
Comment on lines
+46
to
+55
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.
Suggested change
I didn't test it, but I'm pretty sure this works and is much shorter. |
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
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>; | ||||||||||||||||||||||||||||
adi,slew-time-us = <125>; | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -564,4 +564,13 @@ config VF610_DAC | |
This driver can also be built as a module. If so, the module will | ||
be called vf610_dac. | ||
|
||
config AD5413 | ||
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. We try to keep these in alphabetical order. |
||
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. | ||
endmenu |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,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 | ||
obj-$(CONFIG_AD5413) += ad5413.o | ||
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. same here - alphabetical order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum
doesn't work like that. See other bindings that already have this same property for what works.