Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ad9523.c File Reference
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/spi/spi.h>
#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/frequency/ad9523.h>

Go to the source code of this file.

Data Structures

struct  ad9523_state
 

Macros

#define AD9523_READ   (1 << 15)
 
#define AD9523_WRITE   (0 << 15)
 
#define AD9523_CNT(x)   (((x) - 1) << 13)
 
#define AD9523_ADDR(x)   ((x) & 0xFFF)
 
#define AD9523_R1B   (1 << 16)
 
#define AD9523_R2B   (2 << 16)
 
#define AD9523_R3B   (3 << 16)
 
#define AD9523_TRANSF_LEN(x)   ((x) >> 16)
 
#define AD9523_SERIAL_PORT_CONFIG   (AD9523_R1B | 0x0)
 
#define AD9523_VERSION_REGISTER   (AD9523_R1B | 0x2)
 
#define AD9523_PART_REGISTER   (AD9523_R1B | 0x3)
 
#define AD9523_READBACK_CTRL   (AD9523_R1B | 0x4)
 
#define AD9523_EEPROM_CUSTOMER_VERSION_ID   (AD9523_R2B | 0x6)
 
#define AD9523_PLL1_REF_A_DIVIDER   (AD9523_R2B | 0x11)
 
#define AD9523_PLL1_REF_B_DIVIDER   (AD9523_R2B | 0x13)
 
#define AD9523_PLL1_REF_TEST_DIVIDER   (AD9523_R1B | 0x14)
 
#define AD9523_PLL1_FEEDBACK_DIVIDER   (AD9523_R2B | 0x17)
 
#define AD9523_PLL1_CHARGE_PUMP_CTRL   (AD9523_R2B | 0x19)
 
#define AD9523_PLL1_INPUT_RECEIVERS_CTRL   (AD9523_R1B | 0x1A)
 
#define AD9523_PLL1_REF_CTRL   (AD9523_R1B | 0x1B)
 
#define AD9523_PLL1_MISC_CTRL   (AD9523_R1B | 0x1C)
 
#define AD9523_PLL1_LOOP_FILTER_CTRL   (AD9523_R1B | 0x1D)
 
#define AD9523_PLL2_CHARGE_PUMP   (AD9523_R1B | 0xF0)
 
#define AD9523_PLL2_FEEDBACK_DIVIDER_AB   (AD9523_R1B | 0xF1)
 
#define AD9523_PLL2_CTRL   (AD9523_R1B | 0xF2)
 
#define AD9523_PLL2_VCO_CTRL   (AD9523_R1B | 0xF3)
 
#define AD9523_PLL2_VCO_DIVIDER   (AD9523_R1B | 0xF4)
 
#define AD9523_PLL2_LOOP_FILTER_CTRL   (AD9523_R2B | 0xF6)
 
#define AD9523_PLL2_R2_DIVIDER   (AD9523_R1B | 0xF7)
 
#define AD9523_CHANNEL_CLOCK_DIST(ch)   (AD9523_R3B | (0x192 + 3 * ch))
 
#define AD9523_PLL1_OUTPUT_CTRL   (AD9523_R1B | 0x1BA)
 
#define AD9523_PLL1_OUTPUT_CHANNEL_CTRL   (AD9523_R1B | 0x1BB)
 
#define AD9523_READBACK_0   (AD9523_R1B | 0x22C)
 
#define AD9523_READBACK_1   (AD9523_R1B | 0x22D)
 
#define AD9523_STATUS_SIGNALS   (AD9523_R3B | 0x232)
 
#define AD9523_POWER_DOWN_CTRL   (AD9523_R1B | 0x233)
 
#define AD9523_IO_UPDATE   (AD9523_R1B | 0x234)
 
#define AD9523_EEPROM_DATA_XFER_STATUS   (AD9523_R1B | 0xB00)
 
#define AD9523_EEPROM_ERROR_READBACK   (AD9523_R1B | 0xB01)
 
#define AD9523_EEPROM_CTRL1   (AD9523_R1B | 0xB02)
 
#define AD9523_EEPROM_CTRL2   (AD9523_R1B | 0xB03)
 
#define AD9523_SER_CONF_SDO_ACTIVE   (1 << 7)
 
#define AD9523_SER_CONF_SOFT_RESET   (1 << 5)
 
#define AD9523_READBACK_CTRL_READ_BUFFERED   (1 << 0)
 
#define AD9523_PLL1_CHARGE_PUMP_CURRENT_nA(x)   (((x) / 500) & 0x7F)
 
#define AD9523_PLL1_CHARGE_PUMP_TRISTATE   (1 << 7)
 
#define AD9523_PLL1_CHARGE_PUMP_MODE_NORMAL   (3 << 8)
 
