-
Notifications
You must be signed in to change notification settings - Fork 845
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
[GSoC 2024] Add support for AD7294 #2578
base: rpi-6.1.y
Are you sure you want to change the base?
Changes from 20 commits
8a90c0c
c6f1f25
fb46b7f
acd6a57
595d123
1ddcfa3
6757d47
e3ae35e
a8bd7c3
d75120e
72f8894
cd38a5b
a62a9d8
6904726
d771574
f23d91e
1196a46
8905a7f
e1316fc
aa7ad79
6d2cb94
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,79 @@ | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/iio/addac/adi,ad7294.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: Analog Device AD7294/AD7294-2 device | ||
|
||
maintainers: | ||
- Anshul Dalal <[email protected]> | ||
|
||
description: | | ||
The AD7294/AD7294-2 is a monitor and control system with multichannel | ||
ADC, DAC, temperature and current sensor. The device features a 12-bit ADC | ||
and DAC with an i2c interface. | ||
|
||
Datasheet: | ||
AD7294: https://www.analog.com/media/en/technical-documentation/data-sheets/AD7294.pdf | ||
AD7294-2: https://www.analog.com/media/en/technical-documentation/data-sheets/AD7294-2.pdf | ||
|
||
properties: | ||
compatible: | ||
enum: | ||
- adi,ad7294 | ||
- adi,ad7294-2 | ||
|
||
reg: | ||
maxItems: 1 | ||
|
||
interrupts: | ||
maxItems: 1 | ||
description: Alert interrupt | ||
|
||
adc-vref-supply: | ||
description: The regulator supply for ADC reference voltage (0.1V to 4.1V). | ||
|
||
dac-vref-supply: | ||
description: | | ||
The regulator supply for DAC reference voltage (0V to AVDD - 2V). | ||
|
||
avdd-supply: | ||
description: Fixed regulator supply for analog circuitry (4.5V to 5.5V). | ||
|
||
vdrive-supply: | ||
description: Logic power supply (2.7V to 5.5V). | ||
|
||
shunt-resistor-ohms: | ||
$ref: /schemas/types.yaml#/definitions/int32-array | ||
maxItems: 2 | ||
description: Resistance for RS1 and RS2 in ohms | ||
Comment on lines
+48
to
+50
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. nit: usually we see the description coming before maxItems.
would look more natural. |
||
|
||
required: | ||
- compatible | ||
- reg | ||
- avdd-supply | ||
- vdrive-supply | ||
|
||
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. This would be added here to the device tree doc for documenting the channels if/when implementing support for differential channels
|
||
additionalProperties: false | ||
|
||
examples: | ||
- | | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
|
||
i2c { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
ad7294: addac@7b { | ||
compatible = "adi,ad7294"; | ||
reg = <0x7b>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <26 IRQ_TYPE_LEVEL_LOW>; | ||
adc-vref-supply = <&adc_vref>; | ||
dac-vref-supply = <&dac_vref>; | ||
avdd-supply = <&avdd>; | ||
vdrive-supply = <&vdrive>; | ||
shunt-resistor-ohms = <1000 1000>; | ||
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. This would come in the example
|
||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
|
||
/ { | ||
compatible = "brcm,bcm2835"; | ||
|
||
fragment@0 { | ||
target-path = "/"; | ||
__overlay__ { | ||
avdd: fixedregulator@0 { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "avdd"; | ||
regulator-min-microvolt = <5000000>; | ||
regulator-max-microvolt = <5000000>; | ||
regulator-boot-on; | ||
}; | ||
vdrive: fixedregulator@1 { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "vdrive"; | ||
regulator-min-microvolt = <3300000>; | ||
regulator-max-microvolt = <3300000>; | ||
regulator-boot-on; | ||
}; | ||
adc_vref: fixedregulator@2 { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "adc-vref"; | ||
regulator-min-microvolt = <2500000>; | ||
regulator-max-microvolt = <2500000>; | ||
regulator-boot-on; | ||
}; | ||
dac_vref: fixedregulator@3 { | ||
compatible = "regulator-fixed"; | ||
regulator-name = "dac-vref"; | ||
regulator-min-microvolt = <2500000>; | ||
regulator-max-microvolt = <2500000>; | ||
regulator-boot-on; | ||
}; | ||
}; | ||
}; | ||
|
||
fragment@1 { | ||
target = <&i2c_arm>; | ||
__overlay__ { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
status = "okay"; | ||
ad7294: ad7294@62 { | ||
compatible = "adi,ad7294-2"; | ||
reg = <0x62>; | ||
interrupts = <4 IRQ_TYPE_EDGE_FALLING>; | ||
interrupt-parent = <&gpio>; | ||
shunt-resistor-ohms = <1000 1000>; | ||
adc-vref-supply = <&adc_vref>; | ||
dac-vref-supply = <&dac_vref>; | ||
avdd-supply = <&avdd>; | ||
vdrive-supply = <&vdrive>; | ||
}; | ||
}; | ||
}; | ||
}; |
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.
improve the description with:
Interrupt for signaling when conversion results (either voltage, current, or temperature) exceed their high limit or fall below the low limit on a channel basis configuration. The interrupt source must be attached to the ALERT/BUSY pin.