staging: comedi: me_daq: all boards have the same analog input specs
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 25 Oct 2012 22:10:35 +0000 (15:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Oct 2012 16:20:02 +0000 (09:20 -0700)
All the boards supported by this driver have the same analog input
specifications. Remove the unnecessary boardinfo and just open-code
the values in the subdevice initialization.

The boards also share the same analog input range capabilities. Remove
one of the duplicate tables and rename the other to make it common for
all board types.

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

index bad34310adc7676c737a21be6f2fe19c99eb9cc9..686a1c4f5438cc84375c8263263c5c4965f83f05 100644 (file)
 #define ME_COUNTER_STARTDATA_B         0x0022  /* - | W */
 #define ME_COUNTER_VALUE_B             0x0022  /* R | - */
 
-static const struct comedi_lrange me2000_ai_range = {
-       8, {
-               BIP_RANGE(10),
-               BIP_RANGE(5),
-               BIP_RANGE(2.5),
-               BIP_RANGE(1.25),
-               UNI_RANGE(10),
-               UNI_RANGE(5),
-               UNI_RANGE(2.5),
-               UNI_RANGE(1.25)
-       }
-};
-
-static const struct comedi_lrange me2600_ai_range = {
+static const struct comedi_lrange me_ai_range = {
        8, {
                BIP_RANGE(10),
                BIP_RANGE(5),
@@ -166,9 +153,6 @@ struct me_board {
        int ao_chans;
        int ao_bits;
        const struct comedi_lrange *ao_range;
-       int ai_chans;
-       int ai_bits;
-       const struct comedi_lrange *ai_range;
 };
 
 static const struct me_board me_boards[] = {
@@ -178,15 +162,9 @@ static const struct me_board me_boards[] = {
                .ao_chans       = 4,
                .ao_bits        = 12,
                .ao_range       = &me2600_ao_range,
-               .ai_chans       = 16,
-               .ai_bits        = 12,
-               .ai_range       = &me2600_ai_range,
        }, {
                .name           = "me-2000i",
                .device_id      = ME2000_DEVICE_ID,
-               .ai_chans       = 16,
-               .ai_bits        = 12,
-               .ai_range       = &me2000_ai_range,
        }
 };
 
@@ -646,10 +624,10 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
        s = &dev->subdevices[0];
        s->type         = COMEDI_SUBD_AI;
        s->subdev_flags = SDF_READABLE | SDF_COMMON;
-       s->n_chan       = board->ai_chans;
-       s->maxdata      = (1 << board->ai_bits) - 1;
-       s->len_chanlist = board->ai_chans;
-       s->range_table  = board->ai_range;
+       s->n_chan       = 16;
+       s->maxdata      = 0x0fff;
+       s->len_chanlist = 16;
+       s->range_table  = &me_ai_range;
        s->insn_read    = me_ai_insn_read;
 
        s = &dev->subdevices[1];