AD4134
AD4134 ADC Linux Driver.
Supported Devices
Evaluation Boards
HDL Reference Designs
Supported FPGA carriers
Source Code
Status
Source |
Mainlined? |
|---|---|
[No] |
Files
Function |
File |
|
|---|---|---|
driver |
||
device tree bindings |
||
device tree bindings |
Documentation/devicetree/bindings/iio/adc/adi,ad4134-spi-engine.yaml |
|
devicetree |
||
devicetree |
||
devicetree |
||
devicetree |
||
devicetree |
||
devicetree |
||
devicetree |
||
devicetree |
||
devicetree |
Adding Linux driver support
Kernel configuration
Configure kernel with make menuconfig (alternatively use make xconfig or
make qconfig)
Note
The AD4134 Driver depends on CONFIG_SPI
Linux Kernel Configuration
Device Drivers --->
...
<*> Industrial I/O support --->
--- Industrial I/O support
...
Analog to digital converters --->
...
<*> Analog Devices AD4134 ADC driver
...
...
...
Quick Start Guide
Flash Kuiper Linux to the SD card
Install Kuiper Linux to the SD card. Step by step guides for imaging Kuiper are available at ADI Kuiper Linux.
Configuring the SD Card
The boot-file matrix below applies to the eval-ad7134fmcz-review branch.
The main driver supports four parallel channels with 24-bit+CRC packets only.
Use kernel, devicetree and HDL artifacts from the same release.
Follow the Configuring the SD Card for FPGA Projects section of the Kuiper page.
Copy the following files onto the BOOT partition to configure the SD card:
BOOT.BIN: Binary blob file which includes first stage boot loader and FPGA bitstream.
devicetree.dtb: Binary blob containing the specification of what hardware is present in the system.
uImage: Linux kernel image is the computer program that provides OS functionality.
Get BOOT.BIN from HDL project
To achieve high performance with AD4134 and similar ADCs, the hardware platform must have an integrated FPGA. To configure the FPGA to properly support them, ADI engineers provide HDL reference projects from which one may use ad4134_fmc, ad7134_fmc, or cn0561.
Follow the build instructions on the Build an HDL project page to build the appropriate HDL project and generate a BOOT.BIN file from that.
Get uImage and devicetree.dtb from Linux project
Follow the Linux build guide to build a new Linux kernel image and devicetree blob. After that, replace Kuiper Linux image with the newly built uImage and copy the proper .dtb file your platform to the BOOT partition as devicetree.dtb.
Driver testing
Each and every IIO device, typically a hardware chip, has a device folder under
/sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under
every of these directory folders reside a set of files, depending on the
characteristics and features of the hardware device in question. These files
are consistently generalized and documented in the IIO ABI documentation. In
order to determine which IIO deviceX corresponds to which hardware device, the
user can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case
the sequence in which the iio device drivers are loaded/registered is constant,
the numbering is constant and may be known in advance.
Tip
An example program whiroot@analog:/sys/bus/iio/devices# ls -lch uses the interface can be found here:
Identify the device
root@analog:~# cat /sys/bus/iio/devices/iio:device0/name
ad4134
Show channel scale
Basic operation
Show channel scale
Description: Scale for signed 24-bit samples from the IIO buffer, in
millivolts/code. There is no in_voltageX_raw attribute.
root@analog:~# cat /sys/bus/iio/devices/iio:device0/in_voltage_scale
0.000488281
Inspect the IIO device sysfs interface. The driver exposes only the shared
in_voltage_scale, in_voltage_sampling_frequency and
in_voltage_sampling_frequency_available channel attributes. The sampling
frequency range is [10 1 1496000] Hz and defaults to 300000 Hz; stop the
buffer before changing it (writes fail while buffered capture is enabled).
root@analog:~# ls -l /sys/bus/iio/devices/iio:device0/
total 0
drwxr-xr-x 2 root root 0 Feb 27 11:39 buffer
drwxr-xr-x 2 root root 0 Feb 27 11:39 buffer0
-r--r--r-- 1 root root 4096 Feb 27 11:39 dev
-rw-r--r-- 1 root root 4096 Feb 27 14:11 in_voltage_sampling_frequency
-r--r--r-- 1 root root 4096 Feb 27 11:39 in_voltage_sampling_frequency_available
-rw-r--r-- 1 root root 4096 Feb 27 11:39 in_voltage_scale
-r--r--r-- 1 root root 4096 Feb 27 11:39 name
lrwxrwxrwx 1 root root 0 Feb 27 11:39 of_node -> ../../../../../../../../firmware/devicetree/base/axi/spi@e0006000/adc@0
drwxr-xr-x 2 root root 0 Feb 27 11:39 power
drwxr-xr-x 2 root root 0 Feb 27 11:39 scan_elements
lrwxrwxrwx 1 root root 0 Feb 27 11:39 subsystem -> ../../../../../../../../bus/iio
-rw-r--r-- 1 root root 4096 Feb 27 11:39 uevent
-r--r--r-- 1 root root 4096 Feb 27 11:39 waiting_for_supplier