Documentation/iio/ad4062.rst
.. SPDX-License-Identifier: GPL-2.0-only
ADC driver for Analog Devices Inc. AD4060/AD4062 devices. The module name is
ad4062.
The following chips are supported by this driver:
AD4060 <https://www.analog.com/AD4060>_AD4062 <https://www.analog.com/AD4062>_The ADC is interfaced through an I3C bus, and contains two programmable GPIOs.
The ADC convert-start happens on the SDA rising edge of the I3C stop (P) bit at the end of the read command.
The two programmable GPIOS are optional and have a role assigned if present in
the devicetree interrupt-names property:
If the property gpio-controller is present in the devicetree, then the GPO
not present in the interrupt-names is exposed as a GPO.
The ADC contains only one channel with following attributes:
.. list-table:: Channel attributes :header-rows: 1
in_voltage_calibscalein_voltage_oversampling_ratioin_voltage_oversampling_ratio_availablein_voltage_rawin_voltage_scaleref-supply or vdd-supply if the former not present.Also contain the following device attributes:
.. list-table:: Device attributes :header-rows: 1
sampling_frequency(n_avg - 1) / fosc + tconv, where
n_avg is the oversampling ratio, fosc is the internal sample
rate and tconv is the ADC conversion time.sampling_frequency_available1/tconv.The interrupts are mapped through the interrupt-names and interrupts
properties.
The interrupt-names gp0 entry sets the role of Threshold signal, and
entry gp1 the role of Data Ready signal.
If each is not present, the driver fallback to enabling the same role as an I3C IBI.
The device enters low-power mode on idle to save power. Enabling an event puts the device out of the low-power since the ADC autonomously samples to assert the event condition.
An IIO trigger ad4062-devX is registered by the driver to be used by the
same device, to capture samples to a software buffer. It is required to attach
the trigger to the device by setting the current_trigger before enabling
and reading the buffer.
The acquisition is sequential and bounded by the protocol timings, software latency and internal timings, the sample rate is not configurable. The burst averaging mode does impact the effective sample rate, since it increases the internal timing to output a single sample.
The ADC supports a monitoring mode to raise threshold events. The driver supports a single interrupt for both rising and falling readings.
The feature is enabled/disabled by setting thresh_either_en. During monitor
mode, the device continuously operates in autonomous mode. Any register access
puts the device back in configuration mode, due to this, any access disables
monitor mode.
The following event attributes are available:
.. list-table:: Event attributes :header-rows: 1
sampling_frequencysampling_frequency_availablethresh_either_enthresh_falling_hysteresisthresh_falling_valuethresh_rising_hysteresisthresh_rising_valueThe device supports using GP0 and GP1 as GPOs. If the devicetree contains the
node gpio-controller```, the device is marked as a GPIO controller and the GPs not listed in interrupt-names`` are exposed as a GPO. The GPIO index
matches the pin name, so if GP0 is not exposed but GP1 is, index 0 is masked
out and only index 1 can be set.