iio: frequency: adf4371: Add support for ADF4371 PLL
Subsystems (2)
PATCH v5 1/2 iio: frequency: adf4371: Add support for ADF4371 PLL
The ADF4371 is a frequency synthesizer with an integrated voltage controlled oscillator (VCO) for phase-locked loops (PLLs). The ADF4371 has an integrated VCO with a fundamental output frequency ranging from 4000 MHz to 8000 MHz. In addition, the VCO frequency is connected to divide by 1, 2, 4, 8, 16, 32, or 64 circuits that allows the user to generate radio frequency (RF) output frequencies as low as 62.5 MHz at RF8x. A frequency multiplier at RF16x generates from 8 GHz to 16 GHz. A frequency quadrupler generates frequencies from 16 GHz to 32 GHz at RF32x. RFAUX8x duplicates the frequency range of RF8x or permits direct access to the VCO output.
The driver takes the reference input frequency from the device tree and uses it to calculate and maximize the PFD frequency (frequency of the phase frequency detector). The PFD frequency is further used to calculate the
timeouts: synthesizer lock, VCO band selection, automatic level calibration (ALC) and PLL settling time.
This initial driver exposes the attributes for setting the frequency and enabling/disabling the different adf4371 channels.
Datasheet:
---
Changes in v2:
- Added a new sysfs-bus-iio-frequency-adf4371 file which documents the ABI changes.
- Modified the ADF4371_REG() macro to take the reg values in hex as params
- ADF4371_MAX_MODULUS2 macro is now defined as BIT(14)
- regmap_bulk_write() can do DMA directly, so the buffer was forced into it's own cacheline.
- Fixed the multi line comment style.
Changes in v3:
- out_altvoltageY_frequency and out_altvoltageY_powerdown attributes are treated as normal indexed channels.
- out_altvoltageY_name attribute was added, from which the datasheet names of the channels can be read.
- Added more information in the documentation.
- Documented the use of mutex lock.
- As part of adf4371_write(), used a bool variable for power down and a 64 bit variable for the frequency.
Changes in v4:
- Misc style fixes.
Changes in v5:
- Added st->spi = spi; line of code in probe and fixing possible NULL pointer dereference.
.../ABI/testing/sysfs-bus-iio-frequency-adf4371 | 44 ++ drivers/iio/frequency/Kconfig | 10 + drivers/iio/frequency/Makefile | 1 + drivers/iio/frequency/adf4371.c | 595 +++++++++++++++++++++ 4 files changed, 650 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371 create mode 100644 drivers/iio/frequency/adf4371.c
Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4371 new file +44 -0
@@ -0,0 +1,44 @@ +What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency +KernelVersion: +Contact: [email protected] +Description: + Stores the PLL frequency in Hz for channel Y. + Reading returns the actual frequency in Hz. + The ADF4371 has an integrated VCO with fundamendal output + frequency ranging from 4000000000 Hz 8000000000 Hz. + + out_altvoltage0_frequency: + A divide by 1, 2, 4, 8, 16, 32 or circuit generates + frequencies from 62500000 Hz to 8000000000 Hz. + out_altvoltage1_frequency: + This channel duplicates the channel 0 frequency + out_altvoltage2_frequency: + A frequency doubler generates frequencies from + 8000000000 Hz to 16000000000 Hz. + out_altvoltage3_frequency: + A frequency quadrupler generates frequencies from + 16000000000 Hz to 32000000000 Hz. + + Note: writes to one of the channels will affect the frequency of + all the other channels, since it involves changing the VCO + fundamental output frequency. + +What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_name +KernelVersion: +Contact: [email protected] +Description: + Reading returns the datasheet name for channel Y: + + out_altvoltage0_name: RF8x + out_altvoltage1_name: RFAUX8x + out_altvoltage2_name: RF16x + out_altvoltage3_name: RF32x + +What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_powerdown +KernelVersion: +Contact: [email protected] +Description: + This attribute allows the user to power down the PLL and it's + RFOut buffers. + Writing 1 causes the specified channel to power down. + Clearing returns to normal operation.
drivers/iio/frequency/Kconfig +10 -0
@@ -38,5 +38,15 @@ config ADF4350 To compile this driver as a module, choose M here: the module will be called adf4350. +config ADF4371 + tristate "Analog Devices ADF4371 Wideband Synthesizer" + depends on SPI + select REGMAP_SPI + help + Say yes here to build support for Analog Devices ADF4371 + Wideband Synthesizer. The driver provides direct access via sysfs. + + To compile this driver as a module, choose M here: the + module will be called adf4371. endmenu endmenu
drivers/iio/frequency/Makefile +1 -0
@@ -5,3 +5,4 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_AD9523) += ad9523.o obj-$(CONFIG_ADF4350) += adf4350.o +obj-$(CONFIG_ADF4371) += adf4371.o
drivers/iio/frequency/adf4371.c new file +595 -0
595 lines not on this page · raw message
Signature · 1 line
2.7.4