Commit 6eef3af5 authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

Staging: comedi: remove C99 comments in cb_pcimdas.c

Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cf530aa4
...@@ -48,24 +48,24 @@ See http://www.measurementcomputing.com/PDFManuals/pcim-das1602_16.pdf for more ...@@ -48,24 +48,24 @@ See http://www.measurementcomputing.com/PDFManuals/pcim-das1602_16.pdf for more
#include "plx9052.h" #include "plx9052.h"
#include "8255.h" #include "8255.h"
//#define CBPCIMDAS_DEBUG /* #define CBPCIMDAS_DEBUG */
#undef CBPCIMDAS_DEBUG #undef CBPCIMDAS_DEBUG
/* Registers for the PCIM-DAS1602/16 */ /* Registers for the PCIM-DAS1602/16 */
// sizes of io regions (bytes) /* sizes of io regions (bytes) */
#define BADR0_SIZE 2 //?? #define BADR0_SIZE 2 /* ?? */
#define BADR1_SIZE 4 #define BADR1_SIZE 4
#define BADR2_SIZE 6 #define BADR2_SIZE 6
#define BADR3_SIZE 16 #define BADR3_SIZE 16
#define BADR4_SIZE 4 #define BADR4_SIZE 4
//DAC Offsets /* DAC Offsets */
#define ADC_TRIG 0 #define ADC_TRIG 0
#define DAC0_OFFSET 2 #define DAC0_OFFSET 2
#define DAC1_OFFSET 4 #define DAC1_OFFSET 4
//AI and Counter Constants /* AI and Counter Constants */
#define MUX_LIMITS 0 #define MUX_LIMITS 0
#define MAIN_CONN_DIO 1 #define MAIN_CONN_DIO 1
#define ADC_STAT 2 #define ADC_STAT 2
...@@ -86,17 +86,17 @@ See http://www.measurementcomputing.com/PDFManuals/pcim-das1602_16.pdf for more ...@@ -86,17 +86,17 @@ See http://www.measurementcomputing.com/PDFManuals/pcim-das1602_16.pdf for more
struct cb_pcimdas_board { struct cb_pcimdas_board {
const char *name; const char *name;
unsigned short device_id; unsigned short device_id;
int ai_se_chans; // Inputs in single-ended mode int ai_se_chans; /* Inputs in single-ended mode */
int ai_diff_chans; // Inputs in differential mode int ai_diff_chans; /* Inputs in differential mode */
int ai_bits; // analog input resolution int ai_bits; /* analog input resolution */
int ai_speed; // fastest conversion period in ns int ai_speed; /* fastest conversion period in ns */
int ao_nchan; // number of analog out channels int ao_nchan; /* number of analog out channels */
int ao_bits; // analogue output resolution int ao_bits; /* analogue output resolution */
int has_ao_fifo; // analog output has fifo int has_ao_fifo; /* analog output has fifo */
int ao_scan_speed; // analog output speed for 1602 series (for a scan, not conversion) int ao_scan_speed; /* analog output speed for 1602 series (for a scan, not conversion) */
int fifo_size; // number of samples fifo can hold int fifo_size; /* number of samples fifo can hold */
int dio_bits; // number of dio bits int dio_bits; /* number of dio bits */
int has_dio; // has DIO int has_dio; /* has DIO */
const struct comedi_lrange *ranges; const struct comedi_lrange *ranges;
}; };
...@@ -107,16 +107,16 @@ static const struct cb_pcimdas_board cb_pcimdas_boards[] = { ...@@ -107,16 +107,16 @@ static const struct cb_pcimdas_board cb_pcimdas_boards[] = {
ai_se_chans:16, ai_se_chans:16,
ai_diff_chans:8, ai_diff_chans:8,
ai_bits: 16, ai_bits: 16,
ai_speed:10000, //?? ai_speed:10000, /* ?? */
ao_nchan:2, ao_nchan:2,
ao_bits: 12, ao_bits: 12,
has_ao_fifo:0, //?? has_ao_fifo:0, /* ?? */
ao_scan_speed:10000, ao_scan_speed:10000,
//?? /* ?? */
fifo_size:1024, fifo_size:1024,
dio_bits:24, dio_bits:24,
has_dio: 1, has_dio: 1,
// ranges: &cb_pcimdas_ranges, /* ranges: &cb_pcimdas_ranges, */
}, },
}; };
...@@ -129,7 +129,7 @@ static DEFINE_PCI_DEVICE_TABLE(cb_pcimdas_pci_table) = { ...@@ -129,7 +129,7 @@ static DEFINE_PCI_DEVICE_TABLE(cb_pcimdas_pci_table) = {
MODULE_DEVICE_TABLE(pci, cb_pcimdas_pci_table); MODULE_DEVICE_TABLE(pci, cb_pcimdas_pci_table);
#define N_BOARDS 1 // Max number of boards supported #define N_BOARDS 1 /* Max number of boards supported */
/* /*
* Useful for shorthand access to the particular board structure * Useful for shorthand access to the particular board structure
...@@ -142,10 +142,10 @@ MODULE_DEVICE_TABLE(pci, cb_pcimdas_pci_table); ...@@ -142,10 +142,10 @@ MODULE_DEVICE_TABLE(pci, cb_pcimdas_pci_table);
struct cb_pcimdas_private { struct cb_pcimdas_private {
int data; int data;
// would be useful for a PCI device /* would be useful for a PCI device */
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
//base addresses /* base addresses */
unsigned long BADR0; unsigned long BADR0;
unsigned long BADR1; unsigned long BADR1;
unsigned long BADR2; unsigned long BADR2;
...@@ -155,11 +155,11 @@ struct cb_pcimdas_private { ...@@ -155,11 +155,11 @@ struct cb_pcimdas_private {
/* Used for AO readback */ /* Used for AO readback */
unsigned int ao_readback[2]; unsigned int ao_readback[2];
// Used for DIO /* Used for DIO */
unsigned short int port_a; // copy of BADR4+0 unsigned short int port_a; /* copy of BADR4+0 */
unsigned short int port_b; // copy of BADR4+1 unsigned short int port_b; /* copy of BADR4+1 */
unsigned short int port_c; // copy of BADR4+2 unsigned short int port_c; /* copy of BADR4+2 */
unsigned short int dio_mode; // copy of BADR4+3 unsigned short int dio_mode; /* copy of BADR4+3 */
}; };
...@@ -202,7 +202,7 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig ...@@ -202,7 +202,7 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig
struct comedi_subdevice *s; struct comedi_subdevice *s;
struct pci_dev *pcidev; struct pci_dev *pcidev;
int index; int index;
//int i; /* int i; */
printk("comedi%d: cb_pcimdas: ", dev->minor); printk("comedi%d: cb_pcimdas: ", dev->minor);
...@@ -220,17 +220,17 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig ...@@ -220,17 +220,17 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig
for (pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); for (pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
pcidev != NULL; pcidev != NULL;
pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev)) { pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev)) {
// is it not a computer boards card? /* is it not a computer boards card? */
if (pcidev->vendor != PCI_VENDOR_ID_COMPUTERBOARDS) if (pcidev->vendor != PCI_VENDOR_ID_COMPUTERBOARDS)
continue; continue;
// loop through cards supported by this driver /* loop through cards supported by this driver */
for (index = 0; index < N_BOARDS; index++) { for (index = 0; index < N_BOARDS; index++) {
if (cb_pcimdas_boards[index].device_id != if (cb_pcimdas_boards[index].device_id !=
pcidev->device) pcidev->device)
continue; continue;
// was a particular bus/slot requested? /* was a particular bus/slot requested? */
if (it->options[0] || it->options[1]) { if (it->options[0] || it->options[1]) {
// are we on the wrong bus/slot? /* are we on the wrong bus/slot? */
if (pcidev->bus->number != it->options[0] || if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) != PCI_SLOT(pcidev->devfn) !=
it->options[1]) { it->options[1]) {
...@@ -252,7 +252,7 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig ...@@ -252,7 +252,7 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig
printk("Found %s on bus %i, slot %i\n", cb_pcimdas_boards[index].name, printk("Found %s on bus %i, slot %i\n", cb_pcimdas_boards[index].name,
pcidev->bus->number, PCI_SLOT(pcidev->devfn)); pcidev->bus->number, PCI_SLOT(pcidev->devfn));
// Warn about non-tested features /* Warn about non-tested features */
switch (thisboard->device_id) { switch (thisboard->device_id) {
case 0x56: case 0x56:
break; break;
...@@ -280,16 +280,16 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig ...@@ -280,16 +280,16 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig
printk("devpriv->BADR4 = 0x%lx\n", devpriv->BADR4); printk("devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
#endif #endif
// Dont support IRQ yet /* Dont support IRQ yet */
// // get irq /* get irq */
// if(comedi_request_irq(devpriv->pci_dev->irq, cb_pcimdas_interrupt, IRQF_SHARED, "cb_pcimdas", dev )) /* if(comedi_request_irq(devpriv->pci_dev->irq, cb_pcimdas_interrupt, IRQF_SHARED, "cb_pcimdas", dev )) */
// { /* { */
// printk(" unable to allocate irq %u\n", devpriv->pci_dev->irq); /* printk(" unable to allocate irq %u\n", devpriv->pci_dev->irq); */
// return -EINVAL; /* return -EINVAL; */
// } /* } */
// dev->irq = devpriv->pci_dev->irq; /* dev->irq = devpriv->pci_dev->irq; */
//Initialize dev->board_name /* Initialize dev->board_name */
dev->board_name = thisboard->name; dev->board_name = thisboard->name;
/* /*
...@@ -300,24 +300,24 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig ...@@ -300,24 +300,24 @@ static int cb_pcimdas_attach(struct comedi_device * dev, struct comedi_devconfig
return -ENOMEM; return -ENOMEM;
s = dev->subdevices + 0; s = dev->subdevices + 0;
//dev->read_subdev=s; /* dev->read_subdev=s; */
// analog input subdevice /* analog input subdevice */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = thisboard->ai_se_chans; s->n_chan = thisboard->ai_se_chans;
s->maxdata = (1 << thisboard->ai_bits) - 1; s->maxdata = (1 << thisboard->ai_bits) - 1;
s->range_table = &range_unknown; s->range_table = &range_unknown;
s->len_chanlist = 1; // This is the maximum chanlist length that s->len_chanlist = 1; /* This is the maximum chanlist length that */
// the board can handle /* the board can handle */
s->insn_read = cb_pcimdas_ai_rinsn; s->insn_read = cb_pcimdas_ai_rinsn;
s = dev->subdevices + 1; s = dev->subdevices + 1;
// analog output subdevice /* analog output subdevice */
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
s->n_chan = thisboard->ao_nchan; s->n_chan = thisboard->ao_nchan;
s->maxdata = 1 << thisboard->ao_bits; s->maxdata = 1 << thisboard->ao_bits;
s->range_table = &range_unknown; //ranges are hardware settable, but not software readable. s->range_table = &range_unknown; /* ranges are hardware settable, but not software readable. */
s->insn_write = &cb_pcimdas_ao_winsn; s->insn_write = &cb_pcimdas_ao_winsn;
s->insn_read = &cb_pcimdas_ao_rinsn; s->insn_read = &cb_pcimdas_ao_rinsn;
...@@ -382,27 +382,27 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevi ...@@ -382,27 +382,27 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevi
unsigned short chanlims; unsigned short chanlims;
int maxchans; int maxchans;
// only support sw initiated reads from a single channel /* only support sw initiated reads from a single channel */
//check channel number /* check channel number */
if ((inb(devpriv->BADR3 + 2) & 0x20) == 0) //differential mode if ((inb(devpriv->BADR3 + 2) & 0x20) == 0) /* differential mode */
maxchans = thisboard->ai_diff_chans; maxchans = thisboard->ai_diff_chans;
else else
maxchans = thisboard->ai_se_chans; maxchans = thisboard->ai_se_chans;
if (chan > (maxchans - 1)) if (chan > (maxchans - 1))
return -ETIMEDOUT; //*** Wrong error code. Fixme. return -ETIMEDOUT; /* *** Wrong error code. Fixme. */
//configure for sw initiated read /* configure for sw initiated read */
d = inb(devpriv->BADR3 + 5); d = inb(devpriv->BADR3 + 5);
if ((d & 0x03) > 0) { //only reset if needed. if ((d & 0x03) > 0) { /* only reset if needed. */
d = d & 0xfd; d = d & 0xfd;
outb(d, devpriv->BADR3 + 5); outb(d, devpriv->BADR3 + 5);
} }
outb(0x01, devpriv->BADR3 + 6); //set bursting off, conversions on outb(0x01, devpriv->BADR3 + 6); /* set bursting off, conversions on */
outb(0x00, devpriv->BADR3 + 7); //set range to 10V. UP/BP is controlled by a switch on the board outb(0x00, devpriv->BADR3 + 7); /* set range to 10V. UP/BP is controlled by a switch on the board */
// write channel limits to multiplexer, set Low (bits 0-3) and High (bits 4-7) channels to chan. /* write channel limits to multiplexer, set Low (bits 0-3) and High (bits 4-7) channels to chan. */
chanlims = chan | (chan << 4); chanlims = chan | (chan << 4);
outb(chanlims, devpriv->BADR3 + 0); outb(chanlims, devpriv->BADR3 + 0);
...@@ -411,8 +411,8 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevi ...@@ -411,8 +411,8 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevi
/* trigger conversion */ /* trigger conversion */
outw(0, devpriv->BADR2 + 0); outw(0, devpriv->BADR2 + 0);
#define TIMEOUT 1000 //typically takes 5 loops on a lightly loaded Pentium 100MHz, #define TIMEOUT 1000 /* typically takes 5 loops on a lightly loaded Pentium 100MHz, */
//this is likely to be 100 loops on a 2GHz machine, so set 1000 as the limit. /* this is likely to be 100 loops on a 2GHz machine, so set 1000 as the limit. */
/* wait for conversion to end */ /* wait for conversion to end */
for (i = 0; i < TIMEOUT; i++) { for (i = 0; i < TIMEOUT; i++) {
...@@ -428,7 +428,7 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevi ...@@ -428,7 +428,7 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevi
d = inw(devpriv->BADR2 + 0); d = inw(devpriv->BADR2 + 0);
/* mangle the data as necessary */ /* mangle the data as necessary */
//d ^= 1<<(thisboard->ai_bits-1); // 16 bit data from ADC, so no mangle needed. /* d ^= 1<<(thisboard->ai_bits-1); // 16 bit data from ADC, so no mangle needed. */
data[n] = d; data[n] = d;
} }
......
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