dt-bindings: iio: adc: ad7768-1: add trigger-sources property
In addition to GPIO synchronization, The AD7768-1 also supports synchronization over SPI, which use is recommended when the GPIO cannot provide a pulse synchronous with the base MCLK signal. It consists of looping back the SYNC_OUT to the SYNC_IN pin and send a command via SPI to trigger the synchronization. Introduce the 'trigger-sources' property to enable SPI-based synchronization via SYNC_OUT pin, along with additional optional entries for GPIO3 and DRDY pins. Also create #trigger-source-cells property to differentiate the trigger sources provided by the ADC. To improve readability, create a adi,ad7768-1.h header with the macros for the cell values. While at it, add description to the interrupts property. Acked-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: David Lechner <dlechner@baylirbe.com> Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com> Link: https://patch.msgid.link/713fd786010c75858700efaec8bb285274e7057e.1749569957.git.Jonathan.Santos@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
1c01c449e3
commit
1905e6c9ce
@@ -26,7 +26,26 @@ properties:
|
||||
clock-names:
|
||||
const: mclk
|
||||
|
||||
trigger-sources:
|
||||
$ref: /schemas/types.yaml#/definitions/phandle-array
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
description: |
|
||||
A list of phandles referencing trigger source providers. Each entry
|
||||
represents a trigger source for the ADC:
|
||||
|
||||
- First entry specifies the device responsible for driving the
|
||||
synchronization (SYNC_IN) pin, as an alternative to adi,sync-in-gpios.
|
||||
This can be a `gpio-trigger` or another `ad7768-1` device. If the
|
||||
device's own SYNC_OUT pin is internally connected to its SYNC_IN pin,
|
||||
reference the device itself or omit this property.
|
||||
- Second entry optionally defines a GPIO3 pin used as a START signal trigger.
|
||||
|
||||
Use the accompanying trigger source cell to identify the type of each entry.
|
||||
|
||||
interrupts:
|
||||
description:
|
||||
DRDY (Data Ready) pin, which signals conversion results are available.
|
||||
maxItems: 1
|
||||
|
||||
'#address-cells':
|
||||
@@ -70,6 +89,15 @@ properties:
|
||||
"#io-channel-cells":
|
||||
const: 1
|
||||
|
||||
"#trigger-source-cells":
|
||||
description: |
|
||||
Cell indicates the trigger output signal: 0 = SYNC_OUT, 1 = GPIO3,
|
||||
2 = DRDY.
|
||||
|
||||
For better readability, macros for these values are available in
|
||||
dt-bindings/iio/adc/adi,ad7768-1.h.
|
||||
const: 1
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
"#gpio-cells":
|
||||
@@ -86,7 +114,16 @@ required:
|
||||
- vref-supply
|
||||
- spi-cpol
|
||||
- spi-cpha
|
||||
- adi,sync-in-gpios
|
||||
|
||||
dependencies:
|
||||
adi,sync-in-gpios:
|
||||
not:
|
||||
required:
|
||||
- trigger-sources
|
||||
trigger-sources:
|
||||
not:
|
||||
required:
|
||||
- adi,sync-in-gpios
|
||||
|
||||
patternProperties:
|
||||
"^channel@([0-9]|1[0-5])$":
|
||||
|
||||
@@ -1490,6 +1490,7 @@ S: Supported
|
||||
W: https://ez.analog.com/linux-software-drivers
|
||||
F: Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
|
||||
F: drivers/iio/adc/ad7768-1.c
|
||||
F: include/dt-bindings/iio/adc/adi,ad7768-1.h
|
||||
|
||||
ANALOG DEVICES INC AD7780 DRIVER
|
||||
M: Michael Hennerich <Michael.Hennerich@analog.com>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
|
||||
|
||||
#ifndef _DT_BINDINGS_ADI_AD7768_1_H
|
||||
#define _DT_BINDINGS_ADI_AD7768_1_H
|
||||
|
||||
#define AD7768_TRIGGER_SOURCE_SYNC_OUT 0
|
||||
#define AD7768_TRIGGER_SOURCE_GPIO3 1
|
||||
#define AD7768_TRIGGER_SOURCE_DRDY 2
|
||||
|
||||
#endif /* _DT_BINDINGS_ADI_AD7768_1_H */
|
||||
Reference in New Issue
Block a user