Commit 100515f8 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_at_ao: move the atao_reset() function

For aesthetics, move this function closer to it's only caller.
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 83fa0099
......@@ -124,39 +124,6 @@ struct atao_private {
unsigned char caldac[21];
};
static void atao_reset(struct comedi_device *dev)
{
struct atao_private *devpriv = dev->private;
/* This is the reset sequence described in the manual */
devpriv->cfg1 = 0;
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1_REG);
/* Put outputs of counter 1 and counter 2 in a high state */
i8254_load(dev->iobase + ATAO_82C53_BASE, 0,
0, 0x0003, I8254_MODE4 | I8254_BINARY);
i8254_set_mode(dev->iobase + ATAO_82C53_BASE, 0,
1, I8254_MODE4 | I8254_BINARY);
outw(ATAO_CFG2_CALLD_NOP, dev->iobase + ATAO_CFG2_REG);
devpriv->cfg3 = 0;
outw(devpriv->cfg3, dev->iobase + ATAO_CFG3_REG);
inw(dev->iobase + ATAO_FIFO_CLEAR_REG);
devpriv->cfg1 |= ATAO_CFG1_GRP2WR;
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1_REG);
outw(0, dev->iobase + ATAO_2_INT1CLR_REG);
outw(0, dev->iobase + ATAO_2_INT2CLR_REG);
outw(0, dev->iobase + ATAO_2_DMATCCLR_REG);
devpriv->cfg1 &= ~ATAO_CFG1_GRP2WR;
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1_REG);
}
static int atao_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
......@@ -323,6 +290,39 @@ static int atao_calib_insn_read(struct comedi_device *dev,
return insn->n;
}
static void atao_reset(struct comedi_device *dev)
{
struct atao_private *devpriv = dev->private;
/* This is the reset sequence described in the manual */
devpriv->cfg1 = 0;
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1_REG);
/* Put outputs of counter 1 and counter 2 in a high state */
i8254_load(dev->iobase + ATAO_82C53_BASE, 0,
0, 0x0003, I8254_MODE4 | I8254_BINARY);
i8254_set_mode(dev->iobase + ATAO_82C53_BASE, 0,
1, I8254_MODE4 | I8254_BINARY);
outw(ATAO_CFG2_CALLD_NOP, dev->iobase + ATAO_CFG2_REG);
devpriv->cfg3 = 0;
outw(devpriv->cfg3, dev->iobase + ATAO_CFG3_REG);
inw(dev->iobase + ATAO_FIFO_CLEAR_REG);
devpriv->cfg1 |= ATAO_CFG1_GRP2WR;
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1_REG);
outw(0, dev->iobase + ATAO_2_INT1CLR_REG);
outw(0, dev->iobase + ATAO_2_INT2CLR_REG);
outw(0, dev->iobase + ATAO_2_DMATCCLR_REG);
devpriv->cfg1 &= ~ATAO_CFG1_GRP2WR;
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1_REG);
}
static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct atao_board *board = comedi_board(dev);
......
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