#define AD9523_PLL1_CHARGE_PUMP_MODE_PUMP_DOWN   (2 << 8)
 
#define AD9523_PLL1_CHARGE_PUMP_MODE_PUMP_UP   (1 << 8)
 
#define AD9523_PLL1_CHARGE_PUMP_MODE_TRISTATE   (0 << 8)
 
#define AD9523_PLL1_BACKLASH_PW_MIN   (0 << 10)
 
#define AD9523_PLL1_BACKLASH_PW_LOW   (1 << 10)
 
#define AD9523_PLL1_BACKLASH_PW_HIGH   (2 << 10)
 
#define AD9523_PLL1_BACKLASH_PW_MAX   (3 << 10)
 
#define AD9523_PLL1_REF_TEST_RCV_EN   (1 << 7)
 
#define AD9523_PLL1_REFB_DIFF_RCV_EN   (1 << 6)
 
#define AD9523_PLL1_REFA_DIFF_RCV_EN   (1 << 5)
 
#define AD9523_PLL1_REFB_RCV_EN   (1 << 4)
 
#define AD9523_PLL1_REFA_RCV_EN   (1 << 3)
 
#define AD9523_PLL1_REFA_REFB_PWR_CTRL_EN   (1 << 2)
 
#define AD9523_PLL1_OSC_IN_CMOS_NEG_INP_EN   (1 << 1)
 
#define AD9523_PLL1_OSC_IN_DIFF_EN   (1 << 0)
 
#define AD9523_PLL1_BYPASS_REF_TEST_DIV_EN   (1 << 7)
 
#define AD9523_PLL1_BYPASS_FEEDBACK_DIV_EN   (1 << 6)
 
#define AD9523_PLL1_ZERO_DELAY_MODE_INT   (1 << 5)
 
#define AD9523_PLL1_ZERO_DELAY_MODE_EXT   (0 << 5)
 
#define AD9523_PLL1_OSC_IN_PLL_FEEDBACK_EN   (1 << 4)
 
#define AD9523_PLL1_ZD_IN_CMOS_NEG_INP_EN   (1 << 3)
 
#define AD9523_PLL1_ZD_IN_DIFF_EN   (1 << 2)
 
#define AD9523_PLL1_REFB_CMOS_NEG_INP_EN   (1 << 1)
 
#define AD9523_PLL1_REFA_CMOS_NEG_INP_EN   (1 << 0)
 
#define AD9523_PLL1_REFB_INDEP_DIV_CTRL_EN   (1 << 7)
 
#define AD9523_PLL1_OSC_CTRL_FAIL_VCC_BY2_EN   (1 << 6)
 
#define AD9523_PLL1_REF_MODE(x)   ((x) << 2)
 
#define AD9523_PLL1_BYPASS_REFB_DIV   (1 << 1)
 
#define AD9523_PLL1_BYPASS_REFA_DIV   (1 << 0)
 
#define AD9523_PLL1_LOOP_FILTER_RZERO(x)   ((x) & 0xF)
 
#define AD9523_PLL2_CHARGE_PUMP_CURRENT_nA(x)   ((x) / 3500)
 
#define AD9523_PLL2_FB_NDIV_A_CNT(x)   (((x) & 0x3) << 6)
 
#define AD9523_PLL2_FB_NDIV_B_CNT(x)   (((x) & 0x3F) << 0)
 
#define AD9523_PLL2_FB_NDIV(a, b)   (4 * (b) + (a))
 
#define AD9523_PLL2_CHARGE_PUMP_MODE_NORMAL   (3 << 0)
 
#define AD9523_PLL2_CHARGE_PUMP_MODE_PUMP_DOWN   (2 << 0)
 
#define AD9523_PLL2_CHARGE_PUMP_MODE_PUMP_UP   (1 << 0)
 
#define AD9523_PLL2_CHARGE_PUMP_MODE_TRISTATE   (0 << 0)
 
#define AD9523_PLL2_BACKLASH_PW_MIN   (0 << 2)
 
#define AD9523_PLL2_BACKLASH_PW_LOW   (1 << 2)
 
#define AD9523_PLL2_BACKLASH_PW_HIGH   (2 << 2)
 
#define AD9523_PLL2_BACKLASH_PW_MAX   (3 << 1)
 
#define AD9523_PLL2_BACKLASH_CTRL_EN   (1 << 4)
 
#define AD9523_PLL2_FREQ_DOUBLER_EN   (1 << 5)
 
#define AD9523_PLL2_LOCK_DETECT_PWR_DOWN_EN   (1 << 7)
 
#define AD9523_PLL2_VCO_CALIBRATE   (1 << 1)
 
#define AD9523_PLL2_FORCE_VCO_MIDSCALE   (1 << 2)
 
