From 100515f81099f42524e64d153882a400aad22248 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 30 Sep 2013 17:53:31 -0700 Subject: [PATCH] staging: comedi: ni_at_ao: move the atao_reset() function For aesthetics, move this function closer to it's only caller. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_at_ao.c | 66 +++++++++++------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_at_ao.c b/drivers/staging/comedi/drivers/ni_at_ao.c index 0a8ed0c5785b..7803ad184214 100644 --- a/drivers/staging/comedi/drivers/ni_at_ao.c +++ b/drivers/staging/comedi/drivers/ni_at_ao.c @@ -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); -- 2.30.2