Skip to content

Add support for AD4052 ADC Family #2642

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 36 commits into
base: mirror/jic23/iio/testing
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cc3451c
iio: irsd200: Remove print of error code from dev_err_probe
whame May 16, 2025
c5c6b30
iio: backend: add support for filter config
amiclaus May 16, 2025
c46cc3a
iio: backend: add support for data alignment
amiclaus May 16, 2025
726a25a
iio: backend: add support for number of lanes
amiclaus May 16, 2025
d97bbdb
dt-bindings: iio: adc: add ad408x axi variant
amiclaus May 16, 2025
00919f2
iio: adc: adi-axi-adc: add filter type config
amiclaus May 16, 2025
1dbb7e2
iio: adc: adi-axi-adc: add data align process
amiclaus May 16, 2025
7ee01a5
iio: adc: adi-axi-adc: add num lanes support
amiclaus May 16, 2025
4e86385
dt-bindings: iio: adc: add ad4080
amiclaus May 16, 2025
6cf15a4
iio: adc: ad4080: add driver support
amiclaus May 16, 2025
b783a70
Documentation: ABI: add sinc1 and sinc5+pf1 filter
amiclaus May 16, 2025
9f6045b
iio: dac: adi-axi-dac: use unique bus free check
spectrum70 May 23, 2025
0ee7c87
iio: accel: adxl345: extend sample frequency adjustments
Rubusch May 10, 2025
e5330e6
iio: accel: adxl345: add g-range configuration
Rubusch May 10, 2025
baac509
iio: amplifiers: ada4250: use DMA-safe memory for regmap_bulk_read()
dlech Apr 18, 2025
82bfa6f
iio: buffer: Fix checkpatch.pl warning
gye976 May 19, 2025
ee48e8b
iio: imu: inv_mpu6050: refactor aux read/write to use shared xfer logic
May 7, 2025
2c4832c
iio: Remove single use of macro definition for driver name
whame May 27, 2025
48f1ee3
iio: Remove single use of macro definition for IRQ name
whame May 27, 2025
094d8c4
iio: Remove single use of macro definition for regmap name
whame May 27, 2025
420a320
iio: Remove unused macro definition for driver and IRQ name
whame May 27, 2025
364a877
iio: adc: ad7476: Support ROHM BU79100G
M-Vaittinen May 30, 2025
f89c551
dt-bindings: iio: adc: st,spear600-adc: txt to yaml format conversion.
losgobbi May 22, 2025
d9fec51
iio: adc: ad7606: enable Vdrive power supply
spectrum70 May 30, 2025
ef5b2f3
iio: adc: ad7606: add enabling of optional Vrefin voltage
spectrum70 May 30, 2025
dcbe78e
iio: bmi270: suspend and resume triggering on relevant pm operations
NeroReflex May 25, 2025
8bd4d29
iio: bmi160: suspend and resume triggering on relevant pm operations
NeroReflex May 25, 2025
fdcc7b4
Add support for AD4052 device family
gastmaier Mar 6, 2025
027f6c2
Documentation: ABI: add oversampling frequency in sysfs-bus-iio
gastmaier Mar 21, 2025
45384c4
dt-bindings: iio: adc: Add adi,ad4052
gastmaier Nov 1, 2024
ea9d418
docs: iio: New docs for ad4052 driver
gastmaier Feb 21, 2025
d0e80b6
iio: adc: Add support for ad4052
gastmaier Jun 1, 2025
16c5eed
docs: iio: ad4052: Add offload support documentation
gastmaier Jun 1, 2025
90237b3
iio: adc: Add offload support for ad4052
gastmaier Jun 3, 2025
8603175
docs: iio: ad4052: Add event documentation
gastmaier Jun 1, 2025
eb96138
iio: adc: Add events support to ad4052
gastmaier Jun 3, 2025
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
21 changes: 21 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-iio
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@ Contact: linux-iio@vger.kernel.org
Description:
Hardware dependent values supported by the oversampling filter.

What: /sys/bus/iio/devices/iio:deviceX/oversampling_frequency
KernelVersion: 6.17
Contact: linux-iio@vger.kernel.org
Description:
Some devices have internal clocks for oversampling.
Sets the resulting frequency in Hz to trigger a conversion used by
the oversampling filter.
If the device has a fixed internal clock or is computed based on
the sampling frequency parameter, the parameter is read only.

