2 * AD9523 SPI Low Jitter Clock Generator
4 * Copyright 2012 Analog Devices Inc.
6 * Licensed under the GPL-2.
9 #ifndef IIO_FREQUENCY_AD9523_H_
10 #define IIO_FREQUENCY_AD9523_H_
31 NONEREVERTIVE_STAY_ON_REFB
,
39 * struct ad9523_channel_spec - Output channel configuration
41 * @channel_num: Output channel number.
42 * @divider_output_invert_en: Invert the polarity of the output clock.
43 * @sync_ignore_en: Ignore chip-level SYNC signal.
44 * @low_power_mode_en: Reduce power used in the differential output modes.
45 * @use_alt_clock_src: Channel divider uses alternative clk source.
46 * @output_dis: Disables, powers down the entire channel.
47 * @driver_mode: Output driver mode (logic level family).
48 * @divider_phase: Divider initial phase after a SYNC. Range 0..63
49 LSB = 1/2 of a period of the divider input clock.
50 * @channel_divider: 10-bit channel divider.
51 * @extended_name: Optional descriptive channel name.
54 struct ad9523_channel_spec
{
56 bool divider_output_invert_en
;
58 bool low_power_mode_en
;
59 /* CH0..CH3 VCXO, CH4..CH9 VCO2 */
60 bool use_alt_clock_src
;
62 enum outp_drv_mode driver_mode
;
63 unsigned char divider_phase
;
64 unsigned short channel_divider
;
65 char extended_name
[16];
68 enum pll1_rzero_resistor
{
74 RZERO_USE_EXT_RES
= 8,
77 enum rpole2_resistor
{
95 enum cpole1_capacitor
{
100 _CPOLE1_24_PF
, /* place holder */
107 * struct ad9523_platform_data - platform specific information
109 * @vcxo_freq: External VCXO frequency in Hz
110 * @refa_diff_rcv_en: REFA differential/single-ended input selection.
111 * @refb_diff_rcv_en: REFB differential/single-ended input selection.
112 * @zd_in_diff_en: Zero Delay differential/single-ended input selection.
113 * @osc_in_diff_en: OSC differential/ single-ended input selection.
114 * @refa_cmos_neg_inp_en: REFA single-ended neg./pos. input enable.
115 * @refb_cmos_neg_inp_en: REFB single-ended neg./pos. input enable.
116 * @zd_in_cmos_neg_inp_en: Zero Delay single-ended neg./pos. input enable.
117 * @osc_in_cmos_neg_inp_en: OSC single-ended neg./pos. input enable.
118 * @refa_r_div: PLL1 10-bit REFA R divider.
119 * @refb_r_div: PLL1 10-bit REFB R divider.
120 * @pll1_feedback_div: PLL1 10-bit Feedback N divider.
121 * @pll1_charge_pump_current_nA: Magnitude of PLL1 charge pump current (nA).
122 * @zero_delay_mode_internal_en: Internal, external Zero Delay mode selection.
123 * @osc_in_feedback_en: PLL1 feedback path, local feedback from
124 * the OSC_IN receiver or zero delay mode
125 * @pll1_loop_filter_rzero: PLL1 Loop Filter Zero Resistor selection.
126 * @ref_mode: Reference selection mode.
127 * @pll2_charge_pump_current_nA: Magnitude of PLL2 charge pump current (nA).
128 * @pll2_ndiv_a_cnt: PLL2 Feedback N-divider, A Counter, range 0..4.
129 * @pll2_ndiv_b_cnt: PLL2 Feedback N-divider, B Counter, range 0..63.
130 * @pll2_freq_doubler_en: PLL2 frequency doubler enable.
131 * @pll2_r2_div: PLL2 R2 divider, range 0..31.
132 * @pll2_vco_diff_m1: VCO1 divider, range 3..5.
133 * @pll2_vco_diff_m2: VCO2 divider, range 3..5.
134 * @rpole2: PLL2 loop filter Rpole resistor value.
135 * @rzero: PLL2 loop filter Rzero resistor value.
136 * @cpole1: PLL2 loop filter Cpole capacitor value.
137 * @rzero_bypass_en: PLL2 loop filter Rzero bypass enable.
138 * @num_channels: Array size of struct ad9523_channel_spec.
139 * @channels: Pointer to channel array.
140 * @name: Optional alternative iio device name.
143 struct ad9523_platform_data
{
144 unsigned long vcxo_freq
;
146 /* Differential/ Single-Ended Input Configuration */
147 bool refa_diff_rcv_en
;
148 bool refb_diff_rcv_en
;
153 * Valid if differential input disabled
154 * if false defaults to pos input
156 bool refa_cmos_neg_inp_en
;
157 bool refb_cmos_neg_inp_en
;
158 bool zd_in_cmos_neg_inp_en
;
159 bool osc_in_cmos_neg_inp_en
;
162 unsigned short refa_r_div
;
163 unsigned short refb_r_div
;
164 unsigned short pll1_feedback_div
;
165 unsigned short pll1_charge_pump_current_nA
;
166 bool zero_delay_mode_internal_en
;
167 bool osc_in_feedback_en
;
168 enum pll1_rzero_resistor pll1_loop_filter_rzero
;
171 enum ref_sel_mode ref_mode
;
174 unsigned int pll2_charge_pump_current_nA
;
175 unsigned char pll2_ndiv_a_cnt
;
176 unsigned char pll2_ndiv_b_cnt
;
177 bool pll2_freq_doubler_en
;
178 unsigned char pll2_r2_div
;
179 unsigned char pll2_vco_diff_m1
; /* 3..5 */
180 unsigned char pll2_vco_diff_m2
; /* 3..5 */
182 /* Loop Filter PLL2 */
183 enum rpole2_resistor rpole2
;
184 enum rzero_resistor rzero
;
185 enum cpole1_capacitor cpole1
;
186 bool rzero_bypass_en
;
188 /* Output Channel Configuration */
190 struct ad9523_channel_spec
*channels
;
192 char name
[SPI_NAME_SIZE
];
195 #endif /* IIO_FREQUENCY_AD9523_H_ */