ADRF6780

ADRF6780 5.9 GHz to 23.6 GHz, Wideband, Microwave Upconverter Linux Driver.

Supported Devices

Evaluation Boards

Description

This is a Linux industrial I/O (Linux Industrial I/O Subsystem) subsystem driver, targeting serial interface Microwave converters. The industrial I/O subsystem provides a unified framework for drivers for many different types of converters and sensors using a number of different physical interfaces (i2c, spi, etc). See Linux Industrial I/O Subsystem for more information.

Source Code

Status

Source

Mainlined?

ADI tree

Yes

Files

Function

File

driver

adrf6780.c

Documentation

Documentation/ABI/testing/sysfs-bus-iio

Unlike PCI or USB devices, SPI devices are not enumerated at the hardware level. Instead, the software must know which devices are connected on each SPI bus segment, and what slave selects these devices are using. For this reason, the kernel code must instantiate SPI devices explicitly. The most common method is to declare the SPI devices by bus number.

This method is appropriate when the SPI bus is a system bus, as in many embedded systems, wherein each SPI bus has a number which is known in advance. It is thus possible to pre-declare the SPI devices that inhabit this bus. This is done with an array of struct spi_board_info, which is registered by calling spi_register_board_info().

For more information see: Overview of Linux kernel SPI support

Hardware configuration

Use the device and evaluation-board documentation for physical wiring, power supplies and the LO connection.

Adding Linux driver support

Kernel configuration

Configure kernel with make menuconfig (alternatively use make xconfig or make qconfig)

Note

The ADRF6780 Driver depends on CONFIG_SPI

Linux Kernel Configuration
    Device Drivers  --->
        <*>     Industrial I/O support --->
            --- Industrial I/O support
                Frequency  --->
                    <*> Analog Devices ADRF6780 Microwave Upconverter

Devicetree configuration

Properties

compatible:

  • enum:

  • adi,adrf6780

reg:

  • maxItems: 1

spi-max-frequency:

  • minimum: 1000000

clocks:

  • description: Definition of the external clock (see clock/clock-bindings.txt)

  • minItems: 1

clock-names:

  • description: Must be lo_in

  • maxItems: 1

clock-output-names:

  • maxItems: 1

adi,vga-buff-en:

  • description: VGA Buffer Enable.

  • type: boolean

Detector enable is managed by the ADC conversion path. adi,det-en is not a Devicetree property consumed by this driver.

adi,lo-buff-en:

  • description: LO Buffer Enable.

  • type: boolean

adi,if-mode-en:

  • description: IF Mode Enable.

  • type: boolean

adi,iq-mode-en:

  • description: IQ Mode Enable.

  • type: boolean

adi,lo-x2-en:

  • description: LO x2 Enable.

  • type: boolean

adi,lo-ppf-en:

  • description: LO x1 Enable.

  • type: boolean

adi,lo-en:

  • description: LO Enable.

  • type: boolean

adi,uc-bias-en:

  • description: UC Bias Enable.

  • type: boolean

adi,lo-sideband:

  • description: Switch to the Other LO Sideband.

  • type: boolean

adi,vdet-out-en:

  • description: VDET Output Select Enable.

  • type: boolean

required:

  • compatible

  • reg

  • clocks

  • clock-names

Example

This example enables IQ operation with the LO x1 polyphase path. The LO clock provider supplies the input frequency.

&spi0 {
  #address-cells = <1>;
  #size-cells = <0>;
  adrf6780@0 {
    compatible = "adi,adrf6780";
    reg = <0>;
    spi-max-frequency = <1000000>;
    clocks = <&adrf6780_lo>;
    clock-names = "lo_in";
    adi,iq-mode-en;
    adi,lo-ppf-en;
    adi,lo-en;
    adi,lo-buff-en;
    adi,vga-buff-en;
    adi,uc-bias-en;
  };
};

Driver testing

Identify the device

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.

Select the IIO device whose name attribute is adrf6780.

cd /sys/bus/iio/devices/iio:device0
cat name
ls -l
root:/> cd /sys/bus/iio/devices/iio\:device0/
root:/> cat name
adrf6780

Read detector ADC

in_altvoltage0_raw is the read-only detector ADC code. A read enables the detector/ADC conversion path; it is not an output DAC raw value.

cat in_altvoltage0_raw

Set ChannelY Scale value

out_altvoltage0_scale controls the RDAC linearization register. Its value is an integer register code, not a multiplier for converting detector ADC raw samples to voltage.

set -eu
cat out_altvoltage0_scale
echo 1 > out_altvoltage0_scale
cat out_altvoltage0_scale

Set ChannelY Phase value

The output phase-control attributes are out_altvoltage0_i_phase and out_altvoltage0_q_phase. They accept integer register codes.

root:/> cat out_altvoltage0_i_phase
0

root:/> echo 1 > out_altvoltage0_i_phase
root:/> cat out_altvoltage0_i_phase
1

More Information