#define AD9523_PLL2_FORCE_REFERENCE_VALID   (1 << 3)
 
#define AD9523_PLL2_FORCE_RELEASE_SYNC   (1 << 4)
 
#define AD9523_PLL2_VCO_DIV_M1(x)   ((((x) - 3) & 0x3) << 0)
 
#define AD9523_PLL2_VCO_DIV_M2(x)   ((((x) - 3) & 0x3) << 4)
 
#define AD9523_PLL2_VCO_DIV_M1_PWR_DOWN_EN   (1 << 2)
 
#define AD9523_PLL2_VCO_DIV_M2_PWR_DOWN_EN   (1 << 6)
 
#define AD9523_PLL2_LOOP_FILTER_CPOLE1(x)   (((x) & 0x7) << 0)
 
#define AD9523_PLL2_LOOP_FILTER_RZERO(x)   (((x) & 0x7) << 3)
 
#define AD9523_PLL2_LOOP_FILTER_RPOLE2(x)   (((x) & 0x7) << 6)
 
#define AD9523_PLL2_LOOP_FILTER_RZERO_BYPASS_EN   (1 << 8)
 
#define AD9523_PLL2_R2_DIVIDER_VAL(x)   (((x) & 0x1F) << 0)
 
#define AD9523_CLK_DIST_DIV_PHASE(x)   (((x) & 0x3F) << 18)
 
#define AD9523_CLK_DIST_DIV_PHASE_REV(x)   ((ret >> 18) & 0x3F)
 
#define AD9523_CLK_DIST_DIV(x)   ((((x) - 1) & 0x3FF) << 8)
 
#define AD9523_CLK_DIST_DIV_REV(x)   (((ret >> 8) & 0x3FF) + 1)
 
#define AD9523_CLK_DIST_INV_DIV_OUTPUT_EN   (1 << 7)
 
#define AD9523_CLK_DIST_IGNORE_SYNC_EN   (1 << 6)
 
#define AD9523_CLK_DIST_PWR_DOWN_EN   (1 << 5)
 
#define AD9523_CLK_DIST_LOW_PWR_MODE_EN   (1 << 4)
 
#define AD9523_CLK_DIST_DRIVER_MODE(x)   (((x) & 0xF) << 0)
 
#define AD9523_PLL1_OUTP_CTRL_VCO_DIV_SEL_CH6_M2   (1 << 7)
 
#define AD9523_PLL1_OUTP_CTRL_VCO_DIV_SEL_CH5_M2   (1 << 6)
 
#define AD9523_PLL1_OUTP_CTRL_VCO_DIV_SEL_CH4_M2   (1 << 5)
 
#define AD9523_PLL1_OUTP_CTRL_CMOS_DRV_WEAK   (1 << 4)
 
#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_1   (0 << 0)
 
#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_2   (1 << 0)
 
#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_4   (2 << 0)
 
#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_8   (4 << 0)
 
#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_16   (8 << 0)
 
#define AD9523_PLL1_OUTP_CH_CTRL_OUTPUT_PWR_DOWN_EN   (1 << 7)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCO_DIV_SEL_CH9_M2   (1 << 6)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCO_DIV_SEL_CH8_M2   (1 << 5)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCO_DIV_SEL_CH7_M2   (1 << 4)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH3   (1 << 3)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH2   (1 << 2)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH1   (1 << 1)
 
#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH0   (1 << 0)
 
#define AD9523_READBACK_0_STAT_PLL2_REF_CLK   (1 << 7)
 
#define AD9523_READBACK_0_STAT_PLL2_FB_CLK   (1 << 6)
 
#define AD9523_READBACK_0_STAT_VCXO   (1 << 5)
 
#define AD9523_READBACK_0_STAT_REF_TEST   (1 << 4)
 
#define AD9523_READBACK_0_STAT_REFB   (1 << 3)
 
#define AD9523_READBACK_0_STAT_REFA   (1 << 2)
 
#define AD9523_READBACK_0_STAT_PLL2_LD   (1 << 1)
 
#define AD9523_READBACK_0_STAT_PLL1_LD   (1 << 0)
 
#define AD9523_READBACK_1_HOLDOVER_ACTIVE   (1 << 3)
 
#define AD9523_READBACK_1_AUTOMODE_SEL_REFB   (1 << 2)
 
#define AD9523_READBACK_1_VCO_CALIB_IN_PROGRESS   (1 << 0)
 
#define AD9523_STATUS_SIGNALS_SYNC_MAN_CTRL   (1 << 16)
 
#define AD9523_STATUS_MONITOR_01_PLL12_LOCKED   (0x302)
 
#define AD9523_POWER_DOWN_CTRL_PLL1_PWR_DOWN   (1 << 2)
 
