41#define AD9250_READ (1 << 15)
42#define AD9250_WRITE (0 << 15)
43#define AD9250_CNT(x) ((((x) & 0x3) - 1) << 13)
44#define AD9250_ADDR(x) ((x) & 0xFF)
46#define AD9250_R1B (1 << 8)
47#define AD9250_R2B (2 << 8)
48#define AD9250_R3B (3 << 8)
49#define AD9250_TRANSF_LEN(x) (((x) >> 8) & 0xFF)
50#define SHADOW(x) ((x) << 16)
53#define AD9250_REG_SPI_CFG (AD9250_R1B | 0x00)
54#define AD9250_REG_CHIP_ID (AD9250_R1B | 0x01)
55#define AD9250_REG_CHIP_INFO (AD9250_R1B | 0x02)
58#define AD9250_REG_CH_INDEX (AD9250_R1B | 0x05)
59#define AD9250_REG_DEVICE_UPDATE (AD9250_R1B | 0xFF)
62#define AD9250_REG_PDWN (AD9250_R1B | 0x08)
63#define AD9250_REG_CLOCK (AD9250_R1B | 0x09 | SHADOW(1))
64#define AD9250_REG_PLL_STAT (AD9250_R1B | 0x0A)
65#define AD9250_REG_CLOCK_DIV (AD9250_R1B | 0x0B | SHADOW(2))
66#define AD9250_REG_TEST (AD9250_R1B | 0x0D | SHADOW(3))
67#define AD9250_REG_BIST (AD9250_R1B | 0x0E | SHADOW(4))
68#define AD9250_REG_OFFSET (AD9250_R1B | 0x10 | SHADOW(5))
69#define AD9250_REG_OUT_MODE (AD9250_R1B | 0x14 | SHADOW(6))
70#define AD9250_REG_CML (AD9250_R1B | 0x15)
71#define AD9250_REG_VREF (AD9250_R1B | 0x18 | SHADOW(7))
72#define AD9250_REG_USER_TEST1 (AD9250_R2B | 0x1A)
73#define AD9250_REG_USER_TEST2 (AD9250_R2B | 0x1C)
74#define AD9250_REG_USER_TEST3 (AD9250_R2B | 0x1E)
75#define AD9250_REG_USER_TEST4 (AD9250_R2B | 0x20)
76#define AD9250_REG_PLL_ENCODE (AD9250_R1B | 0x21)
77#define AD9250_REG_BIST_MISR (AD9250_R2B | 0x25)
78#define AD9250_REG_SYS_CTRL (AD9250_R1B | 0x3A | SHADOW(8))
79#define AD9250_REG_DCC_CTRL (AD9250_R1B | 0x40 | SHADOW(9))
80#define AD9250_REG_DCC_VAL (AD9250_R2B | 0x42 | SHADOW(10))
81#define AD9250_REG_FAST_DETECT (AD9250_R1B | 0x45 | SHADOW(11))
82#define AD9250_REG_FD_UPPER_THD (AD9250_R2B | 0x48 | SHADOW(12))
83#define AD9250_REG_FD_LOWER_THD (AD9250_R2B | 0x4A | SHADOW(13))
84#define AD9250_REG_FD_DWELL_TIME (AD9250_R2B | 0x4C | SHADOW(14))
85#define AD9250_REG_204B_QUICK_CFG (AD9250_R1B | 0x5E)
86#define AD9250_REG_204B_CTRL1 (AD9250_R1B | 0x5F)
87#define AD9250_REG_204B_CTRL2 (AD9250_R1B | 0x60)
88#define AD9250_REG_204B_CTRL3 (AD9250_R1B | 0x61)
89#define AD9250_REG_204B_DID_CFG (AD9250_R1B | 0x64)
90#define AD9250_REG_204B_BID_CFG (AD9250_R1B | 0x65)
91#define AD9250_REG_204B_LID_CFG0 (AD9250_R1B | 0x66)
92#define AD9250_REG_204B_LID_CFG1 (AD9250_R1B | 0x67)
93#define AD9250_REG_204B_PARAM_SCR_L (AD9250_R1B | 0x6E)
94#define AD9250_REG_204B_PARAM_F (AD9250_R1B | 0x6F)
95#define AD9250_REG_204B_PARAM_K (AD9250_R1B | 0x70)
96#define AD9250_REG_204B_PARAM_M (AD9250_R1B | 0x71)
97#define AD9250_REG_204B_PARAM_CS_N (AD9250_R1B | 0x72)
98#define AD9250_REG_204B_PARAM_NP (AD9250_R1B | 0x73)
99#define AD9250_REG_204B_PARAM_S (AD9250_R1B | 0x74)
100#define AD9250_REG_204B_PARAM_HD_CF (AD9250_R1B | 0x75)
101#define AD9250_REG_204B_RESV1 (AD9250_R1B | 0x76)
102#define AD9250_REG_204B_RESV2 (AD9250_R1B | 0x77)
103#define AD9250_REG_204B_CHKSUM0 (AD9250_R1B | 0x79)
104#define AD9250_REG_204B_CHKSUM1 (AD9250_R1B | 0x7A)
105#define AD9250_REG_204B_LANE_ASSGN1 (AD9250_R1B | 0x82)
106#define AD9250_REG_204B_LANE_ASSGN2 (AD9250_R1B | 0x83)
107#define AD9250_REG_204B_LMFC_OFFSET (AD9250_R1B | 0x8B)
108#define AD9250_REG_204B_PRE_EMPHASIS (AD9250_R1B | 0xA8)
111#define AD9250_SPI_CFG_LSB_FIRST ((1 << 6) | (1 << 1))
112#define AD9250_SPI_CFG_SOFT_RST ((1 << 5) | (1 << 2))
115#define AD9250_CH_INDEX_ADC_A (1 << 0)
116#define AD9250_CH_INDEX_ADC_B (1 << 1)
119#define AD9250_DEVICE_UPDATE_SW (1 << 0)
122#define AD9250_PDWN_EXTERN (1 << 5)
123#define AD9250_PDWN_JTX (1 << 4)
124#define AD9250_PDWN_JESD204B(x) (((x) & 0x3) << 2)
125#define AD9250_PDWN_CHIP(x) (((x) & 0x3) << 0)
128#define AD9250_CLOCK_SELECTION(x) (((x) & 0x3) << 4)
129#define AD9250_CLOCK_DUTY_CYCLE (1 << 0)
132#define AD9250_PLL_STAT_LOCKED (1 << 7)
133#define AD9250_PLL_STAT_204B_LINK_RDY (1 << 0)
136#define AD9250_CLOCK_DIV_PHASE(x) (((x) & 0x7) << 3)
137#define AD9250_CLOCK_DIV_RATIO(x) (((x) & 0x7) << 0)
140#define AD9250_TEST_USER_TEST_MODE(x) (((x) & 0x3) << 6)
141#define AD9250_TEST_RST_PN_LONG (1 << 5)
142#define AD9250_TEST_RST_PN_SHOR (1 << 4)
143#define AD9250_TEST_OUTPUT_TEST(x) (((x) & 0xF) << 0)
146#define AD9250_TEST_OFF 0x00
147#define AD9250_TEST_MID_SCALE 0x01
148#define AD9250_TEST_POS_FSCALE 0x02
149#define AD9250_TEST_NEG_FSCALE 0x03
150#define AD9250_TEST_CHECKBOARD 0x04
151#define AD9250_TEST_PNLONG 0x05
152#define AD9250_TEST_ONE2ZERO 0x07
153#define AD9250_TEST_PATTERN 0x08
154#define AD9250_TEST_RAMP 0x0F
157#define AD9250_BIST_RESET (1 << 2)
158#define AD9250_BIST_ENABLE (1 << 0)
161#define AD9250_REG_OFFSET_ADJUST(x) (((x) & 0x3F) << 0)
164#define AD9250_OUT_MODE_JTX_BIT_ASSIGN(x) (((x) & 0x7) << 5)
165#define AD9250_OUT_MODE_DISABLE (1 << 4)
166#define AD9250_OUT_MODE_INVERT_DATA (1 << 3)
167#define AD9250_OUT_MODE_DATA_FORMAT(x) (((x) & 0x1) << 0)
170#define AD9250_OUT_OFFSET_BINARY 0x00
171#define AD9250_OUT_2S_COMPLEMENT 0x01
174#define AD9250_CML_DIFF_OUT_LEVEL(x) (((x) & 0x7) << 0)
177#define AD9250_VREF_FS_ADJUST(x) (((x) & 0x1F) << 0)
180#define AD9250_PLL_ENCODE(x) (((x) & 0x3) << 3)
183#define AD9250_SYS_CTRL_REALIGN_ON_SYNCINB (1 << 4)
184#define AD9250_SYS_CTRL_REALIGN_ON_SYSREF (1 << 3)
185#define AD9250_SYS_CTRL_SYSREF_MODE (1 << 2)
186#define AD9250_SYS_CTRL_SYSREF_EN (1 << 1)
187#define AD9250_SYS_CTRL_SYNCINB_EN (1 << 0)
190#define AD9250_DCC_CTRL_FREEZE_DCC (1 << 6)
191#define AD9250_DCC_CTRL_DCC_BW(x) (((x) & 0xF) << 2)
192#define AD9250_DCC_CTRL_DCC_EN (1 << 1)
195#define AD9250_FAST_DETECT_PIN_FCT (1 << 4)
196#define AD9250_FAST_DETECT_FORCE_FDA_FDB_PIN (1 << 3)
197#define AD9250_FAST_DETECT_FORCE_FDA_FDB_VAL (1 << 2)
198#define AD9250_FAST_DETECT_OUTPUT_ENABLE (1 << 0)
201#define AD9250_204B_QUICK_CFG(x) (((x) & 0xFF) << 0)
204#define AD9250_204B_CTRL1_TAIL_BITS (1 << 6)
205#define AD9250_204B_CTRL1_TEST_SAMPLE_EN (1 << 5)
206#define AD9250_204B_CTRL1_ILAS_MODE(x) (((x) & 0x3) << 2)
207#define AD9250_204B_CTRL1_POWER_DOWN (1 << 0)
210#define AD9250_204B_CTRL2_INVERT_JESD_BITS (1 << 1)
213#define AD9250_204B_CTRL3_TEST_DATA_INJ_PT(x) (((x) & 0x3) << 4)
214#define AD9250_204B_CTRL3_JESD_TEST_MODE(x) (((x) & 0xF) << 0)
217#define AD9250_204B_PARAM_SCR_L_SCRAMBLING (1 << 7)
218#define AD9250_204B_PARAM_SCR_L_LANES (1 << 0)
221#define AD9250_204B_PARAM_CS_N_NR_CTRL_BITS(x) (((x) & 0x3) << 6)
222#define AD9250_204B_PARAM_CS_N_ADC_RESOLUTION(x) (((x) & 0xF) << 0)
225#define AD9250_204B_PARAM_NP_JESD_SUBCLASS(x) (((x) & 0x3) << 5)
226#define AD9250_204B_PARAM_NP_JESD_N_VAL(x) (((x) & 0xF) << 0)
229#define AD9250_204B_PARAM_S(x) (((x) << 0x1F) << 0)
232#define AD9250_204B_PARAM_HD_CF_HD_VAL (1 << 7)
233#define AD9250_204B_PARAM_HD_CF_CF_VAL(x) (((x) & 0x1F) << 0)
236#define AD9250_204B_LANE_ASSGN1(x) (((x) & 0x3) << 4)
239#define AD9250_204B_LANE_ASSGN2(x) (((x) &0x3) << 0)
242#define AD9250_204B_LMFC_OFFSET(x) (((x) & 0x1F) << 0)
525 int32_t register_address);
528 int32_t register_address,
529 int32_t register_value);
564 int32_t user_pattern);
shadow_registers
Definition ad6673.h:486
@ SHADOW_REGISTER_COUNT
Definition ad6673.h:503
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int32_t ad9250_jesd204b_test_mode(struct ad9250_dev *dev, int32_t test_mode)
Selects a JESD204B test mode.
Definition ad9250.c:1084
int32_t ad9250_dcc_enable(struct ad9250_dev *dev, int32_t enable)
Enables DC correction for use in the output data signal path.
Definition ad9250.c:1190
int32_t ad9250_read(struct ad9250_dev *dev, int32_t register_address)
Reads the value of the selected register.
Definition ad9250.c:194
int32_t ad9250_soft_reset(struct ad9250_dev *dev)
Resets all registers to their default values.
Definition ad9250.c:307
@ AD9250_SHD_REG_TEST
Definition ad9250.h:488
@ AD9250_SHD_REG_FAST_DETECT
Definition ad9250.h:496
@ AD9250_SHD_REG_FD_UPPER_THD
Definition ad9250.h:497
@ AD9250_SHD_REG_DCC_VAL
Definition ad9250.h:495
@ SHADOW_REGISTER_COUNT
Definition ad9250.h:500
@ AD9250_SHD_REG_FD_DWELL_TIME
Definition ad9250.h:499
@ AD9250_SHD_REG_CLOCK
Definition ad9250.h:486
@ AD9250_SHD_REG_OFFSET
Definition ad9250.h:490
@ AD9250_SHD_REG_VREF
Definition ad9250.h:492
@ AD9250_SHD_REG_BIST
Definition ad9250.h:489
@ AD9250_SHD_REG_OUT_MODE
Definition ad9250.h:491
@ AD9250_SHD_REG_DCC_CTRL
Definition ad9250.h:494
@ AD9250_SHD_REG_CLOCK_DIV
Definition ad9250.h:487
@ AD9250_SHD_REG_SYS_CTRL
Definition ad9250.h:493
@ AD9250_SHD_REG_FD_LOWER_THD
Definition ad9250.h:498
int32_t ad9250_chip_pwr_mode(struct ad9250_dev *dev, int32_t mode)
Configures the power mode of the chip.
Definition ad9250.c:399
int32_t ad9250_jesd204b_setup(struct ad9250_dev *dev)
Configures the JESD204B interface.
Definition ad9250.c:819
int32_t ad9250_dcc_freeze(struct ad9250_dev *dev, int32_t freeze)
Freezes DC correction value.
Definition ad9250.c:1256
int32_t ad9250_fast_detect_setup(struct ad9250_dev *dev)
Configures the Fast-Detect module.
Definition ad9250.c:1145
int32_t ad9250_setup(struct ad9250_dev **device, struct ad9250_init_param init_param)
Configures the device.
Definition ad9250.c:73
int32_t ad9250_reset_pn23(struct ad9250_dev *dev, int32_t rst)
Sets (1) or clears (0) the reset long PN sequence bit(PN23).
Definition ad9250.c:666
int32_t ad9250_output_invert(struct ad9250_dev *dev, int32_t invert)
Activates the inverted (1) or normal (0) output mode. Note: This function modifies a shadowed registe...
Definition ad9250.c:567
int32_t ad9250_set_user_pattern(struct ad9250_dev *dev, int32_t pattern_no, int32_t user_pattern)
Configures a User Test Pattern.
Definition ad9250.c:697
int32_t ad9250_remove(struct ad9250_dev *dev)
Free the resources allocated by ad9250_setup().
Definition ad9250.c:175
int32_t ad9250_offset_adj(struct ad9250_dev *dev, int32_t adj)
Sets the offset adjustment.
Definition ad9250.c:502
int32_t ad9250_output_disable(struct ad9250_dev *dev, int32_t en)
Disables (1) or enables (0) the data output. Note: This function modifies a shadowed register,...
Definition ad9250.c:532
int32_t ad9250_reset_PN29(struct ad9250_dev *dev, int32_t rst)
int32_t ad9250_select_channel_for_config(struct ad9250_dev *dev, int32_t channel)
Selects a channel as the current channel for further configurations.
Definition ad9250.c:432
int32_t ad9250_write(struct ad9250_dev *dev, int32_t register_address, int32_t register_value)
Writes a value to the selected register.
Definition ad9250.c:231
int32_t ad9250_dcc_bandwidth(struct ad9250_dev *dev, int32_t bw)
Selects the bandwidth value for the DC correction circuit.
Definition ad9250.c:1224
int32_t ad9250_jesd204b_pwr_mode(struct ad9250_dev *dev, int32_t mode)
Configures the power mode of the JESD204B data transmit block.
Definition ad9250.c:1009
int32_t ad9250_jesd204b_select_test_injection_point(struct ad9250_dev *dev, int32_t inj_point)
Selects the point in the processing path of a lane, where the test data will be inserted.
Definition ad9250.c:1043
int32_t ad9250_jesd204b_invert_logic(struct ad9250_dev *dev, int32_t invert)
Inverts the logic of JESD204B bits.
Definition ad9250.c:1116
int32_t ad9250_bist_enable(struct ad9250_dev *dev, int32_t enable)
Enables the Build-In-Self-Test.
Definition ad9250.c:720
int32_t ad9250_transfer(struct ad9250_dev *dev)
Initiates a transfer and waits for the operation to end. Note: This function may be called after a sh...
Definition ad9250.c:275
int32_t ad9250_test_mode(struct ad9250_dev *dev, int32_t mode)
Sets the ADC's test mode.
Definition ad9250.c:472
int32_t ad9250_output_format(struct ad9250_dev *dev, int32_t format)
Specifies the output format. Note: This function modifies a shadowed register, therefore a call of ad...
Definition ad9250.c:602
int32_t ad9250_bist_reset(struct ad9250_dev *dev, int32_t reset)
Resets the Build-In-Self-Test.
Definition ad9250.c:750
Header file of SPI Interface.
int32_t shadow_regs[SHADOW_REGISTER_COUNT]
Definition ad9250.h:508
struct ad9250_state ad9250_st
Definition ad9250.h:507
struct no_os_spi_desc * spi_desc
Definition ad9250.h:505
Fast Detect module configuration.
Definition ad9250.h:446
int8_t pin_function
Definition ad9250.h:458
int8_t force_pins
Definition ad9250.h:464
int16_t fd_lower_tresh
Definition ad9250.h:474
int8_t pin_force_value
Definition ad9250.h:470
int8_t en_fd
Definition ad9250.h:452
int16_t df_dwell_time
Definition ad9250.h:476
int16_t fd_upper_tresh
Definition ad9250.h:472
struct ad9250_state ad9250_st_init
Definition ad9250.h:515
struct no_os_spi_init_param spi_init
Definition ad9250.h:513
JESD204B interface configuration.
Definition ad9250.h:309
int8_t en_ilas_test
Definition ad9250.h:392
int8_t tail_bits_mode
Definition ad9250.h:361
int8_t en_sync_in_b
Definition ad9250.h:410
int8_t subclass
Definition ad9250.h:338
int8_t sys_ref_mode
Definition ad9250.h:416
int8_t lid0
Definition ad9250.h:367
int8_t k
Definition ad9250.h:374
int8_t lid1
Definition ad9250.h:369
int8_t en_sys_ref
Definition ad9250.h:404
int8_t lane0_assign
Definition ad9250.h:434
int8_t ctrl_bits_assign
Definition ad9250.h:355
int8_t did
Definition ad9250.h:363
int8_t align_sync_in_b
Definition ad9250.h:422
int8_t align_sys_ref
Definition ad9250.h:428
int8_t invert_logic_bits
Definition ad9250.h:398
int8_t ilas_mode
Definition ad9250.h:386
int8_t ctrl_bits_no
Definition ad9250.h:345
int8_t scrambling
Definition ad9250.h:380
int8_t jtx_in_standby
Definition ad9250.h:315
int8_t quick_cfg_option
Definition ad9250.h:332
int8_t lane1_assign
Definition ad9250.h:439
int8_t bid
Definition ad9250.h:365
int8_t cml_level
Definition ad9250.h:324
struct ad9250_platform_data * pdata
Definition ad9250.h:480
struct ad9250_fast_detect_cfg * p_fd
Definition ad9250.h:482
struct ad9250_jesd204b_cfg * p_jesd204b
Definition ad9250.h:481
Definition ad9361_util.h:63
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128