Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
78bd02a
i3c: master: Add driver for Analog Devices I3C Controller IP
gastmaier Aug 27, 2025
8620dda
i3c: master: adi: fix header location
alexandrebelloni Sep 16, 2025
e2603b6
i3c: master: adi: fix number of bytes written to fifo
alexandrebelloni Sep 24, 2025
972f4f3
i3c: adi: Fix confusing cleanup.h syntax
krzk Dec 8, 2025
97c34a7
i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo()
gastmaier Jun 24, 2025
8ae4b5d
i3c: fix big-endian FIFO transfers
arndb Sep 24, 2025
8abcae3
i3c: add missing include to internal header
Jul 17, 2025
9734086
bitops: add generic parity calculation for u8
Jan 7, 2025
08cda57
dt-bindings: iio: adc: Add adi,ad4062
gastmaier Dec 17, 2025
bf93521
docs: iio: New docs for ad4062 driver
gastmaier Dec 17, 2025
feba934
iio: adc: Add support for ad4062
gastmaier Dec 17, 2025
7296709
docs: iio: ad4062: Add IIO Trigger support
gastmaier Dec 17, 2025
cd5c2b0
iio: adc: ad4062: Add IIO Trigger support
gastmaier Dec 17, 2025
7e67e96
docs: iio: ad4062: Add IIO Events support
gastmaier Dec 17, 2025
d3a23cf
iio: adc: ad4062: Add IIO Events support
gastmaier Dec 17, 2025
2575206
docs: iio: ad4062: Add GPIO Controller support
gastmaier Dec 17, 2025
2ffbbb3
iio: adc: ad4062: Add GPIO Controller support
gastmaier Dec 17, 2025
b906ffe
iio: adc: ad4062: Add missing IS_ERR() check
Feb 14, 2026
502ee73
iio: adc: ad4062: Replace IRQF_ONESHOT with IRQF_NO_THREAD
outman119 Feb 23, 2026
be92f39
Kconfig.adi: imply I3C and ADI_I3C_MASTER
gastmaier Mar 23, 2026
f611bc6
iio: Kconfig.adi: imply AD4062 and IIO_REGMAP_I3C
gastmaier Mar 13, 2026
c1cac96
arm: dts: xilinx: Add dts for AD4060 on cora
gastmaier Mar 13, 2026
407d5e6
arm: dts: xilinx: Add dts for AD4062 on cora
gastmaier Mar 13, 2026
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
120 changes: 120 additions & 0 deletions Documentation/devicetree/bindings/iio/adc/adi,ad4062.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# 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,ad4062.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD4062 ADC family device driver

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

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

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

properties:
compatible:
enum:
- adi,ad4060
- adi,ad4062

reg:
maxItems: 1

interrupts:
description:
Two pins are available that can be configured as either a general purpose
digital output, device enable signal (used to synchronise other parts of
the signal chain with ADC sampling), device ready (GP1 only) or various
interrupt signals. If intended for use as a GPIO or device enable, will not
present here.
minItems: 1
items:
- description:
GP0 pin, cannot be configured as DEV_RDY.
- description:
GP1 pin, can be configured to any setting.

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

gpio-controller:
description:
Marks the device node as a GPIO controller. GPs not listed as interrupts
are exposed as a GPO.

'#gpio-cells':
const: 2
description:
The first cell is the GPIO number and the second cell specifies
GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.

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/i3c/i3c.yaml#

unevaluatedProperties: false

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

i3c {
#address-cells = <3>;
#size-cells = <0>;

adc@0,2ee007c0000 {
reg = <0x0 0x2ee 0x7c0000>;
vdd-supply = <&vdd>;
vio-supply = <&vio>;
ref-supply = <&ref>;

interrupt-parent = <&gpio>;
interrupts = <0 0 IRQ_TYPE_EDGE_RISING>,
<0 1 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = "gp0", "gp1";
};
};

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

i3c {
#address-cells = <3>;
#size-cells = <0>;

adc@0,2ee007c0000 {
reg = <0x0 0x2ee 0x7c0000>;
vdd-supply = <&vdd>;
vio-supply = <&vio>;
ref-supply = <&ref>;

gpio-controller;
#gpio-cells = <2>;
};
};
148 changes: 148 additions & 0 deletions Documentation/iio/ad4062.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
.. SPDX-License-Identifier: GPL-2.0-only

=============
AD4062 driver
=============

ADC driver for Analog Devices Inc. AD4060/AD4062 devices. The module name is
``ad4062``.

Supported devices
=================

The following chips are supported by this driver:

* `AD4060 <https://www.analog.com/AD4060>`_
* `AD4062 <https://www.analog.com/AD4062>`_

Wiring modes
============

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:

- GP0: Is assigned the role of Threshold Either signal.
- GP1: Is assigned the role of Data Ready signal.

If the property ``gpio-controller`` is present in the devicetree, then the GPO
not present in the ``interrupt-names`` is exposed as a GPO.

Device attributes
=================

The ADC contains only one channel with following attributes:

.. list-table:: Channel attributes
:header-rows: 1

* - Attribute
- Description
* - ``in_voltage_calibscale``
- Sets the gain scaling factor that the hardware applies to the sample,
to compensate for system gain error.
* - ``in_voltage_oversampling_ratio``
- Sets device's burst averaging mode to over sample using the
internal sample rate. Value 1 disable the burst averaging mode.
* - ``in_voltage_oversampling_ratio_available``
- List of available oversampling values.
* - ``in_voltage_raw``
- Returns the raw ADC voltage value.
* - ``in_voltage_scale``
- Returns the channel scale in reference to the reference voltage
``ref-supply`` or ``vdd-supply`` if the former not present.

