Commit 0d5e0307 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_write_insn_timer()

Use register bit defines from addi_tcw.h to remove the "magic" numbers.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7dc68e35
......@@ -93,17 +93,17 @@ static int apci3501_write_insn_timer(struct comedi_device *dev,
if (devpriv->timer_mode == ADDIDATA_WATCHDOG ||
devpriv->timer_mode == ADDIDATA_TIMER) {
ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG);
ctrl &= 0xfffff9ff;
ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG);
if (data[1] == 1) { /* enable */
ctrl |= 0x1;
ctrl |= ADDI_TCW_CTRL_ENA;
} else if (data[1] == 0) { /* stop */
if (devpriv->timer_mode == ADDIDATA_WATCHDOG)
ctrl = 0;
else
ctrl &= ~0x1;
ctrl &= ~ADDI_TCW_CTRL_ENA;
} else if (data[1] == 2) { /* trigger */
ctrl |= 0x200;
ctrl |= ADDI_TCW_CTRL_TRIG;
}
outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG);
}
......
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