Commit 062fa915 authored by Alessandro Rubini's avatar Alessandro Rubini

servo: split ADJ_NS_MAX from ADJ_FREQ_MAX

This stuff must be reviewed again anyways, because I'm not sure at
all about what these numbers add (I can't find proper docs or examples).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 5ad6fd57
...@@ -318,8 +318,11 @@ struct pp_time_operations { ...@@ -318,8 +318,11 @@ struct pp_time_operations {
int (*adjust)(long offset_ns, long freq_ppm); int (*adjust)(long offset_ns, long freq_ppm);
}; };
/* Where is this maximum imposed from? And which unit? */ /* IF the configuration prevents jumps, this is the max jump (0.5ms) */
#define PP_ADJ_FREQ_MAX 512000 #define PP_ADJ_NS_MAX (500*1000)
/* In geeneral, we can't adjust the rate by more than 200ppm */
#define PP_ADJ_FREQ_MAX (200 << 16)
extern struct pp_time_operations pp_t_ops; extern struct pp_time_operations pp_t_ops;
......
...@@ -273,7 +273,7 @@ void pp_update_clock(struct pp_instance *ppi) ...@@ -273,7 +273,7 @@ void pp_update_clock(struct pp_instance *ppi)
pp_init_clock(ppi); pp_init_clock(ppi);
} else { } else {
adj = DSCUR(ppi)->offsetFromMaster.nanoseconds adj = DSCUR(ppi)->offsetFromMaster.nanoseconds
> 0 ? PP_ADJ_FREQ_MAX:-PP_ADJ_FREQ_MAX; > 0 ? PP_ADJ_NS_MAX:-PP_ADJ_NS_MAX;
pp_t_ops.adjust(-adj, 0); pp_t_ops.adjust(-adj, 0);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment