Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:iio-pll:adf4371 [04 Sep 2019 12:34] – Optional Properties: clock-scales Stefan Poparesources:tools-software:linux-drivers:iio-pll:adf4371 [04 Sep 2019 14:13] (current) – More Information Stefan Popa
Line 31: Line 31:
 | driver  | [[linux.github>master?drivers/iio/frequency/adf4371.c | drivers/iio/frequency/adf4371.c]] | | driver  | [[linux.github>master?drivers/iio/frequency/adf4371.c | drivers/iio/frequency/adf4371.c]] |
 | Documentation | [[linux.github>master?Documentation/devicetree/bindings/iio/frequency/adf4371.yaml | adf4371.yaml]] | | Documentation | [[linux.github>master?Documentation/devicetree/bindings/iio/frequency/adf4371.yaml | adf4371.yaml]] |
 +| ABI documentation| [[linux.github>master?Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371 | sysfs-bus-iio-frequency-adf4371]] |
  
 Example device tree Example device tree
Line 52: Line 53:
 **Optional properties:** **Optional properties:**
   * **clock-scales**: The Common Clock Framework max rate is limited by MAX of unsigned long. For ADF4371/ADF4372 devices this is a deficiency. If specified, this property allows arbitrary scales. The first element in the array should be the multiplier and the second element should be the divider.   * **clock-scales**: The Common Clock Framework max rate is limited by MAX of unsigned long. For ADF4371/ADF4372 devices this is a deficiency. If specified, this property allows arbitrary scales. The first element in the array should be the multiplier and the second element should be the divider.
 +  * **adi,mute-till-lock-en**: If this property is present, then the supply current to RF8P and RF8N output stage will shut down until the ADF4371/ADF4372 achieves lock as measured by the digital lock detect circuitry.
 +  * **adi,charge-pump-microamp**: Sets the charge pump current. If this property is not specified, then the charge pump current is set to the default 1750uA. The valid values are listed below. However, if the set value is not supported, the driver will look for the closest valid charge pump current. Valid values: 350, 700, 1050, 1400, 1750, 2100, 2450, 2800, 3150, 3500, 3850, 4200, 4550, 4900, 5250, 5600.
 +  * **adi,loop-filter-inverting**: If this property is present, then the phase detector polarity will be set to negative because of the positive tuning of the VCO.
  
 +**Channel specific optional properties:**
 +  * **reg**: The channel number. It can have up to 3 channels on adf4372 and 4 channels on adf4371, numbered from 0 to 3.
 +  * **adi,output-enable**: If this property is specified, the output channel will be enabled. If left empty, the driver will initialize the defaults (RF8x, channel 0 will be the only one enabled).
 +  * **adi,power-up-frequency**: Set the frequency after power up for the channel. If this property is specified, it has to be in sync with the power up frequency set on the other channels. This limitation is due to the fact that all the channel frequencies are derived from the VCO fundamental frequency.
  
 +<code>
 +Example:
  
 +spi0 {
 +        #address-cells = <1>;
 +        #size-cells = <0>;
 +        frequency@0 {
 +                compatible = "adi,adf4371";
 +                reg = <0>;
 +                #address-cells = <1>;
 +                #size-cells = <0>;
 +                #clock-cells = <1>;
 +                spi-max-frequency = <1000000>;
 +                clocks = <&adf4371_clkin>;
 +                clock-names = "clkin";
 +                clock-scales = <1 10>;
 +                channel@0 {
 +                        reg = <0>;
 +                        adi,output-enable;
 +                        adi,power-up-frequency = /bits/ 64 <8000000000>;
 +                };
 +                channel@1 {
 +                        reg = <1>;
 +                        adi,output-enable;
 +                };
 +                channel@2 {
 +                        reg = <2>;
 +                        adi,output-enable;
 +                        adi,power-up-frequency = /bits/ 64 <16000000000>;
 +                };
 +                channel@3 {
 +                        reg = <3>;
 +                        adi,output-enable;
 +                        adi,power-up-frequency = /bits/ 64 <32000000000>;
 +                };
 +        };
 +    };
 +</code>
 +
 +
 +====== Enabling Linux driver support ======
 +
 +Configure kernel with "make menuconfig" (alternatively use "make xconfig" or
 +"make qconfig")
 +
 +<WRAP round help>
 +The ADF4371 driver depends on **SPI** and selects **REGMAP_SPI**
 +</WRAP>
 +
 +====== Adding Linux driver support ======
 +
 +Configure kernel with "make menuconfig" (alternatively use "make xconfig" or
 +"make qconfig")
 +
 +<code>
 +Linux Kernel Configuration
 + Device Drivers  --->
 + <*>     Industrial I/O support --->
 +     --- Industrial I/O support
 +              Frequency Synthesizers DDS/PLL --->
 +                             *** Phase-Locked Loop (PLL) frequency synthesizers ***
 +                             <*> Analog Devices ADF4371/ADF4372 Wideband Synthesizers
 +</code>
 +
 +====== Hardware configuration ======
 +
 +====== Driver testing ======
 +
 +{{page>software:linux:docs:iio:iio_snippets#iio device files&noheader&firstseconly&noeditbtn}}
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +analog:/sys/bus/iio/devices/iio:device0# **cd /sys/bus/iio/devices/**
 +root@analog:/sys/bus/iio/devices# **ls**
 +iio:device0  iio:device1  iio:device2  iio:device3
 +root@analog:/sys/bus/iio/devices#
 +
 +root@analog:/sys/bus/iio/devices# **cd iio\:device0**
 +root@analog:/sys/bus/iio/devices/iio:device0# **ls -l**
 +total 0
 +-r--r--r-- 1 root root 4096 sep  4 14:05 dev
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 muxout_enable
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 muxout_mode
 +-r--r--r-- 1 root root 4096 sep  4 14:05 name
 +lrwxrwxrwx 1 root root    0 sep  4 14:05 of_node -> ../../../../../../../../firmware/devicetree/base/soc/spi@7e204000/adf4371@0
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage0_frequency
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage0_name
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage0_powerdown
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage1_frequency
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage1_name
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage1_powerdown
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage2_frequency
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage2_name
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage2_powerdown
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage3_frequency
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage3_name
 +-rw-r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage3_powerdown
 +-r--r--r-- 1 root root 4096 sep  4 14:05 out_altvoltage_muxout_mode_available
 +drwxr-xr-x 2 root root    0 sep  4 14:05 power
 +lrwxrwxrwx 1 root root    0 sep  2 17:46 subsystem -> ../../../../../../../../bus/iio
 +-rw-r--r-- 1 root root 4096 sep  2 17:46 uevent
 +
 +root@analog:/sys/bus/iio/devices/iio:device0#
 +</xterm></WRAP>
 +
 +===== Show device name =====
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat name**
 +**adf4371**
 +</xterm></WRAP>
 +
 +===== Read channel frequency =====
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat out_altvoltage0_frequency**
 +**8000000000**
 +</xterm></WRAP>
 +
 +===== Read channel name =====
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat out_altvoltage0_name**
 +**RF8x**
 +</xterm></WRAP>
 +
 +===== Set channel frequency =====
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@analog:/sys/bus/iio/devices/iio:device0# **echo 1000000000 > out_altvoltage0_frequency**
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat out_altvoltage0_frequency**
 +**1000000000**
 +</xterm></WRAP>
 +
 +===== Channel power down =====
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat out_altvoltage0_powerdown**
 +0
 +root@analog:/sys/bus/iio/devices/iio:device0# **echo 1 > out_altvoltage0_powerdown**
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat out_altvoltage0_powerdown**
 +1
 +</xterm></WRAP>
 +
 +===== Muxout mode =====
 +
 +The mux output allows the user to access various internal points on the chip. Valid values that can be written:
 +
 +<WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 +<xterm>
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat out_altvoltage_muxout_mode_available**
 +tristate digital_lock charge_pump_up charge_pump_down RDIV2 N_div_out VCO_test high VCO_calib_R_band VCO_calib_N_band
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat muxout_mode**
 +digital_lock
 +root@analog:/sys/bus/iio/devices/iio:device0# **echo charge_pump_up > muxout_mode**
 +root@analog:/sys/bus/iio/devices/iio:device0# **cat muxout_mode**
 +charge_pump_up 
 +</xterm></WRAP>
 +====== More Information ======
 +
 +{{page>software:linux:docs:iio:iio_snippets#iio pointers&noheader&firstseconly&noeditbtn}}
  
resources/tools-software/linux-drivers/iio-pll/adf4371.1567593251.txt.gz · Last modified: 04 Sep 2019 12:34 by Stefan Popa