Skip to content
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

Add support for AD7944, AD7985, AD7986 #2280

Merged
merged 4 commits into from
Oct 31, 2023
Merged
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
24 changes: 24 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,pulsar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ description: |
Analog Devices PulSAR family Analog to Digital Converters with SPI support
https://www.analog.com/en/products/ad7988-5.html
https://www.analog.com/en/products/ad7988-1.html
https://www.analog.com/en/products/ad7986.html
https://www.analog.com/en/products/ad7985.html
https://www.analog.com/en/products/ad7984.html
https://www.analog.com/en/products/ad7983.html
https://www.analog.com/en/products/ad7982.html
https://www.analog.com/en/products/ad7980.html
https://www.analog.com/en/products/ad7949.html
https://www.analog.com/en/products/ad7944.html
https://www.analog.com/en/products/ad7946.html
https://www.analog.com/en/products/ad7942.html
https://www.analog.com/en/products/ad7699.html
Expand Down Expand Up @@ -45,12 +48,15 @@ properties:
enum:
- adi,pulsar,ad7988-5
- adi,pulsar,ad7988-1
- adi,pulsar,ad7986
- adi,pulsar,ad7985
- adi,pulsar,ad7984
- adi,pulsar,ad7983
- adi,pulsar,ad7982
- adi,pulsar,ad7980
- adi,pulsar,ad7949
- adi,pulsar,ad7946
- adi,pulsar,ad7944
- adi,pulsar,ad7942
- adi,pulsar,ad7699
- adi,pulsar,ad7693
Expand Down Expand Up @@ -104,6 +110,12 @@ properties:
vref-supply:
description: Voltage regulator for the reference voltage.

turbo-gpios:
maxItems: 1
description:
GPIO used to enable the turbo mode. This mode is used to increase the
sampling rate of the ADC at the expense of power consumption.

patternProperties:
"^channel@([0-8])$":
type: object
Expand Down Expand Up @@ -165,6 +177,18 @@ allOf:
required:
- adi,single-channel

- if:
properties:
compatible:
contains:
enum:
- adi,pulsar,ad7986
- adi,pulsar,ad7985
- adi,pulsar,ad7944
then:
required:
- turbo-gpios

required:
- compatible
- reg
Expand Down
100 changes: 100 additions & 0 deletions arch/arm/boot/dts/zynq-zed-adv7511-ad7944.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Analog Devices AD7944
* https://www.analog.com/en/products/ad7944.html
*
* hdl_project: <pulsar_adc_pmdz/zed>
* board_revision: <>
*
* Copyright (C) 2023 Analog Devices Inc.
*/
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

#include "zynq-zed.dtsi"
#include "zynq-zed-adv7511.dtsi"

/ {
vref: ad7944-internal-reference-regulator {
compatible = "regulator-fixed";
regulator-name = "AD7944 internal reference";
regulator-min-microvolt = <4096000>;
regulator-max-microvolt = <4096000>;
regulator-always-on;
};
};

&fpga_axi {
adc_trigger: pwm@44b00000 {
compatible = "adi,axi-pwmgen";
reg = <0x44b00000 0x1000>;
label = "adc_conversion_trigger";
#pwm-cells = <2>;
clocks = <&spi_clk>;
};

rx_dma: rx-dmac@44a30000 {
compatible = "adi,axi-dmac-1.00.a";
reg = <0x44a30000 0x1000>;
#dma-cells = <1>;
interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 17>;

adi,channels {
#size-cells = <0>;
#address-cells = <1>;

dma-channel@0 {
reg = <0>;
adi,source-bus-width = <32>;
adi,source-bus-type = <1>;
adi,destination-bus-width = <64>;
adi,destination-bus-type = <0>;
};
};
};

spi_clk: clock-controller@44a70000 {
compatible = "adi,axi-clkgen-2.00.a";
reg = <0x44a70000 0x1000>;
#clock-cells = <0>;
clocks = <&clkc 15>, <&clkc 15>;
clock-names = "s_axi_aclk", "clkin1";
clock-output-names = "spi_clk";
};

axi_spi_engine_0: spi@44a00000 {
compatible = "adi,axi-spi-engine-1.00.a";
reg = <0x44a00000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 15>, <&spi_clk>;
clock-names = "s_axi_aclk", "spi_clk";
num-cs = <1>;

#address-cells = <0x1>;
#size-cells = <0x0>;

ad7944: adc@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "adi,pulsar,ad7944";
reg = <0>;
spi-max-frequency = <80000000>;
turbo-gpios = <&gpio0 87 GPIO_ACTIVE_HIGH>;
clocks = <&spi_clk>;
clock-names = "ref_clk";
dmas = <&rx_dma 0>;
dma-names = "rx";
pwms = <&adc_trigger 0 0>;
pwm-names = "cnv";
vref-supply = <&vref>;
channel@0 {
reg = <0>;
diff-channels = <0 1>;
};
};
};
};
100 changes: 100 additions & 0 deletions arch/arm/boot/dts/zynq-zed-adv7511-ad7985.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Analog Devices AD7985
* https://www.analog.com/en/products/ad7985.html
*
* hdl_project: <pulsar_adc_pmdz/zed>
* board_revision: <>
*
* Copyright (C) 2023 Analog Devices Inc.
*/
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

