Commit c325f9a9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ii_pci20kc: cleanup final pieces

Tidy up the multi-line comments at the beginning of the file and
remove any irrelevant information.

Fix the II20K_ID_PCI200341M_1 define, there are one to many 0's.

Rename all the remaining pci20xxx_* to ii20k_*. The "pci" just adds
confusion, this is not a PCI board.

Remove the private (*detach) function. It's safe to call the comedi
core provided comedi_legacy_detach() even if there is nothing to
cleanup.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3aa5e811
/* /*
* comedi/drivers/ii_pci20kc.c * ii_pci20kc.c
* Driver for Intelligent Instruments PCI-20001C carrier board * Driver for Intelligent Instruments PCI-20001C carrier board and modules.
* and modules.
* *
* Copyright (C) 2000 Markus Kempf <kempf@matsci.uni-sb.de> * Copyright (C) 2000 Markus Kempf <kempf@matsci.uni-sb.de>
* with suggestions from David Schleef * with suggestions from David Schleef 16.06.2000
* 16.06.2000 */
*
* Linux device driver for COMEDI /*
* Intelligent Instrumentation * Driver: ii_pci20kc
* PCI-20001 C-2A Carrier Board * Description: Intelligent Instruments PCI-20001C carrier board
* PCI-20341 M-1A 16-Bit analog input module * Devices: (Intelligent Instrumentation) PCI-20001C [ii_pci20kc]
* - differential * Author: Markus Kempf <kempf@matsci.uni-sb.de>
* - range (-5V - +5V) * Status: works
* - 16 bit
* PCI-20006 M-2 16-Bit analog output module
* - ranges (-10V - +10V) (0V - +10V) (-5V - +5V)
* - 16 bit
*
* only ONE PCI-20341 module possible
* only ONE PCI-20006 module possible
* no extern trigger implemented
*
* NOT WORKING (but soon) only 4 on-board differential channels supported
* NOT WORKING (but soon) only ONE di-port and ONE do-port supported
* instead of 4 digital ports
* di-port == Port 0
* do-port == Port 1
*
* The state of this driver is only a starting point for a complete
* COMEDI-driver. The final driver should support all features of the
* carrier board and modules.
* *
* The test configuration: * Supports the PCI-20001C-1a and PCI-20001C-2a carrier boards. The
* -2a version has 32 on-board DIO channels. Three add-on modules
* can be added to the carrier board for additional functionality.
* *
* kernel 2.2.14 with RTAI v1.2 and patch-2.2.14rthal2 * Supported add-on modules:
* COMEDI 0.7.45 * PCI-20006M-1 1 channel, 16-bit analog output module
* COMEDILIB 0.7.9 * PCI-20006M-2 2 channel, 16-bit analog output module
* PCI-20341M-1A 4 channel, 16-bit analog input module
* *
* Options:
* 0 Board base address
* 1 IRQ (not-used)
*/ */
/*
Driver: ii_pci20kc
Description: Intelligent Instruments PCI-20001C carrier board
Author: Markus Kempf <kempf@matsci.uni-sb.de>
Devices: [Intelligent Instrumentation] PCI-20001C (ii_pci20kc)
Status: works
Supports the PCI-20001 C-2a Carrier board, and could probably support
the other carrier boards with small modifications. Modules supported
are:
PCI-20006 M-2 16-bit analog output module
PCI-20341 M-1A 16-bit analog input module
Options:
0 Board base address
1 IRQ
*/
#include <linux/module.h> #include <linux/module.h>
#include "../comedidev.h" #include "../comedidev.h"
...@@ -104,7 +74,7 @@ the other carrier boards with small modifications. Modules supported ...@@ -104,7 +74,7 @@ the other carrier boards with small modifications. Modules supported
#define II20K_AO_MSB_REG(x) (0x0e + ((x) * 0x08)) #define II20K_AO_MSB_REG(x) (0x0e + ((x) * 0x08))
#define II20K_AO_STRB_BOTH_REG 0x1b #define II20K_AO_STRB_BOTH_REG 0x1b
#define II20K_ID_PCI200341M_1 0x77 /* 4 AI channels */ #define II20K_ID_PCI20341M_1 0x77 /* 4 AI channels */
#define II20K_AI_STATUS_CMD_REG 0x01 #define II20K_AI_STATUS_CMD_REG 0x01
#define II20K_AI_STATUS_CMD_BUSY (1 << 7) #define II20K_AI_STATUS_CMD_BUSY (1 << 7)
#define II20K_AI_STATUS_CMD_HW_ENA (1 << 1) #define II20K_AI_STATUS_CMD_HW_ENA (1 << 1)
...@@ -165,14 +135,14 @@ struct ii20k_ao_private { ...@@ -165,14 +135,14 @@ struct ii20k_ao_private {
unsigned int last_data[2]; unsigned int last_data[2];
}; };
struct pci20xxx_private { struct ii20k_private {
void __iomem *ioaddr; void __iomem *ioaddr;
}; };
static void __iomem *ii20k_module_iobase(struct comedi_device *dev, static void __iomem *ii20k_module_iobase(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct pci20xxx_private *devpriv = dev->private; struct ii20k_private *devpriv = dev->private;
return devpriv->ioaddr + (s->index + 1) * II20K_MOD_OFFSET; return devpriv->ioaddr + (s->index + 1) * II20K_MOD_OFFSET;
} }
...@@ -313,7 +283,7 @@ static int ii20k_ai_insn_read(struct comedi_device *dev, ...@@ -313,7 +283,7 @@ static int ii20k_ai_insn_read(struct comedi_device *dev,
static void ii20k_dio_config(struct comedi_device *dev, static void ii20k_dio_config(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct pci20xxx_private *devpriv = dev->private; struct ii20k_private *devpriv = dev->private;
unsigned char ctrl01 = 0; unsigned char ctrl01 = 0;
unsigned char ctrl23 = 0; unsigned char ctrl23 = 0;
unsigned char dir_ena = 0; unsigned char dir_ena = 0;
...@@ -416,7 +386,7 @@ static int ii20k_dio_insn_bits(struct comedi_device *dev, ...@@ -416,7 +386,7 @@ static int ii20k_dio_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct pci20xxx_private *devpriv = dev->private; struct ii20k_private *devpriv = dev->private;
unsigned int mask = data[0] & s->io_bits; /* outputs only */ unsigned int mask = data[0] & s->io_bits; /* outputs only */
unsigned int bits = data[1]; unsigned int bits = data[1];
...@@ -470,7 +440,7 @@ static int ii20k_init_module(struct comedi_device *dev, ...@@ -470,7 +440,7 @@ static int ii20k_init_module(struct comedi_device *dev,
s->insn_read = ii20k_ao_insn_read; s->insn_read = ii20k_ao_insn_read;
s->insn_write = ii20k_ao_insn_write; s->insn_write = ii20k_ao_insn_write;
break; break;
case II20K_ID_PCI200341M_1: case II20K_ID_PCI20341M_1:
/* Analog Input subdevice */ /* Analog Input subdevice */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF; s->subdev_flags = SDF_READABLE | SDF_DIFF;
...@@ -487,10 +457,10 @@ static int ii20k_init_module(struct comedi_device *dev, ...@@ -487,10 +457,10 @@ static int ii20k_init_module(struct comedi_device *dev,
return 0; return 0;
} }
static int pci20xxx_attach(struct comedi_device *dev, static int ii20k_attach(struct comedi_device *dev,
struct comedi_devconfig *it) struct comedi_devconfig *it)
{ {
struct pci20xxx_private *devpriv; struct ii20k_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned char id; unsigned char id;
bool has_dio; bool has_dio;
...@@ -561,21 +531,16 @@ static int pci20xxx_attach(struct comedi_device *dev, ...@@ -561,21 +531,16 @@ static int pci20xxx_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
return 1; return 0;
}
static void pci20xxx_detach(struct comedi_device *dev)
{
/* Nothing to cleanup */
} }
static struct comedi_driver pci20xxx_driver = { static struct comedi_driver ii20k_driver = {
.driver_name = "ii_pci20kc", .driver_name = "ii_pci20kc",
.module = THIS_MODULE, .module = THIS_MODULE,
.attach = pci20xxx_attach, .attach = ii20k_attach,
.detach = pci20xxx_detach, .detach = comedi_legacy_detach,
}; };
module_comedi_driver(pci20xxx_driver); module_comedi_driver(ii20k_driver);
MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver"); MODULE_DESCRIPTION("Comedi low-level driver");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment