return 1;
}
-static void rtd_init_board(struct comedi_device *dev)
+static void rtd_reset(struct comedi_device *dev)
{
struct rtdPrivate *devpriv = dev->private;
- /* initialize board, per RTD spec */
- /* also, initialize shadow registers */
writel(0, devpriv->las0 + LAS0_BOARD_RESET);
udelay(100); /* needed? */
writel(0, devpriv->lcfg + LCFG_ITCSR);
devpriv->intClearMask = ~0;
writew(devpriv->intClearMask, devpriv->las0 + LAS0_CLEAR);
readw(devpriv->las0 + LAS0_CLEAR);
+}
+
+/*
+ * initialize board, per RTD spec
+ * also, initialize shadow registers
+ */
+static void rtd_init_board(struct comedi_device *dev)
+{
+ struct rtdPrivate *devpriv = dev->private;
+
+ rtd_reset(dev);
+
writel(0, devpriv->las0 + LAS0_OVERRUN);
writel(0, devpriv->las0 + LAS0_CGT_CLEAR);
writel(0, devpriv->las0 + LAS0_ADC_FIFO_CLEAR);
writel(ICS_PIE | ICS_PLIE, devpriv->lcfg + LCFG_ITCSR);
}
#endif /* USE_DMA */
- if (devpriv->las0) {
- writel(0, devpriv->las0 + LAS0_BOARD_RESET);
- devpriv->intMask = 0;
- writew(devpriv->intMask, devpriv->las0 + LAS0_IT);
- devpriv->intClearMask = ~0;
- writew(devpriv->intClearMask,
- devpriv->las0 + LAS0_CLEAR);
- readw(devpriv->las0 + LAS0_CLEAR);
- }
+ if (devpriv->las0 && devpriv->lcfg)
+ rtd_reset(dev);
#ifdef USE_DMA
/* release DMA */
for (index = 0; index < DMA_CHAIN_COUNT; index++) {