]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
staging: comedi: pcl730: add support for the PCL-734 ISA board
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 6 Jun 2013 22:38:30 +0000 (15:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jun 2013 04:56:59 +0000 (21:56 -0700)
The PCL-734 ISA board can be supported by this driver. This board has
32 isolated digital outputs.

Add support for the PCL-734 board to the pcl730 driver and remove it
from the poc driver.

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

index 8f74ccdd9535082245778b8b5885003fed7a42d5..0f32d7e79bcdbb2eeae60647ef8c176a04fa335d 100644 (file)
@@ -157,6 +157,7 @@ config COMEDI_PCL730
          Advantech PCM-3730  isolated - 8 in/8 out    ttl - 16 in/16 out
          Advantech PCL-725   isolated - 8 in/8 out
          Advantech PCL-733   isolated - 32 in
+         Advantech PCL-734   isolated - 32 out
 
          To compile this driver as a module, choose M here: the module will be
          called pcl730.
@@ -534,7 +535,7 @@ config COMEDI_POC
        tristate "Generic driver for very simple devices"
        ---help---
          Enable generic support for very simple / POC (Piece of Crap) boards,
-         Keithley Metrabyte DAC-02 (dac02) and Advantech PCL-734 (pcl734).
+         Keithley Metrabyte DAC-02 (dac02).
 
          To compile this driver as a module, choose M here: the module will be
          called poc.
index 2f54c1069432310fbd589835facc191972d787ed..64aafdaebeee029a4bcdf0a7a7717096442b787d 100644 (file)
@@ -13,6 +13,7 @@
  *         (Advantech) PCM-3730 [pcm3730]
  *         (Advantech) PCL-725 [pcl725]
  *         (Advantech) PCL-733 [pcl733]
+ *         (Advantech) PCL-734 [pcl734]
  * Author: José Luis Sánchez (jsanchezv@teleline.es)
  * Status: untested
  *
@@ -33,6 +34,7 @@
  * The pcm3730 PC/104 board does not have the PCL730_IDIO_HI register.
  * The pcl725 ISA board uses separate registers for isolated digital I/O.
  * The pcl733 ISA board uses all four registers for isolated digital inputs.
+ * The pcl734 ISA board uses all four registers for isolated digital outputs.
  */
 #define PCL730_IDIO_LO 0       /* Isolated Digital I/O low byte (ID0-ID7) */
 #define PCL730_IDIO_HI 1       /* Isolated Digital I/O high byte (ID8-ID15) */
@@ -94,6 +96,11 @@ static const struct pcl730_board pcl730_boards[] = {
                .io_range       = 0x04,
                .n_subdevs      = 1,
                .n_iso_in_chan  = 32,
+       }, {
+               .name           = "pcl734",
+               .io_range       = 0x04,
+               .n_subdevs      = 1,
+               .n_iso_out_chan = 32,
        },
 };
 
@@ -114,6 +121,10 @@ static int pcl730_do_insn_bits(struct comedi_device *dev,
                        outb(s->state & 0xff, dev->iobase + reg);
                if ((mask & 0xff00) && (s->n_chan > 8))
                        outb((s->state >> 8) & 0xff, dev->iobase + reg + 1);
+               if ((mask & 0xff0000) && (s->n_chan > 16))
+                       outb((s->state >> 16) & 0xff, dev->iobase + reg + 2);
+               if ((mask & 0xff000000) && (s->n_chan > 24))
+                       outb((s->state >> 24) & 0xff, dev->iobase + reg + 3);
        }
 
        data[1] = s->state;
index 772e77adac4b1152d84736680f151014e5c7b12a..005fbefae295fc4f0968728a956f06a916a2bfc4 100644 (file)
@@ -19,14 +19,12 @@ Driver: poc
 Description: Generic driver for very simple devices
 Author: ds
 Devices: [Keithley Metrabyte] DAC-02 (dac02)
-  PCL-734 (pcl734)
 Updated: Sat, 16 Mar 2002 17:34:48 -0800
 Status: unknown
 
 This driver is indended to support very simple ISA-based devices,
 including:
   dac02 - Keithley DAC-02 analog output board
-  pcl734 - Advantech PCL-734
 
 Configuration options:
   [0] - I/O port base
@@ -96,27 +94,6 @@ static int dac02_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
        return 1;
 }
 
-static int pcl734_insn_bits(struct comedi_device *dev,
-                           struct comedi_subdevice *s,
-                           struct comedi_insn *insn, unsigned int *data)
-{
-       if (data[0]) {
-               s->state &= ~data[0];
-               s->state |= (data[0] & data[1]);
-               if ((data[0] >> 0) & 0xff)
-                       outb((s->state >> 0) & 0xff, dev->iobase + 0);
-               if ((data[0] >> 8) & 0xff)
-                       outb((s->state >> 8) & 0xff, dev->iobase + 1);
-               if ((data[0] >> 16) & 0xff)
-                       outb((s->state >> 16) & 0xff, dev->iobase + 2);
-               if ((data[0] >> 24) & 0xff)
-                       outb((s->state >> 24) & 0xff, dev->iobase + 3);
-       }
-       data[1] = s->state;
-
-       return insn->n;
-}
-
 static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        const struct boarddef_struct *board = comedi_board(dev);
@@ -163,14 +140,6 @@ static const struct boarddef_struct boards[] = {
                .winsn          = dac02_ao_winsn,
                .rinsn          = readback_insn,
                .range          = &range_unknown,
-       }, {
-               .name           = "pcl734",
-               .iosize         = 4,
-               .type           = COMEDI_SUBD_DO,
-               .n_chan         = 32,
-               .n_bits         = 1,
-               .insnbits       = pcl734_insn_bits,
-               .range          = &range_digital,
        },
 };