49#define JESD204_LINKS_ALL ((unsigned int)(-1))
51#define JESD204_LMFC_OFFSET_UNINITIALIZED ((uint16_t)-1)
152static inline const char *jesd204_state_op_reason_str(
enum
157 return "initialization";
159 return "uninitialization";
236#define JESD204_MAX_TOPOLOGY_LINKS 16
264 unsigned int devs_number);
278 unsigned long *rate_hz);
281 unsigned long *lane_rate_khz);
284 unsigned long *device_clock);
int jesd204_topology_remove(struct jesd204_topology *topology)
int jesd204_fsm_start(struct jesd204_topology *topology, unsigned int link_idx)
jesd204_version
Definition jesd204.h:21
@ JESD204_VERSION_C
Definition jesd204.h:24
@ JESD204_VERSION_B
Definition jesd204.h:23
@ JESD204_VERSION_A
Definition jesd204.h:22
int jesd204_dev_unregister(struct jesd204_dev *jdev)
jesd204_dev_op
Definition jesd204.h:196
@ JESD204_OP_OPT_SETUP_STAGE3
Definition jesd204.h:207
@ JESD204_OP_LINK_RUNNING
Definition jesd204.h:212
@ JESD204_OP_CLOCKS_ENABLE
Definition jesd204.h:210
@ JESD204_OP_CLK_SYNC_STAGE3
Definition jesd204.h:203
@ JESD204_OP_OPT_POST_RUNNING_STAGE
Definition jesd204.h:213
@ JESD204_OP_LINK_PRE_SETUP
Definition jesd204.h:200
@ JESD204_OP_OPT_SETUP_STAGE4
Definition jesd204.h:208
@ JESD204_OP_DEVICE_INIT
Definition jesd204.h:197
@ JESD204_OP_LINK_INIT
Definition jesd204.h:198
@ __JESD204_MAX_OPS
Definition jesd204.h:215
@ JESD204_OP_OPT_SETUP_STAGE2
Definition jesd204.h:206
@ JESD204_OP_LINK_ENABLE
Definition jesd204.h:211
@ JESD204_OP_OPT_SETUP_STAGE5
Definition jesd204.h:209
@ JESD204_OP_LINK_SUPPORTED
Definition jesd204.h:199
@ JESD204_OP_OPT_SETUP_STAGE1
Definition jesd204.h:205
@ JESD204_OP_LINK_SETUP
Definition jesd204.h:204
@ JESD204_OP_CLK_SYNC_STAGE2
Definition jesd204.h:202
@ JESD204_OP_CLK_SYNC_STAGE1
Definition jesd204.h:201
int(* jesd204_sysref_cb)(struct jesd204_dev *jdev)
Definition jesd204.h:165
int jesd204_sysref_async_force(struct jesd204_dev *jdev)
int jesd204_sysref_async(struct jesd204_dev *jdev)
jesd204_state_op_reason
Definition jesd204.h:147
@ JESD204_STATE_OP_REASON_UNINIT
Definition jesd204.h:149
@ JESD204_STATE_OP_REASON_INIT
Definition jesd204.h:148
void jesd204_copy_link_params(struct jesd204_link *dst, const struct jesd204_link *src)
int jesd204_link_get_rate_khz(struct jesd204_link *lnk, unsigned long *lane_rate_khz)
int jesd204_fsm_stop(struct jesd204_topology *topology, unsigned int link_idx)
int(* jesd204_dev_cb)(struct jesd204_dev *jdev, enum jesd204_state_op_reason reason)
Definition jesd204.h:167
int jesd204_link_get_device_clock(struct jesd204_link *lnk, unsigned long *device_clock)
jesd204_state_op_mode
Definition jesd204.h:174
@ JESD204_STATE_OP_MODE_PER_LINK
Definition jesd204.h:175
@ JESD204_STATE_OP_MODE_PER_DEVICE
Definition jesd204.h:176
jesd204_state_change_result
Definition jesd204.h:43
@ JESD204_STATE_CHANGE_DEFER
Definition jesd204.h:45
@ JESD204_STATE_CHANGE_DONE
Definition jesd204.h:46
@ JESD204_STATE_CHANGE_ERROR
Definition jesd204.h:44
jesd204_encoder
Definition jesd204.h:28
@ JESD204_ENCODER_64B66B
Definition jesd204.h:31
@ JESD204_ENCODER_64B80B
Definition jesd204.h:32
@ JESD204_ENCODER_MAX
Definition jesd204.h:34
@ JESD204_ENCODER_UNKNOWN
Definition jesd204.h:29
@ JESD204_ENCODER_8B10B
Definition jesd204.h:30
int jesd204_topology_init(struct jesd204_topology **topology, struct jesd204_topology_dev *devs, unsigned int devs_number)
jesd204_sysref_mode
Definition jesd204.h:37
@ JESD204_SYSREF_ONESHOT
Definition jesd204.h:40
@ JESD204_SYSREF_CONTINUOUS
Definition jesd204.h:39
@ JESD204_SYSREF_DISABLED
Definition jesd204.h:38
int jesd204_dev_register(struct jesd204_dev **jdev, const struct jesd204_dev_data *dev_data)
bool jesd204_dev_is_top(struct jesd204_dev *jdev)
void * jesd204_dev_priv(struct jesd204_dev *jdev)
int(* jesd204_link_cb)(struct jesd204_dev *jdev, enum jesd204_state_op_reason, struct jesd204_link *lnk)
Definition jesd204.h:170
#define JESD204_MAX_TOPOLOGY_LINKS
Definition jesd204.h:236
int jesd204_link_get_lmfc_lemc_rate(struct jesd204_link *lnk, unsigned long *rate_hz)
jesd204_subclass
Definition jesd204.h:15
@ JESD204_SUBCLASS_1
Definition jesd204.h:17
@ JESD204_SUBCLASS_2
Definition jesd204.h:18
@ JESD204_SUBCLASS_0
Definition jesd204.h:16
JESD204 device initialization data.
Definition jesd204.h:227
size_t sizeof_priv
Definition jesd204.h:229
unsigned int max_num_links
Definition jesd204.h:230
unsigned int num_retries
Definition jesd204.h:231
struct jesd204_state_op state_ops[__JESD204_MAX_OPS]
Definition jesd204.h:232
jesd204_sysref_cb sysref_cb
Definition jesd204.h:228
JESD204 link configuration settings.
Definition jesd204.h:105
uint8_t num_of_multiblocks_in_emb
Definition jesd204.h:118
uint32_t sample_rate_div
Definition jesd204.h:110
uint8_t ctrl_bits_per_sample
Definition jesd204.h:134
uint32_t link_id
Definition jesd204.h:106
uint8_t dac_adj_resolution_steps
Definition jesd204.h:142
int error
Definition jesd204.h:107
uint8_t num_converters
Definition jesd204.h:115
struct jesd204_sysref sysref
Definition jesd204.h:139
uint8_t * lane_ids
Definition jesd204.h:137
uint64_t sample_rate
Definition jesd204.h:109
uint8_t dac_phase_adj
Definition jesd204.h:144
uint8_t scrambling
Definition jesd204.h:130
uint8_t device_id
Definition jesd204.h:127
uint8_t converter_resolution
Definition jesd204.h:122
uint8_t ctrl_words_per_frame_clk
Definition jesd204.h:133
uint8_t jesd_encoder
Definition jesd204.h:124
uint8_t samples_per_conv_frame
Definition jesd204.h:135
uint8_t num_lanes
Definition jesd204.h:114
uint16_t frames_per_multiframe
Definition jesd204.h:117
uint8_t subclass
Definition jesd204.h:125
uint8_t high_density
Definition jesd204.h:131
bool is_transmit
Definition jesd204.h:112
uint8_t jesd_version
Definition jesd204.h:123
uint8_t octets_per_frame
Definition jesd204.h:116
uint8_t bits_per_sample
Definition jesd204.h:120
uint8_t dac_adj_direction
Definition jesd204.h:143
uint8_t bank_id
Definition jesd204.h:128
JESD204 device per-state op.
Definition jesd204.h:189
bool post_state_sysref
Definition jesd204.h:193
jesd204_link_cb per_link
Definition jesd204.h:192
enum jesd204_state_op_mode mode
Definition jesd204.h:190
jesd204_dev_cb per_device
Definition jesd204.h:191
JESD204 parameters for SYSREF.
Definition jesd204.h:60
uint8_t valid_falling_edge
Definition jesd204.h:63
uint8_t capture_falling_edge
Definition jesd204.h:62
enum jesd204_sysref_mode mode
Definition jesd204.h:61
uint16_t lmfc_offset
Definition jesd204.h:64
struct jesd204_dev * jdev
Definition jesd204.h:240
unsigned int links_number
Definition jesd204.h:244
bool is_sysref_provider
Definition jesd204.h:242
bool is_top_device
Definition jesd204.h:241
unsigned int link_ids[JESD204_MAX_TOPOLOGY_LINKS]
Definition jesd204.h:243
unsigned int devs_number
Definition jesd204.h:251
struct jesd204_topology_dev * devs
Definition jesd204.h:250
struct jesd204_dev_top * dev_top
Definition jesd204.h:249