#define AD9523_POWER_DOWN_CTRL_PLL2_PWR_DOWN   (1 << 1)
 
#define AD9523_POWER_DOWN_CTRL_DIST_PWR_DOWN   (1 << 0)
 
#define AD9523_IO_UPDATE_EN   (1 << 0)
 
#define AD9523_EEPROM_DATA_XFER_IN_PROGRESS   (1 << 0)
 
#define AD9523_EEPROM_ERROR_READBACK_FAIL   (1 << 0)
 
#define AD9523_EEPROM_CTRL1_SOFT_EEPROM   (1 << 1)
 
#define AD9523_EEPROM_CTRL1_EEPROM_WRITE_PROT_DIS   (1 << 0)
 
#define AD9523_EEPROM_CTRL2_REG2EEPROM   (1 << 0)
 
#define AD9523_NUM_CHAN   14
 
#define AD9523_NUM_CHAN_ALT_CLK_SRC   10
 
#define AD_IFE(_pde, _a, _b)   ((pdata->_pde) ? _a : _b)
 
#define AD_IF(_pde, _a)   AD_IFE(_pde, _a, 0)
 

Enumerations

enum  {
  AD9523_STAT_PLL1_LD, AD9523_STAT_PLL2_LD, AD9523_STAT_REFA, AD9523_STAT_REFB,
  AD9523_STAT_REF_TEST, AD9523_STAT_VCXO, AD9523_STAT_PLL2_FB_CLK, AD9523_STAT_PLL2_REF_CLK,
  AD9523_SYNC, AD9523_EEPROM
}
 
enum  { AD9523_VCO1, AD9523_VCO2, AD9523_VCXO, AD9523_NUM_CLK_SRC }
 

Functions

 MODULE_DEVICE_TABLE (spi, ad9523_id)
 
 module_spi_driver (ad9523_driver)
 
 MODULE_AUTHOR ("Michael Hennerich <[email protected]>")
 
 MODULE_DESCRIPTION ("Analog Devices AD9523 CLOCKDIST/PLL")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define AD9523_ADDR (   x)    ((x) & 0xFFF)

Definition at line 26 of file ad9523.c.

#define AD9523_CHANNEL_CLOCK_DIST (   ch)    (AD9523_R3B | (0x192 + 3 * ch))

Definition at line 58 of file ad9523.c.

#define AD9523_CLK_DIST_DIV (   x)    ((((x) - 1) & 0x3FF) << 8)

Definition at line 171 of file ad9523.c.

#define AD9523_CLK_DIST_DIV_PHASE (   x)    (((x) & 0x3F) << 18)

Definition at line 169 of file ad9523.c.

#define AD9523_CLK_DIST_DIV_PHASE_REV (   x)    ((ret >> 18) & 0x3F)

Definition at line 170 of file ad9523.c.

#define AD9523_CLK_DIST_DIV_REV (   x)    (((ret >> 8) & 0x3FF) + 1)

Definition at line 172 of file ad9523.c.

#define AD9523_CLK_DIST_DRIVER_MODE (   x)    (((x) & 0xF) << 0)

Definition at line 177 of file ad9523.c.

#define AD9523_CLK_DIST_IGNORE_SYNC_EN   (1 << 6)

Definition at line 174 of file ad9523.c.

#define AD9523_CLK_DIST_INV_DIV_OUTPUT_EN   (1 << 7)

Definition at line 173 of file ad9523.c.

#define AD9523_CLK_DIST_LOW_PWR_MODE_EN   (1 << 4)

Definition at line 176 of file ad9523.c.

#define AD9523_CLK_DIST_PWR_DOWN_EN   (1 << 5)

Definition at line 175 of file ad9523.c.

#define AD9523_CNT (   x)    (((x) - 1) << 13)

Definition at line 25 of file ad9523.c.

#define AD9523_EEPROM_CTRL1   (AD9523_R1B | 0xB02)

Definition at line 72 of file ad9523.c.

#define AD9523_EEPROM_CTRL1_EEPROM_WRITE_PROT_DIS   (1 << 0)

Definition at line 234 of file ad9523.c.

#define AD9523_EEPROM_CTRL1_SOFT_EEPROM   (1 << 1)

Definition at line 233 of file ad9523.c.

#define AD9523_EEPROM_CTRL2   (AD9523_R1B | 0xB03)

Definition at line 73 of file ad9523.c.

#define AD9523_EEPROM_CTRL2_REG2EEPROM   (1 << 0)

Definition at line 237 of file ad9523.c.

#define AD9523_EEPROM_CUSTOMER_VERSION_ID   (AD9523_R2B | 0x6)

Definition at line 38 of file ad9523.c.

#define AD9523_EEPROM_DATA_XFER_IN_PROGRESS   (1 << 0)

