]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: addi_apci_3xxx: tidy up the ttl digital i/o subdevice init
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:14:02 +0000 (16:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:41 +0000 (14:33 -0700)
For aesthetic reasons, add some whitespace to the initialization of the
ttl digital i/o subdevices.

Fix the subdev_flags for the subdevice. The SDF_GROUND and SDF_COMMON
flags only apply to analog subdevices.

Fix the s->iobits for the subdevice. According to the datasheet:
Port 0 (channels 0-7) are always outputs
Port 1 (channels 8-15) are always inputs
Port 2 (channels 9-23) are programmable i/o (default to inputs)

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_apci_3xxx.c

index 1a7b136704e02cb53275ff5f594e2641720b1932..394d4105a4b206baf760482dc938bc6804ff80b6 100644 (file)
@@ -596,20 +596,19 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        s = &dev->subdevices[4];
        s->type = COMEDI_SUBD_UNUSED;
 
-       /*  Allocate and Initialise TTL */
+       /* TTL Digital I/O subdevice */
        s = &dev->subdevices[5];
        if (board->has_ttl_io) {
-               s->type = COMEDI_SUBD_DIO;
-               s->subdev_flags =
-                       SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
-               s->n_chan = 24;
-               s->maxdata = 1;
-               s->io_bits = 0; /* all bits input */
-               s->range_table = &range_digital;
-               s->insn_config = i_APCI3XXX_InsnConfigInitTTLIO;
-               s->insn_bits = i_APCI3XXX_InsnBitsTTLIO;
-               s->insn_read = i_APCI3XXX_InsnReadTTLIO;
-               s->insn_write = i_APCI3XXX_InsnWriteTTLIO;
+               s->type         = COMEDI_SUBD_DIO;
+               s->subdev_flags = SDF_READABLE | SDF_WRITEABLE;
+               s->n_chan       = 24;
+               s->maxdata      = 1;
+               s->io_bits      = 0xff; /* channels 0-7 are always outputs */
+               s->range_table  = &range_digital;
+               s->insn_config  = i_APCI3XXX_InsnConfigInitTTLIO;
+               s->insn_bits    = i_APCI3XXX_InsnBitsTTLIO;
+               s->insn_read    = i_APCI3XXX_InsnReadTTLIO;
+               s->insn_write   = i_APCI3XXX_InsnWriteTTLIO;
        } else {
                s->type = COMEDI_SUBD_UNUSED;
        }