struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
-
- data[1] = inw(devpriv->iobase + APCI2200_DIGITAL_IP);
+ data[1] = inw(dev->iobase + APCI2200_DIGITAL_IP);
return insn->n;
}
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
unsigned int mask = data[0];
unsigned int bits = data[1];
- s->state = inw(devpriv->iobase + APCI2200_DIGITAL_OP);
+ s->state = inw(dev->iobase + APCI2200_DIGITAL_OP);
if (mask) {
s->state &= ~mask;
s->state |= (bits & mask);
- outw(s->state, devpriv->iobase + APCI2200_DIGITAL_OP);
+ outw(s->state, dev->iobase + APCI2200_DIGITAL_OP);
}
data[1] = s->state;
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
-
if (data[0] == 0) {
/* Disable the watchdog */
- outw(0x0,
- devpriv->iobase + APCI2200_WATCHDOG +
- APCI2200_WATCHDOG_ENABLEDISABLE);
+ outw(0x0, dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_ENABLEDISABLE);
/* Loading the Reload value */
- outw(data[1],
- devpriv->iobase + APCI2200_WATCHDOG +
- APCI2200_WATCHDOG_RELOAD_VALUE);
+ outw(data[1], dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_RELOAD_VALUE);
data[1] = data[1] >> 16;
- outw(data[1],
- devpriv->iobase + APCI2200_WATCHDOG +
- APCI2200_WATCHDOG_RELOAD_VALUE + 2);
+ outw(data[1], dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_RELOAD_VALUE + 2);
} /* if(data[0]==0) */
else {
printk("\nThe input parameters are wrong\n");
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
-
switch (data[0]) {
case 0: /* stop the watchdog */
- outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
+ outw(0x0, dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_ENABLEDISABLE);
break;
case 1: /* start the watchdog */
- outw(0x0001,
- devpriv->iobase + APCI2200_WATCHDOG +
- APCI2200_WATCHDOG_ENABLEDISABLE);
+ outw(0x0001, dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_ENABLEDISABLE);
break;
case 2: /* Software trigger */
- outw(0x0201,
- devpriv->iobase + APCI2200_WATCHDOG +
- APCI2200_WATCHDOG_ENABLEDISABLE);
+ outw(0x0201, dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_ENABLEDISABLE);
break;
default:
printk("\nSpecified functionality does not exist\n");
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
-
- data[0] =
- inw(devpriv->iobase + APCI2200_WATCHDOG +
- APCI2200_WATCHDOG_STATUS) & 0x1;
+ data[0] = inw(dev->iobase + APCI2200_WATCHDOG +
+ APCI2200_WATCHDOG_STATUS) & 0x1;
return insn->n;
}
static int apci2200_reset(struct comedi_device *dev)
{
- struct addi_private *devpriv = dev->private;
-
- outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP);
- outw(0x0, devpriv->iobase + APCI2200_WATCHDOG +
+ outw(0x0, dev->iobase + APCI2200_DIGITAL_OP);
+ outw(0x0, dev->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE);
- outw(0x0, devpriv->iobase + APCI2200_WATCHDOG +
+ outw(0x0, dev->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_RELOAD_VALUE);
- outw(0x0, devpriv->iobase + APCI2200_WATCHDOG +
+ outw(0x0, dev->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_RELOAD_VALUE + 2);
return 0;
return ret;
dev->iobase = pci_resource_start(pcidev, 1);
- devpriv->iobase = dev->iobase;
devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);