Definition at line 227 of file ad9523.c.

#define AD9523_EEPROM_DATA_XFER_STATUS   (AD9523_R1B | 0xB00)

Definition at line 70 of file ad9523.c.

#define AD9523_EEPROM_ERROR_READBACK   (AD9523_R1B | 0xB01)

Definition at line 71 of file ad9523.c.

#define AD9523_EEPROM_ERROR_READBACK_FAIL   (1 << 0)

Definition at line 230 of file ad9523.c.

#define AD9523_IO_UPDATE   (AD9523_R1B | 0x234)

Definition at line 68 of file ad9523.c.

#define AD9523_IO_UPDATE_EN   (1 << 0)

Definition at line 224 of file ad9523.c.

#define AD9523_NUM_CHAN   14

Definition at line 239 of file ad9523.c.

#define AD9523_NUM_CHAN_ALT_CLK_SRC   10

Definition at line 240 of file ad9523.c.

#define AD9523_PART_REGISTER   (AD9523_R1B | 0x3)

Definition at line 35 of file ad9523.c.

#define AD9523_PLL1_BACKLASH_PW_HIGH   (2 << 10)

Definition at line 92 of file ad9523.c.

#define AD9523_PLL1_BACKLASH_PW_LOW   (1 << 10)

Definition at line 91 of file ad9523.c.

#define AD9523_PLL1_BACKLASH_PW_MAX   (3 << 10)

Definition at line 93 of file ad9523.c.

#define AD9523_PLL1_BACKLASH_PW_MIN   (0 << 10)

Definition at line 90 of file ad9523.c.

#define AD9523_PLL1_BYPASS_FEEDBACK_DIV_EN   (1 << 6)

Definition at line 107 of file ad9523.c.

#define AD9523_PLL1_BYPASS_REF_TEST_DIV_EN   (1 << 7)

Definition at line 106 of file ad9523.c.

#define AD9523_PLL1_BYPASS_REFA_DIV   (1 << 0)

Definition at line 121 of file ad9523.c.

#define AD9523_PLL1_BYPASS_REFB_DIV   (1 << 1)

Definition at line 120 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_CTRL   (AD9523_R2B | 0x19)

Definition at line 44 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_CURRENT_nA (   x)    (((x) / 500) & 0x7F)

Definition at line 84 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_MODE_NORMAL   (3 << 8)

Definition at line 86 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_MODE_PUMP_DOWN   (2 << 8)

Definition at line 87 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_MODE_PUMP_UP   (1 << 8)

Definition at line 88 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_MODE_TRISTATE   (0 << 8)

Definition at line 89 of file ad9523.c.

#define AD9523_PLL1_CHARGE_PUMP_TRISTATE   (1 << 7)

Definition at line 85 of file ad9523.c.

#define AD9523_PLL1_FEEDBACK_DIVIDER   (AD9523_R2B | 0x17)

Definition at line 43 of file ad9523.c.

#define AD9523_PLL1_INPUT_RECEIVERS_CTRL   (AD9523_R1B | 0x1A)

Definition at line 45 of file ad9523.c.

#define AD9523_PLL1_LOOP_FILTER_CTRL   (AD9523_R1B | 0x1D)

Definition at line 48 of file ad9523.c.

#define AD9523_PLL1_LOOP_FILTER_RZERO (   x)    ((x) & 0xF)

Definition at line 124 of file ad9523.c.

#define AD9523_PLL1_MISC_CTRL   (AD9523_R1B | 0x1C)

Definition at line 47 of file ad9523.c.

#define AD9523_PLL1_OSC_CTRL_FAIL_VCC_BY2_EN   (1 << 6)

Definition at line 118 of file ad9523.c.

#define AD9523_PLL1_OSC_IN_CMOS_NEG_INP_EN   (1 << 1)

Definition at line 102 of file ad9523.c.

#define AD9523_PLL1_OSC_IN_DIFF_EN   (1 << 0)

Definition at line 103 of file ad9523.c.

#define AD9523_PLL1_OSC_IN_PLL_FEEDBACK_EN   (1 << 4)

Definition at line 110 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_OUTPUT_PWR_DOWN_EN   (1 << 7)

Definition at line 191 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCO_DIV_SEL_CH7_M2   (1 << 4)

Definition at line 194 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCO_DIV_SEL_CH8_M2   (1 << 5)

Definition at line 193 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCO_DIV_SEL_CH9_M2   (1 << 6)

Definition at line 192 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH0   (1 << 0)

Definition at line 198 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH1   (1 << 1)

Definition at line 197 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH2   (1 << 2)

Definition at line 196 of file ad9523.c.

#define AD9523_PLL1_OUTP_CH_CTRL_VCXO_SRC_SEL_CH3   (1 << 3)