Also contain the following device attributes:

.. list-table:: Device attributes
:header-rows: 1

* - Attribute
- Description
* - ``sampling_frequency``
- Sets the duration of a single scan, used in the burst averaging mode.
The duration is described by ``(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_available``
- Lists the available sampling frequencies, computed on the current
oversampling ratio. If the ratio is 1, the frequency is ``1/tconv``.

Interrupts
==========

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.

Low-power mode
==============

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.

IIO trigger support
===================

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.

Threshold events
================

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

* - Attribute
- Description
* - ``sampling_frequency``
- Frequency used in the monitoring mode, sets the device internal sample
rate when the mode is activated.
* - ``sampling_frequency_available``
- List of available sample rates.
* - ``thresh_either_en``
- Enable monitoring mode.
* - ``thresh_falling_hysteresis``
- Set the hysteresis value for the minimum threshold.
* - ``thresh_falling_value``
- Set the minimum threshold value.
* - ``thresh_rising_hysteresis``
- Set the hysteresis value for the maximum threshold.
* - ``thresh_rising_value``
- Set the maximum threshold value.

GPO controller support
======================

The 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.
1 change: 1 addition & 0 deletions Documentation/iio/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Industrial I/O Kernel Drivers

ad3552r
ad4000
ad4062
ad4695
ad7191
ad7380
Expand Down
2 changes: 2 additions & 0 deletions Kconfig.adi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
config KERNEL_ALL_ADI_DRIVERS
tristate "Build all Analog Devices Kernel Drivers"
imply SPI
imply I3C
imply I2C
imply IIO
imply PWM
Expand Down Expand Up @@ -40,6 +41,7 @@ config KERNEL_ALL_ADI_DRIVERS
imply USB_ALL_ADI_DRIVERS
imply POWER_RESET_LTC2952
imply CHARGER_ADP5061
imply ADI_I3C_MASTER
imply I2C_MUX_LTC4306
imply CHARGER_LT3651
imply BATTERY_GAUGE_LTC2941
Expand Down
14 changes: 14 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,14 @@ F: Documentation/devicetree/bindings/iio/adc/adi,ad4000.yaml
F: Documentation/iio/ad4000.rst
F: drivers/iio/adc/ad4000.c

ANALOG DEVICES INC AD4062 DRIVER
M: Jorge Marques <jorge.marques@analog.com>
S: Supported
W: https://ez.analog.com/linux-software-drivers
F: Documentation/devicetree/bindings/iio/adc/adi,ad4062.yaml
F: Documentation/iio/ad4062.rst
F: drivers/iio/adc/ad4062.c

ANALOG DEVICES INC AD4130 DRIVER
M: Cosmin Tanislav <cosmin.tanislav@analog.com>
L: linux-iio@vger.kernel.org
Expand Down Expand Up @@ -10918,6 +10926,12 @@ S: Maintained
F: Documentation/devicetree/bindings/i3c/aspeed,ast2600-i3c.yaml
F: drivers/i3c/master/ast2600-i3c-master.c

I3C DRIVER FOR ANALOG DEVICES I3C CONTROLLER IP
M: Jorge Marques <jorge.marques@analog.com>
S: Maintained
F: Documentation/devicetree/bindings/i3c/adi,i3c-master.yaml
F: drivers/i3c/master/adi-i3c-master.c

I3C DRIVER FOR CADENCE I3C MASTER IP
M: Przemysław Gaj <pgaj@cadence.com>
S: Maintained
Expand Down
75 changes: 75 additions & 0 deletions arch/arm/boot/dts/xilinx/zynq-coraz7s-ad4060.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Analog Devices AD4060
*
* hdl_project: <ad4062_ardz/coraz7s>
* Link: https://github.com/analogdevicesinc/hdl/tree/main/projects/ad4062_ardz
* board_revision: <A>
*
* Copyright (C) 2026 Analog Devices Inc.
*/
/dts-v1/;
#include "zynq-coraz7s.dtsi"
#include "zynq-coraz7s-axi-sysid.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>

/ {
vdd: regulator-vdd {
compatible = "regulator-fixed";
regulator-name = "vdd-fixed-supply";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};

vio: regulator-vio {
compatible = "regulator-fixed";
regulator-name = "vio-fixed-supply";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};

ref: regulator-ref {
compatible = "regulator-fixed";
regulator-name = "ref-fixed-supply";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
};

&fpga_axi {
i3c_master: i3c-master@44a00000 {
compatible = "adi,i3c-master-v1";
reg = <0x44a00000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc 15>;
clock-names = "axi";

#address-cells = <3>;
#size-cells = <0>;

eeprom1: eeprom@52 {
compatible = "atmel,24c32";
reg = <0x52 0x0 0x10>;
};

ad4060: adc@0,2ee007a0000 {
/* Ensure to update the PID (e.g. <0x0 0x2ee 0x707000> */
reg = <0x0 0x2ee 0x7a0000>;
/* Just for ACE, Linux uses the PID */
compatible = "adi,ad4060";
vdd-supply = <&vdd>;
vio-supply = <&vio>;
ref-supply = <&ref>;

interrupt-parent = <&gpio0>;
interrupts = <86 IRQ_TYPE_EDGE_RISING>,
<87 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = "gp0", "gp1";
};
};
};
Loading
Loading