]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: addi_apci_3120: move apci3120_set_chanlist() to driver source
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:45 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:34:02 +0000 (09:34 -0800)
Move this function from the included hwdrv_apci31210.c source file to the
main driver source file.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
drivers/staging/comedi/drivers/addi_apci_3120.c

index 3c172466a3c014458ea60c914790bef855b42f09..f7543f684016367e826219a399ba6a1899196435 100644 (file)
@@ -96,34 +96,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
 
 #define APCI3120_COUNTER               3
 
-static void apci3120_set_chanlist(struct comedi_device *dev,
-                                 struct comedi_subdevice *s,
-                                 int n_chan, unsigned int *chanlist)
-{
-       struct apci3120_private *devpriv = dev->private;
-       int i;
-
-       /* set scan length (PR) and scan start (PA) */
-       devpriv->ctrl = APCI3120_CTRL_PR(n_chan - 1) | APCI3120_CTRL_PA(0);
-       outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG);
-
-       /* set chanlist for scan */
-       for (i = 0; i < n_chan; i++) {
-               unsigned int chan = CR_CHAN(chanlist[i]);
-               unsigned int range = CR_RANGE(chanlist[i]);
-               unsigned int val;
-
-               val = APCI3120_CHANLIST_MUX(chan) |
-                     APCI3120_CHANLIST_GAIN(range) |
-                     APCI3120_CHANLIST_INDEX(i);
-
-               if (comedi_range_is_unipolar(s, range))
-                       val |= APCI3120_CHANLIST_UNIPOLAR;
-
-               outw(val, dev->iobase + APCI3120_CHANLIST_REG);
-       }
-}
-
 static int apci3120_reset(struct comedi_device *dev)
 {
        struct apci3120_private *devpriv = dev->private;
index d40fdf2219a5357fcba5a430b9a0e57d46cb351a..044d2c42bcd56f5a4a91da2b31ef60f42590354d 100644 (file)
@@ -279,6 +279,34 @@ static void apci3120_ai_reset_fifo(struct comedi_device *dev)
        inw(dev->iobase + APCI3120_TIMER_MODE_REG);
 }
 
+static void apci3120_set_chanlist(struct comedi_device *dev,
+                                 struct comedi_subdevice *s,
+                                 int n_chan, unsigned int *chanlist)
+{
+       struct apci3120_private *devpriv = dev->private;
+       int i;
+
+       /* set scan length (PR) and scan start (PA) */
+       devpriv->ctrl = APCI3120_CTRL_PR(n_chan - 1) | APCI3120_CTRL_PA(0);
+       outw(devpriv->ctrl, dev->iobase + APCI3120_CTRL_REG);
+
+       /* set chanlist for scan */
+       for (i = 0; i < n_chan; i++) {
+               unsigned int chan = CR_CHAN(chanlist[i]);
+               unsigned int range = CR_RANGE(chanlist[i]);
+               unsigned int val;
+
+               val = APCI3120_CHANLIST_MUX(chan) |
+                     APCI3120_CHANLIST_GAIN(range) |
+                     APCI3120_CHANLIST_INDEX(i);
+
+               if (comedi_range_is_unipolar(s, range))
+                       val |= APCI3120_CHANLIST_UNIPOLAR;
+
+               outw(val, dev->iobase + APCI3120_CHANLIST_REG);
+       }
+}
+
 #include "addi-data/hwdrv_apci3120.c"
 
 static int apci3120_ai_eoc(struct comedi_device *dev,