What: /sys/bus/iio/devices/iio:deviceX/oversampling_frequency_available
KernelVersion: 6.17
Contact: linux-iio@vger.kernel.org
Description:
Hardware dependent values supported by the oversampling
frequency.

What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_raw
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_raw
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_i_raw
Expand Down Expand Up @@ -2278,6 +2295,9 @@ Description:
Reading returns a list with the possible filter modes. Options
for the attribute:

* "none" - Filter is disabled/bypassed.
* "sinc1" - The digital sinc1 filter. Fast 1st
conversion time. Poor noise performance.
* "sinc3" - The digital sinc3 filter. Moderate 1st
conversion time. Good noise performance.
* "sinc4" - Sinc 4. Excellent noise performance. Long
Expand All @@ -2293,6 +2313,7 @@ Description:
* "sinc3+pf2" - Sinc3 + device specific Post Filter 2.
* "sinc3+pf3" - Sinc3 + device specific Post Filter 3.
* "sinc3+pf4" - Sinc3 + device specific Post Filter 4.
* "sinc5+pf1" - Sinc5 + device specific Post Filter 1.
* "wideband" - filter with wideband low ripple passband
and sharp transition band.

Expand Down
167 changes: 167 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,ad4052.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2025 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad4052.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD4052 ADC family device driver

maintainers:
- Jorge Marques <jorge.marques@analog.com>

description: |
Analog Devices AD4052 Single Channel Precision SAR ADC family

https://www.analog.com/media/en/technical-documentation/data-sheets/ad4050-ad4056.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad4052-ad4058.pdf

properties:
compatible:
enum:
- adi,ad4050
- adi,ad4052
- adi,ad4056
- adi,ad4058

reg:
maxItems: 1

interrupts:
items:
- description: Signal coming from the GP0 pin.
- description: Signal coming from the GP1 pin.

interrupt-names:
items:
- const: gp0
- const: gp1

cnv-gpios:
description: The Convert Input (CNV). If omitted, CNV is tied to SPI CS.
maxItems: 1

pwms:
maxItems: 1
description: PWM connected to the CNV pin.

trigger-sources:
minItems: 1
maxItems: 2
description:
Describes the output pin and event associated.

"#trigger-source-cells":
const: 2
description: |
Output pins used as trigger source.

Cell 0 defines the event:
* 0 = Data ready
* 1 = Min threshold
* 2 = Max threshold
* 3 = Either threshold
* 4 = CHOP control
* 5 = Device enable
* 6 = Device ready (only GP1)

Cell 1 defines which pin:
* 0 = GP0
* 1 = GP1

For convenience, macros for these values are available in
dt-bindings/iio/adc/adi,ad4052.h.

spi-max-frequency:
maximum: 83333333

vdd-supply:
description: Analog power supply.

vio-supply:
description: Digital interface logic power supply.

ref-supply:
description: |
Reference voltage to set the ADC full-scale range. If not present,
vdd-supply is used as the reference voltage.

required:
- compatible
- reg
- vdd-supply
- vio-supply

allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/iio/adc/adi,ad4052.h>

