-
Notifications
You must be signed in to change notification settings - Fork 921
[GSoC 2024] Add support for AD7294 #2578
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: rpi-6.1.y
Are you sure you want to change the base?
Changes from all commits
b07262a
6f388f4
13c7b2e
f4ae935
8162c34
c602095
5379f16
5aeb5ae
653a47c
44789a0
ba19ec7
e4462e5
2367e1b
5c0172f
6ee7a81
7975b5f
c5ee9c9
af70773
56e3de4
f989a13
a264cd1
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 <anshulusr@gmail.com> | ||
|
|
||
| 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
Contributor
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 | ||
|
|
||
|
Contributor
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>; | ||
|
Contributor
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.