#include "zynq-zed.dtsi"
#include "zynq-zed-adv7511.dtsi"

/ {
vref: ad7985-internal-reference-regulator {
compatible = "regulator-fixed";
regulator-name = "AD7985 internal reference";
regulator-min-microvolt = <4096000>;
regulator-max-microvolt = <4096000>;
regulator-always-on;
};
};

&fpga_axi {
adc_trigger: pwm@44b00000 {
compatible = "adi,axi-pwmgen";
reg = <0x44b00000 0x1000>;
label = "adc_conversion_trigger";
#pwm-cells = <2>;
clocks = <&spi_clk>;
};

rx_dma: rx-dmac@44a30000 {
compatible = "adi,axi-dmac-1.00.a";
reg = <0x44a30000 0x1000>;
#dma-cells = <1>;
interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 17>;

adi,channels {
#size-cells = <0>;
#address-cells = <1>;

dma-channel@0 {
reg = <0>;
adi,source-bus-width = <32>;
adi,source-bus-type = <1>;
adi,destination-bus-width = <64>;
adi,destination-bus-type = <0>;
};
};
};

spi_clk: clock-controller@44a70000 {
compatible = "adi,axi-clkgen-2.00.a";
reg = <0x44a70000 0x1000>;
#clock-cells = <0>;
clocks = <&clkc 15>, <&clkc 15>;
clock-names = "s_axi_aclk", "clkin1";
clock-output-names = "spi_clk";
};

axi_spi_engine_0: spi@44a00000 {
compatible = "adi,axi-spi-engine-1.00.a";
reg = <0x44a00000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 15>, <&spi_clk>;
clock-names = "s_axi_aclk", "spi_clk";
num-cs = <1>;

#address-cells = <0x1>;
#size-cells = <0x0>;

ad7985: adc@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "adi,pulsar,ad7985";
reg = <0>;
spi-max-frequency = <80000000>;
turbo-gpios = <&gpio0 87 GPIO_ACTIVE_HIGH>;
clocks = <&spi_clk>;
clock-names = "ref_clk";
dmas = <&rx_dma 0>;
dma-names = "rx";
pwms = <&adc_trigger 0 0>;
pwm-names = "cnv";
vref-supply = <&vref>;
channel@0 {
reg = <0>;
diff-channels = <0 1>;
};
};
};
};
100 changes: 100 additions & 0 deletions arch/arm/boot/dts/zynq-zed-adv7511-ad7986.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Analog Devices AD7986
* https://www.analog.com/en/products/ad7986.html
*
* hdl_project: <pulsar_adc_pmdz/zed>
* board_revision: <>
*
* Copyright (C) 2023 Analog Devices Inc.
*/
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

#include "zynq-zed.dtsi"
#include "zynq-zed-adv7511.dtsi"

/ {
vref: ad7986-internal-reference-regulator {
compatible = "regulator-fixed";
regulator-name = "AD7986 internal reference";
regulator-min-microvolt = <4096000>;
regulator-max-microvolt = <4096000>;
regulator-always-on;
};
};

&fpga_axi {
adc_trigger: pwm@44b00000 {
compatible = "adi,axi-pwmgen";
reg = <0x44b00000 0x1000>;
label = "adc_conversion_trigger";
#pwm-cells = <2>;
clocks = <&spi_clk>;
};

rx_dma: rx-dmac@44a30000 {
compatible = "adi,axi-dmac-1.00.a";
reg = <0x44a30000 0x1000>;
#dma-cells = <1>;
interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 17>;

adi,channels {
#size-cells = <0>;
#address-cells = <1>;

dma-channel@0 {
reg = <0>;
adi,source-bus-width = <32>;
adi,source-bus-type = <1>;
adi,destination-bus-width = <64>;
adi,destination-bus-type = <0>;
};
};
};

spi_clk: clock-controller@44a70000 {
compatible = "adi,axi-clkgen-2.00.a";
reg = <0x44a70000 0x1000>;
#clock-cells = <0>;
clocks = <&clkc 15>, <&clkc 15>;
clock-names = "s_axi_aclk", "clkin1";
clock-output-names = "spi_clk";
};

axi_spi_engine_0: spi@44a00000 {
compatible = "adi,axi-spi-engine-1.00.a";
reg = <0x44a00000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 15>, <&spi_clk>;
clock-names = "s_axi_aclk", "spi_clk";
num-cs = <1>;

#address-cells = <0x1>;
#size-cells = <0x0>;

ad7986: adc@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "adi,pulsar,ad7986";
reg = <0>;
spi-max-frequency = <80000000>;
turbo-gpios = <&gpio0 87 GPIO_ACTIVE_HIGH>;
clocks = <&spi_clk>;
clock-names = "ref_clk";
dmas = <&rx_dma 0>;
dma-names = "rx";
pwms = <&adc_trigger 0 0>;
pwm-names = "cnv";
vref-supply = <&vref>;
channel@0 {
reg = <0>;
diff-channels = <0 1>;
};
};
};
};
Loading