Commit 29f0d756 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

softpll: added CHAN_SHIFTING RPC flag

parent 17c5c04a
...@@ -36,7 +36,7 @@ static void clear_state() ...@@ -36,7 +36,7 @@ static void clear_state()
/* Sets the phase setpoint on a given channel */ /* Sets the phase setpoint on a given channel */
int rts_adjust_phase(int channel, int32_t phase_setpoint) int rts_adjust_phase(int channel, int32_t phase_setpoint)
{ {
TRACE("Adjusting phase: ref channel %d, setpoint=%d ps.\n", channel, phase_setpoint); // TRACE("Adjusting phase: ref channel %d, setpoint=%d ps.\n", channel, phase_setpoint);
spll_set_phase_shift(0, phase_setpoint); spll_set_phase_shift(0, phase_setpoint);
pstate.channels[channel].phase_setpoint = phase_setpoint; pstate.channels[channel].phase_setpoint = phase_setpoint;
return 0; return 0;
...@@ -119,7 +119,11 @@ void rts_update() ...@@ -119,7 +119,11 @@ void rts_update()
CH.flags = CHAN_DISABLED; CH.flags = CHAN_DISABLED;
else { else {
if(i==pstate.current_ref) if(i==pstate.current_ref)
{
spll_get_phase_shift(0, &CH.phase_current, NULL); spll_get_phase_shift(0, &CH.phase_current, NULL);
if(spll_shifter_busy(0))
CH.flags |= CHAN_SHIFTING;
}
if(spll_read_ptracker(i, &CH.phase_loopback)) if(spll_read_ptracker(i, &CH.phase_loopback))
CH.flags |= CHAN_PMEAS_READY; CH.flags |= CHAN_PMEAS_READY;
} }
...@@ -141,7 +145,7 @@ static int rts_get_state_func(const struct minipc_pd *pd, uint32_t *args, void * ...@@ -141,7 +145,7 @@ static int rts_get_state_func(const struct minipc_pd *pd, uint32_t *args, void *
struct rts_pll_state *tmp = (struct rts_pll_state *)ret; struct rts_pll_state *tmp = (struct rts_pll_state *)ret;
int i; int i;
TRACE("IPC Call: %s [rv at %x]\n", __FUNCTION__, ret); // TRACE("IPC Call: %s [rv at %x]\n", __FUNCTION__, ret);
/* gaaaah, somebody should write a SWIG plugin for generating this stuff. */ /* gaaaah, somebody should write a SWIG plugin for generating this stuff. */
tmp->current_ref = htonl(pstate.current_ref); tmp->current_ref = htonl(pstate.current_ref);
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#define CHAN_PMEAS_READY (1<<3) #define CHAN_PMEAS_READY (1<<3)
/* Channel not available/disabled */ /* Channel not available/disabled */
#define CHAN_DISABLED (1<<4) #define CHAN_DISABLED (1<<4)
/* Channel is busy adjusting phase */
#define CHAN_SHIFTING (1<<5)
/* DMTD clock is present */ /* DMTD clock is present */
#define RTS_DMTD_LOCKED (1<<0) #define RTS_DMTD_LOCKED (1<<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