Skip to content

Add support for ADA4355 #2806

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
99 changes: 99 additions & 0 deletions arch/arm/boot/dts/xilinx/zynq-zed-adv7511-ada4355.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Analog Devices ada4355
*
* hdl_project: <ada4355_fmc/zed>
* board_revision: <>
*
* Copyright (C) 2025 Analog Devices Inc.
*/
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>

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

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

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

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

ada4355: ada4355@44a00000 {
compatible = "adi,axi-adc-10.0.a";
reg = <0x44A00000 0x10000>;
dmas = <&rx_dma 0>;
dma-names = "rx";

spibus-connected = <&adc_ada4355>;
};
};

&spi0 {
status = "okay";
};

#define fmc_spi spi0

/ {
ada4355_fixed_clock: ada4355_fixed_clock{
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <125000000>;
};

gpio-control@0 {
compatible = "adi,one-bit-adc-dac";
#address-cells = <1>;
#size-cells = <0>;
out-gpios = <&gpio0 86 GPIO_ACTIVE_HIGH>,
<&gpio0 87 GPIO_ACTIVE_HIGH>,
<&gpio0 88 GPIO_ACTIVE_HIGH>;

channel@0 {
reg = <0>;
label = "GSEL0";
};
channel@1 {
reg = <1>;
label = "GSEL1";
};
channel@2 {
reg = <2>;
label = "FSEL";
};
};
};

&fmc_spi {

adc_ada4355: adc_ada4355@0 {
compatible = "adi,ada4355";
reg = <0>;
spi-max-frequency = <100000>;
gpio-1p8vd-en-gpios = <&gpio0 89 GPIO_ACTIVE_HIGH>;

clocks = <&ada4355_fixed_clock>;
clock-names = "adc_clk";
num_lanes = <2>;
spi-cpol;
spi-cpha;
};
};
1 change: 1 addition & 0 deletions drivers/iio/Kconfig.adi
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

# This file exists solely to be include in Kconfig.adi
# It's a bit of hurry-ed-up job; many symbols need to be depended
Expand Down Expand Up @@ -91,6 +91,7 @@
imply LTC2387
imply AD8366
imply ADA4250
imply ADA4355
imply HMC425
imply AD5270
imply AD5360
Expand Down
12 changes: 12 additions & 0 deletions drivers/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,18 @@ config ADAQ8092
To compile this driver as a module, choose M here: the
module will be called adaq8092.


config ADA4355
tristate "Analog Devices ADA4355 uModule Data Acquisition Module"
depends on SPI
Copy link
Contributor

@gastmaier gastmaier May 30, 2025

Choose a reason for hiding this comment

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

edit: my comment looks into why it was lacking symbols, nuno suggestion is the correct solution.

Suggested change
depends on SPI
depends on SPI
depends on CF_AXI_ADC

The driver uses axiadc_write and axiadc_read, exported from cf_axi_adc_core.c, enabled with CF_AXI_ADC.
So the driver depends on this symbol as well.
Without this change, it cannot be compiled as a module without blindly enabling symbols.
This is an issue in other drivers.

For curiosity, we have now a script that resolves the tree of depends in the KConfig based on a target:

$ python3 ci/symbols_depend.py drivers/iio/adc/ada4355.o
Symbols of touched files:
{'ADA4355'}
Resolved symbols:
{'PCI', 'IIO_BUFFER', 'HAS_IOMEM', 'HAVE_PCI', 'ADA4355', 'SPI', 'IIO'}

as committed, it lacks the CF_AXI_ADC symbol.

depends on CF_AXI_ADC
select REGMAP_SPI
help
Say yes here to build support for Analog Devices ADA4355
14-bit, 125MSPS, high-speed dual-channel analog to digital
converters (ADC) that realize a complete current to bits data
acquisition solution. Provides direct access via sysfs.

config ADM1177
tristate "Analog Devices ADM1177 Digital Power Monitor driver"
depends on I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/adc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ obj-$(CONFIG_AD799X) += ad799x.o
obj-$(CONFIG_ADI_AXI_ADC) += adi-axi-adc.o
obj-$(CONFIG_AD9963) += ad9963.o
obj-$(CONFIG_ADAQ8092) += adaq8092.o
obj-$(CONFIG_ADA4355) += ada4355.o
obj-$(CONFIG_ADM1177) += adm1177.o

cf_axi_adc-y := cf_axi_adc_core.o
Expand Down
Loading
Loading