Commit 82aa23bd authored by Federico Vaga's avatar Federico Vaga

[minor-fix] fa-zio-drv.c: reset offset to calibrated value

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent cba43b30
......@@ -302,24 +302,6 @@ int zfad_fsm_command(struct fa_dev *fa, uint32_t command)
}
/*
* zfad_reset_offset
* @fa: the fmc-adc descriptor
*
* Reset channel's offsets
*/
static void zfad_reset_offset(struct fa_dev *fa)
{
zfa_common_conf_set(fa, ZFA_CTL_DAC_CLR_N, 0);
udelay(20);
zfa_common_conf_set(fa, ZFA_CTL_DAC_CLR_N, 1);
/*
* FIXME update the value with the default value for the selected range
*/
}
/*
* zfad_get_range
* @usr_val: range value
......@@ -420,6 +402,21 @@ static int zfad_apply_user_offset(struct fa_dev *fa, struct zio_channel *chan,
}
/*
* zfad_reset_offset
* @fa: the fmc-adc descriptor
*
* Reset channel's offsets
*/
static void zfad_reset_offset(struct fa_dev *fa)
{
int i;
for (i = 0; i < fa->zdev->cset->n_chan; ++i)
zfad_apply_user_offset(fa, &fa->zdev->cset->chan[i], 0);
}
/*
* zfad_conf_set
*
......@@ -977,6 +974,8 @@ static int zfad_init_cset(struct zio_cset *cset)
struct fa_dev *fa = cset->zdev->priv_d;
int i;
fa->zdev = cset->zdev; /* FIXME remove on future ZIO update */
dev_dbg(&cset->head.dev, "%s:%d", __func__, __LINE__);
/* Force stop FSM to prevent early trigger fire */
zfa_common_conf_set(fa, ZFA_CTL_FMS_CMD, ZFA_STOP);
......
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