Commit 2427a5fe authored by Federico Vaga's avatar Federico Vaga

core: add and use fsm command enumeration

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
parent b75b3054
......@@ -180,7 +180,7 @@ irqreturn_t zfadc_irq(int irq, void *ptr)
&zfad_regs[ZFAT_CFG_HW_EN], 0);
/* Start state machine */
zfa_common_conf_set(&zfat->ti.cset->head.dev,
&zfad_regs[ZFA_CTL_FMS_CMD], 2);
&zfad_regs[ZFA_CTL_FMS_CMD], ZFA_START);
}
if (irq_status & ZFAT_TRG_FIRE) { /* Trigger fire */
......@@ -201,9 +201,11 @@ irqreturn_t zfadc_irq(int irq, void *ptr)
zfa_common_info_get(&zfat->ti.cset->head.dev,
&zfad_regs[ZFA_STA_FSM],&val);
if (val == ZFA_STATE_IDLE) {
dev_dbg(&zfat->ti.head.dev, "Start DMA from device\n");
/* Stop state machine */
zfa_common_conf_set(&zfat->ti.cset->head.dev,
&zfad_regs[ZFA_CTL_FMS_CMD], 2);
&zfad_regs[ZFA_CTL_FMS_CMD],
ZFA_STOP);
/* Disable all triggers */
zfa_common_conf_set(&zfat->ti.cset->head.dev,
&zfad_regs[ZFAT_CFG_HW_EN], 0);
......
......@@ -157,9 +157,17 @@ enum zfadc_dregs_enum {
ZFA_UTC_ACQ_END_COARSE,
ZFA_UTC_ACQ_END_FINE,
};
/* Device registers */
extern const struct zio_reg_desc zfad_regs[];
enum zfa_fsm_cmd {
ZFA_NONE = 0x0,
ZFA_START = 0x1,
ZFA_STOP = 0x2,
};
/* All possible state of the state machine, other values are invalid*/
enum zfa_fsm_state {
ZFA_STATE_IDLE = 0x1,
ZFA_STATE_IDLE = 0x1,
ZFA_STATE_PRE,
ZFA_STATE_POST,
ZFA_STATE_WAIT,
......
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