spi {
#address-cells = <1>;
#size-cells = <0>;

adc@0 {
compatible = "adi,ad4052";
reg = <0>;
vdd-supply = <&vdd>;
vio-supply = <&vio>;
ref-supply = <&ref>;
spi-max-frequency = <83333333>;

#trigger-source-cells = <2>;
trigger-sources = <&adc AD4052_TRIGGER_EVENT_EITHER_THRESH
AD4052_TRIGGER_PIN_GP0
&adc AD4052_TRIGGER_EVENT_DATA_READY
AD4052_TRIGGER_PIN_GP1>;
interrupt-parent = <&gpio>;
interrupts = <0 0 IRQ_TYPE_EDGE_RISING>,
<0 1 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = "gp0", "gp1";
cnv-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/iio/adc/adi,ad4052.h>

rx_dma {
#dma-cells = <1>;
};

spi {
#address-cells = <1>;
#size-cells = <0>;

dmas = <&rx_dma 0>;
dma-names = "offload0-rx";
trigger-sources = <&adc AD4052_TRIGGER_EVENT_DATA_READY
AD4052_TRIGGER_PIN_GP1>;

adc@0 {
compatible = "adi,ad4052";
reg = <0>;
vdd-supply = <&vdd>;
vio-supply = <&vio>;
spi-max-frequency = <83333333>;
pwms = <&adc_trigger 0 10000 0>;

#trigger-source-cells = <2>;
trigger-sources = <&adc AD4052_TRIGGER_EVENT_EITHER_THRESH
AD4052_TRIGGER_PIN_GP0
&adc AD4052_TRIGGER_EVENT_DATA_READY
AD4052_TRIGGER_PIN_GP1>;
interrupt-parent = <&gpio>;
interrupts = <0 0 IRQ_TYPE_EDGE_RISING>,
<0 1 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = "gp0", "gp1";
cnv-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
};
};
96 changes: 96 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,ad4080.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2025 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad4080.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD4080 20-Bit, 40 MSPS, Differential SAR ADC

maintainers:
- Antoniu Miclaus <antoniu.miclaus@analog.com>

description: |
The AD4080 is a high speed, low noise, low distortion, 20-bit, Easy Drive,
successive approximation register (SAR) analog-to-digital converter (ADC).
Maintaining high performance (signal-to-noise and distortion (SINAD) ratio
> 90 dBFS) at signal frequencies in excess of 1 MHz enables the AD4080 to
service a wide variety of precision, wide bandwidth data acquisition
applications.

https://www.analog.com/media/en/technical-documentation/data-sheets/ad4080.pdf

$ref: /schemas/spi/spi-peripheral-props.yaml#

properties:
compatible:
enum:
- adi,ad4080

reg:
maxItems: 1

spi-max-frequency:
description: Configuration of the SPI bus.
maximum: 50000000

clocks:
maxItems: 1

clock-names:
items:
- const: cnv

vdd33-supply: true

vdd11-supply: true

vddldo-supply: true

iovdd-supply: true

vrefin-supply: true

io-backends:
maxItems: 1

adi,lvds-cnv-enable:
description: Enable the LVDS signal type on the CNV pin. Default is CMOS.
type: boolean

adi,num-lanes:
description:
Number of lanes on which the data is sent on the output (DA, DB pins).
$ref: /schemas/types.yaml#/definitions/uint32
enum: [1, 2]
default: 1

required:
- compatible
- reg
- clocks
- clock-names
- vdd33-supply
- vrefin-supply

additionalProperties: false

examples:
- |
spi {
#address-cells = <1>;
#size-cells = <0>;

adc@0 {
compatible = "adi,ad4080";
reg = <0>;
spi-max-frequency = <10000000>;
vdd33-supply = <&vdd33>;
vddldo-supply = <&vddldo>;
vrefin-supply = <&vrefin>;
clocks = <&cnv>;
clock-names = "cnv";
io-backends = <&iio_backend>;
};
};
...
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,axi-adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ description: |
the ad7606 family.

https://wiki.analog.com/resources/fpga/docs/axi_adc_ip
https://analogdevicesinc.github.io/hdl/library/axi_ad408x/index.html
https://analogdevicesinc.github.io/hdl/library/axi_ad485x/index.html
http://analogdevicesinc.github.io/hdl/library/axi_ad7606x/index.html

properties:
compatible:
enum:
- adi,axi-adc-10.0.a
- adi,axi-ad408x
- adi,axi-ad7606x
- adi,axi-ad485x

Expand Down
69 changes: 69 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/st,spear600-adc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/st,spear600-adc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ST SPEAr ADC device driver

maintainers:
- Jonathan Cameron <jic23@kernel.org>

description: |
Integrated ADC inside the ST SPEAr SoC, SPEAr600, supporting
10-bit resolution. Datasheet can be found here:
https://www.st.com/resource/en/datasheet/spear600.pdf

properties:
compatible:
enum:
- st,spear600-adc

reg:
maxItems: 1

interrupts:
maxItems: 1

sampling-frequency:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 2500000
maximum: 20000000
description:
Default sampling frequency of the ADC in Hz.

vref-external:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 1000
maximum: 2800
description:
External voltage reference in milli-volts. If omitted the internal voltage
reference will be used.

average-samples:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 15
default: 0
description:
Number of samples to generate an average value. If omitted, single data
conversion will be used.

required:
- compatible
- reg
- interrupts
- sampling-frequency

additionalProperties: false

examples:
- |
adc@d8200000 {
compatible = "st,spear600-adc";
reg = <0xd8200000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <6>;
sampling-frequency = <5000000>;
vref-external = <2500>; /* 2.5V VRef */
};
Loading