Definition at line 195 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_CMOS_DRV_WEAK   (1 << 4)

Definition at line 183 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_1   (0 << 0)

Definition at line 184 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_16   (8 << 0)

Definition at line 188 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_2   (1 << 0)

Definition at line 185 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_4   (2 << 0)

Definition at line 186 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_OUTPUT_DIV_8   (4 << 0)

Definition at line 187 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_VCO_DIV_SEL_CH4_M2   (1 << 5)

Definition at line 182 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_VCO_DIV_SEL_CH5_M2   (1 << 6)

Definition at line 181 of file ad9523.c.

#define AD9523_PLL1_OUTP_CTRL_VCO_DIV_SEL_CH6_M2   (1 << 7)

Definition at line 180 of file ad9523.c.

#define AD9523_PLL1_OUTPUT_CHANNEL_CTRL   (AD9523_R1B | 0x1BB)

Definition at line 61 of file ad9523.c.

#define AD9523_PLL1_OUTPUT_CTRL   (AD9523_R1B | 0x1BA)

Definition at line 60 of file ad9523.c.

#define AD9523_PLL1_REF_A_DIVIDER   (AD9523_R2B | 0x11)

Definition at line 40 of file ad9523.c.

#define AD9523_PLL1_REF_B_DIVIDER   (AD9523_R2B | 0x13)

Definition at line 41 of file ad9523.c.

#define AD9523_PLL1_REF_CTRL   (AD9523_R1B | 0x1B)

Definition at line 46 of file ad9523.c.

#define AD9523_PLL1_REF_MODE (   x)    ((x) << 2)

Definition at line 119 of file ad9523.c.

#define AD9523_PLL1_REF_TEST_DIVIDER   (AD9523_R1B | 0x14)

Definition at line 42 of file ad9523.c.

#define AD9523_PLL1_REF_TEST_RCV_EN   (1 << 7)

Definition at line 96 of file ad9523.c.

#define AD9523_PLL1_REFA_CMOS_NEG_INP_EN   (1 << 0)

Definition at line 114 of file ad9523.c.

#define AD9523_PLL1_REFA_DIFF_RCV_EN   (1 << 5)

Definition at line 98 of file ad9523.c.

#define AD9523_PLL1_REFA_RCV_EN   (1 << 3)

Definition at line 100 of file ad9523.c.

#define AD9523_PLL1_REFA_REFB_PWR_CTRL_EN   (1 << 2)

Definition at line 101 of file ad9523.c.

#define AD9523_PLL1_REFB_CMOS_NEG_INP_EN   (1 << 1)

Definition at line 113 of file ad9523.c.

#define AD9523_PLL1_REFB_DIFF_RCV_EN   (1 << 6)

Definition at line 97 of file ad9523.c.

#define AD9523_PLL1_REFB_INDEP_DIV_CTRL_EN   (1 << 7)

Definition at line 117 of file ad9523.c.

#define AD9523_PLL1_REFB_RCV_EN   (1 << 4)

Definition at line 99 of file ad9523.c.

#define AD9523_PLL1_ZD_IN_CMOS_NEG_INP_EN   (1 << 3)

Definition at line 111 of file ad9523.c.

#define AD9523_PLL1_ZD_IN_DIFF_EN   (1 << 2)

Definition at line 112 of file ad9523.c.

#define AD9523_PLL1_ZERO_DELAY_MODE_EXT   (0 << 5)

Definition at line 109 of file ad9523.c.

#define AD9523_PLL1_ZERO_DELAY_MODE_INT   (1 << 5)

Definition at line 108 of file ad9523.c.

#define AD9523_PLL2_BACKLASH_CTRL_EN   (1 << 4)

Definition at line 143 of file ad9523.c.

#define AD9523_PLL2_BACKLASH_PW_HIGH   (2 << 2)

Definition at line 141 of file ad9523.c.

#define AD9523_PLL2_BACKLASH_PW_LOW   (1 << 2)

Definition at line 140 of file ad9523.c.

#define AD9523_PLL2_BACKLASH_PW_MAX   (3 << 1)

Definition at line 142 of file ad9523.c.

#define AD9523_PLL2_BACKLASH_PW_MIN   (0 << 2)

Definition at line 139 of file ad9523.c.

#define AD9523_PLL2_CHARGE_PUMP   (AD9523_R1B | 0xF0)

Definition at line 50 of file ad9523.c.

#define AD9523_PLL2_CHARGE_PUMP_CURRENT_nA (   x)    ((x) / 3500)

Definition at line 127 of file ad9523.c.

#define AD9523_PLL2_CHARGE_PUMP_MODE_NORMAL   (3 << 0)

Definition at line 135 of file ad9523.c.

