-
Notifications
You must be signed in to change notification settings - Fork 882
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
gastmaier
wants to merge
36
commits into
mirror/jic23/iio/testing
Choose a base branch
from
staging/ad4052
base: mirror/jic23/iio/testing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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 c5c6b30
iio: backend: add support for filter config
amiclaus c46cc3a
iio: backend: add support for data alignment
amiclaus 726a25a
iio: backend: add support for number of lanes
amiclaus d97bbdb
dt-bindings: iio: adc: add ad408x axi variant
amiclaus 00919f2
iio: adc: adi-axi-adc: add filter type config
amiclaus 1dbb7e2
iio: adc: adi-axi-adc: add data align process
amiclaus 7ee01a5
iio: adc: adi-axi-adc: add num lanes support
amiclaus 4e86385
dt-bindings: iio: adc: add ad4080
amiclaus 6cf15a4
iio: adc: ad4080: add driver support
amiclaus b783a70
Documentation: ABI: add sinc1 and sinc5+pf1 filter
amiclaus 9f6045b
iio: dac: adi-axi-dac: use unique bus free check
spectrum70 0ee7c87
iio: accel: adxl345: extend sample frequency adjustments
Rubusch e5330e6
iio: accel: adxl345: add g-range configuration
Rubusch baac509
iio: amplifiers: ada4250: use DMA-safe memory for regmap_bulk_read()
dlech 82bfa6f
iio: buffer: Fix checkpatch.pl warning
gye976 ee48e8b
iio: imu: inv_mpu6050: refactor aux read/write to use shared xfer logic
2c4832c
iio: Remove single use of macro definition for driver name
whame 48f1ee3
iio: Remove single use of macro definition for IRQ name
whame 094d8c4
iio: Remove single use of macro definition for regmap name
whame 420a320
iio: Remove unused macro definition for driver and IRQ name
whame 364a877
iio: adc: ad7476: Support ROHM BU79100G
M-Vaittinen f89c551
dt-bindings: iio: adc: st,spear600-adc: txt to yaml format conversion.
losgobbi d9fec51
iio: adc: ad7606: enable Vdrive power supply
spectrum70 ef5b2f3
iio: adc: ad7606: add enabling of optional Vrefin voltage
spectrum70 dcbe78e
iio: bmi270: suspend and resume triggering on relevant pm operations
NeroReflex 8bd4d29
iio: bmi160: suspend and resume triggering on relevant pm operations
NeroReflex fdcc7b4
Add support for AD4052 device family
gastmaier 027f6c2
Documentation: ABI: add oversampling frequency in sysfs-bus-iio
gastmaier 45384c4
dt-bindings: iio: adc: Add adi,ad4052
gastmaier ea9d418
docs: iio: New docs for ad4052 driver
gastmaier d0e80b6
iio: adc: Add support for ad4052
gastmaier 16c5eed
docs: iio: ad4052: Add offload support documentation
gastmaier 90237b3
iio: adc: Add offload support for ad4052
gastmaier 8603175
docs: iio: ad4052: Add event documentation
gastmaier eb96138
iio: adc: Add events support to ad4052
gastmaier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
Documentation/devicetree/bindings/iio/adc/adi,ad4052.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
gastmaier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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>; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; | ||
}; | ||
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
Documentation/devicetree/bindings/iio/adc/st,spear600-adc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.