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 AD7191 #2655

Draft
wants to merge 2 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
134 changes: 134 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,ad7191.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2024 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad7191.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD7191 ADC device driver

maintainers:
- Alisa-Dariana Roman <[email protected]>

description: |
Bindings for the Analog Devices AD7191 ADC device. Datasheet can be
found here:
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7191.pdf

properties:
compatible:
enum:
- adi,ad7191

reg:
maxItems: 1

spi-cpol: true

spi-cpha: true

clocks:
maxItems: 1
description:
Optionally, either a crystal can be attached externally between MCLK1 and
MCLK2 pins, or an external CMOS-compatible clock can drive the MCLK2
pin. If absent, internal 4.92MHz clock is used.

interrupts:
maxItems: 1

avdd-supply:
description: AVdd voltage supply

dvdd-supply:
description: DVdd voltage supply

vref-supply:
description: Vref voltage supply

pdown-gpios:
description: GPIO connected to PDOWN pin for power-down/reset control
maxItems: 1

odr1-gpios:
description: GPIO connected to ODR1 pin for output data rate selection
maxItems: 1

odr2-gpios:
description: GPIO connected to ODR2 pin for output data rate selection
maxItems: 1

pga1-gpios:
description: GPIO connected to PGA1 pin for gain selection
maxItems: 1

pga2-gpios:
description: GPIO connected to PGA2 pin for gain selection
maxItems: 1

temp-gpios:
description: GPIO connected to TEMP pin for temperature sensor enable
maxItems: 1

chan-gpios:
description: GPIO connected to CHAN pin for input channel selection
maxItems: 1

clksel-gpios:
description: GPIO connected to CLKSEL pin for clock source selection
maxItems: 1

required:
- compatible
- reg
- interrupts
- avdd-supply
- dvdd-supply
- vref-supply
- spi-cpol
- spi-cpha
- pdown-gpios
- odr1-gpios
- odr2-gpios
- pga1-gpios
- pga2-gpios
- temp-gpios
- chan-gpios
- clksel-gpios

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

unevaluatedProperties: false

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

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

adc@0 {
compatible = "adi,ad7191";
reg = <0>;
spi-max-frequency = <1000000>;
spi-cpol;
spi-cpha;
clocks = <&ad7191_mclk>;
interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpio>;
avdd-supply = <&avdd>;
dvdd-supply = <&dvdd>;
vref-supply = <&vref>;
pdown-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
odr1-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
odr2-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
pga1-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
pga2-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
temp-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
chan-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
clksel-gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
};
};
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,14 @@ F: Documentation/iio/ad4695.rst
F: drivers/iio/adc/ad4695.c
F: include/dt-bindings/iio/adi,ad4695.h

ANALOG DEVICES INC AD7191 DRIVER
M: Alisa-Dariana Roman <[email protected]>
L: [email protected]
S: Supported
W: https://ez.analog.com/linux-software-drivers
F: Documentation/devicetree/bindings/iio/adc/adi,ad7191.yaml
F: drivers/iio/adc/ad7191.c

ANALOG DEVICES INC AD7192 DRIVER
M: Alexandru Tachici <[email protected]>
L: [email protected]
Expand Down
11 changes: 11 additions & 0 deletions drivers/iio/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ config AD7173
To compile this driver as a module, choose M here: the module will be
called ad7173.

config AD7191
tristate "Analog Devices AD7191 ADC driver"
depends on SPI
select AD_SIGMA_DELTA
help
Say yes here to build support for Analog Devices AD7191.
If unsure, say N (but it's safe to say "Y").

To compile this driver as a module, choose M here: the
module will be called ad7191.

config AD7192
tristate "Analog Devices AD7190 AD7192 AD7193 AD7195 ADC driver"
depends on SPI
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/adc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ obj-$(CONFIG_AD7091R5) += ad7091r5.o
obj-$(CONFIG_AD7091R8) += ad7091r8.o
obj-$(CONFIG_AD7124) += ad7124.o
obj-$(CONFIG_AD7173) += ad7173.o
obj-$(CONFIG_AD7191) += ad7191.o
obj-$(CONFIG_AD7192) += ad7192.o
obj-$(CONFIG_AD7266) += ad7266.o
obj-$(CONFIG_AD7280) += ad7280a.o
Expand Down
Loading
Loading