#define AD9523_PLL2_CHARGE_PUMP_MODE_PUMP_DOWN   (2 << 0)

Definition at line 136 of file ad9523.c.

#define AD9523_PLL2_CHARGE_PUMP_MODE_PUMP_UP   (1 << 0)

Definition at line 137 of file ad9523.c.

#define AD9523_PLL2_CHARGE_PUMP_MODE_TRISTATE   (0 << 0)

Definition at line 138 of file ad9523.c.

#define AD9523_PLL2_CTRL   (AD9523_R1B | 0xF2)

Definition at line 52 of file ad9523.c.

#define AD9523_PLL2_FB_NDIV (   a,
  b 
)    (4 * (b) + (a))

Definition at line 132 of file ad9523.c.

#define AD9523_PLL2_FB_NDIV_A_CNT (   x)    (((x) & 0x3) << 6)

Definition at line 130 of file ad9523.c.

#define AD9523_PLL2_FB_NDIV_B_CNT (   x)    (((x) & 0x3F) << 0)

Definition at line 131 of file ad9523.c.

#define AD9523_PLL2_FEEDBACK_DIVIDER_AB   (AD9523_R1B | 0xF1)

Definition at line 51 of file ad9523.c.

#define AD9523_PLL2_FORCE_REFERENCE_VALID   (1 << 3)

Definition at line 150 of file ad9523.c.

#define AD9523_PLL2_FORCE_RELEASE_SYNC   (1 << 4)

Definition at line 151 of file ad9523.c.

#define AD9523_PLL2_FORCE_VCO_MIDSCALE   (1 << 2)

Definition at line 149 of file ad9523.c.

#define AD9523_PLL2_FREQ_DOUBLER_EN   (1 << 5)

Definition at line 144 of file ad9523.c.

#define AD9523_PLL2_LOCK_DETECT_PWR_DOWN_EN   (1 << 7)

Definition at line 145 of file ad9523.c.

#define AD9523_PLL2_LOOP_FILTER_CPOLE1 (   x)    (((x) & 0x7) << 0)

Definition at line 160 of file ad9523.c.

#define AD9523_PLL2_LOOP_FILTER_CTRL   (AD9523_R2B | 0xF6)

Definition at line 55 of file ad9523.c.

#define AD9523_PLL2_LOOP_FILTER_RPOLE2 (   x)    (((x) & 0x7) << 6)

Definition at line 162 of file ad9523.c.

#define AD9523_PLL2_LOOP_FILTER_RZERO (   x)    (((x) & 0x7) << 3)

Definition at line 161 of file ad9523.c.

#define AD9523_PLL2_LOOP_FILTER_RZERO_BYPASS_EN   (1 << 8)

Definition at line 163 of file ad9523.c.

#define AD9523_PLL2_R2_DIVIDER   (AD9523_R1B | 0xF7)

Definition at line 56 of file ad9523.c.

#define AD9523_PLL2_R2_DIVIDER_VAL (   x)    (((x) & 0x1F) << 0)

Definition at line 166 of file ad9523.c.

#define AD9523_PLL2_VCO_CALIBRATE   (1 << 1)

Definition at line 148 of file ad9523.c.

#define AD9523_PLL2_VCO_CTRL   (AD9523_R1B | 0xF3)

Definition at line 53 of file ad9523.c.

#define AD9523_PLL2_VCO_DIV_M1 (   x)    ((((x) - 3) & 0x3) << 0)

Definition at line 154 of file ad9523.c.

#define AD9523_PLL2_VCO_DIV_M1_PWR_DOWN_EN   (1 << 2)

Definition at line 156 of file ad9523.c.

#define AD9523_PLL2_VCO_DIV_M2 (   x)    ((((x) - 3) & 0x3) << 4)

Definition at line 155 of file ad9523.c.

#define AD9523_PLL2_VCO_DIV_M2_PWR_DOWN_EN   (1 << 6)

Definition at line 157 of file ad9523.c.

#define AD9523_PLL2_VCO_DIVIDER   (AD9523_R1B | 0xF4)

Definition at line 54 of file ad9523.c.

#define AD9523_POWER_DOWN_CTRL   (AD9523_R1B | 0x233)

Definition at line 67 of file ad9523.c.

#define AD9523_POWER_DOWN_CTRL_DIST_PWR_DOWN   (1 << 0)

Definition at line 221 of file ad9523.c.

#define AD9523_POWER_DOWN_CTRL_PLL1_PWR_DOWN   (1 << 2)

Definition at line 219 of file ad9523.c.

#define AD9523_POWER_DOWN_CTRL_PLL2_PWR_DOWN   (1 << 1)

Definition at line 220 of file ad9523.c.

#define AD9523_R1B   (1 << 16)

Definition at line 28 of file ad9523.c.

#define AD9523_R2B   (2 << 16)

Definition at line 29 of file ad9523.c.

#define AD9523_R3B   (3 << 16)

Definition at line 30 of file ad9523.c.

#define AD9523_READ   (1 << 15)

Definition at line 23 of file ad9523.c.

#define AD9523_READBACK_0   (AD9523_R1B | 0x22C)

Definition at line 63 of file ad9523.c.

#define AD9523_READBACK_0_STAT_PLL1_LD   (1 << 0)

Definition at line 208 of file ad9523.c.

#define AD9523_READBACK_0_STAT_PLL2_FB_CLK   (1 << 6)

Definition at line 202 of file ad9523.c.

#define AD9523_READBACK_0_STAT_PLL2_LD   (1 << 1)

Definition at line 207 of file ad9523.c.

#define AD9523_READBACK_0_STAT_PLL2_REF_CLK   (1 << 7)

Definition at line 201 of file ad9523.c.

#define AD9523_READBACK_0_STAT_REF_TEST   (1 << 4)

Definition at line 204 of file ad9523.c.

#define AD9523_READBACK_0_STAT_REFA   (1 << 2)

Definition at line 206 of file ad9523.c.

#define AD9523_READBACK_0_STAT_REFB   (1 << 3)

Definition at line 205 of file ad9523.c.

#define AD9523_READBACK_0_STAT_VCXO   (1 << 5)

Definition at line 203 of file ad9523.c.

#define AD9523_READBACK_1   (AD9523_R1B | 0x22D)

Definition at line 64 of file ad9523.c.

#define AD9523_READBACK_1_AUTOMODE_SEL_REFB   (1 << 2)

Definition at line 212 of file ad9523.c.

#define AD9523_READBACK_1_HOLDOVER_ACTIVE   (1 << 3)

Definition at line 211 of file ad9523.c.

#define AD9523_READBACK_1_VCO_CALIB_IN_PROGRESS   (1 << 0)

Definition at line 213 of file ad9523.c.

#define AD9523_READBACK_CTRL   (AD9523_R1B | 0x4)

Definition at line 36 of file ad9523.c.

#define AD9523_READBACK_CTRL_READ_BUFFERED   (1 << 0)

Definition at line 81 of file ad9523.c.

#define AD9523_SER_CONF_SDO_ACTIVE   (1 << 7)

Definition at line 77 of file ad9523.c.

#define AD9523_SER_CONF_SOFT_RESET   (1 << 5)

Definition at line 78 of file ad9523.c.

#define AD9523_SERIAL_PORT_CONFIG   (AD9523_R1B | 0x0)

Definition at line 33 of file ad9523.c.

#define AD9523_STATUS_MONITOR_01_PLL12_LOCKED   (0x302)

Definition at line 217 of file ad9523.c.

#define AD9523_STATUS_SIGNALS   (AD9523_R3B | 0x232)

Definition at line 66 of file ad9523.c.

#define AD9523_STATUS_SIGNALS_SYNC_MAN_CTRL   (1 << 16)

Definition at line 216 of file ad9523.c.

#define AD9523_TRANSF_LEN (   x)    ((x) >> 16)

Definition at line 31 of file ad9523.c.

#define AD9523_VERSION_REGISTER   (AD9523_R1B | 0x2)

Definition at line 34 of file ad9523.c.

#define AD9523_WRITE   (0 << 15)

Definition at line 24 of file ad9523.c.

#define AD_IF (   _pde,
  _a 
)    AD_IFE(_pde, _a, 0)

Definition at line 244 of file ad9523.c.

#define AD_IFE (   _pde,
  _a,
  _b 
)    ((pdata->_pde) ? _a : _b)

Definition at line 243 of file ad9523.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
AD9523_STAT_PLL1_LD 
AD9523_STAT_PLL2_LD 
AD9523_STAT_REFA 
AD9523_STAT_REFB 
AD9523_STAT_REF_TEST 
AD9523_STAT_VCXO 
AD9523_STAT_PLL2_FB_CLK 
AD9523_STAT_PLL2_REF_CLK 
AD9523_SYNC 
AD9523_EEPROM 

Definition at line 246 of file ad9523.c.

anonymous enum
Enumerator:
AD9523_VCO1 
AD9523_VCO2 
AD9523_VCXO 
AD9523_NUM_CLK_SRC 

Definition at line 259 of file ad9523.c.

Function Documentation

MODULE_AUTHOR ( "Michael Hennerich <[email protected]>"  )
MODULE_DESCRIPTION ( "Analog Devices AD9523 CLOCKDIST/PLL )
MODULE_DEVICE_TABLE ( spi  ,
ad9523_id   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( ad9523_driver  )