else {
ul_Command = ul_Command & 0xFFFFFFFD;
} /* elseif (data[2] == ADDIDATA_ENABLE) */
- outl(ul_Command, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
- ui_InterruptData = inl(devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
+ outl(ul_Command, dev->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
+ ui_InterruptData = inl(dev->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
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 = inl(devpriv->iobase + APCI2032_DIGITAL_OP_RW);
+ s->state = inl(dev->iobase + APCI2032_DIGITAL_OP_RW);
if (mask) {
s->state &= ~mask;
s->state |= (bits & mask);
- outl(s->state, devpriv->iobase + APCI2032_DIGITAL_OP);
+ outl(s->state, dev->iobase + APCI2032_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 */
outl(0x0,
- devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
+ dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG);
/* Loading the Reload value */
outl(data[1],
- devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
+ dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_RELOAD_VALUE);
} 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 */
- outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
+ outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
break;
case 1: /* start the watchdog */
outl(0x0001,
- devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
+ dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG);
break;
case 2: /* Software trigger */
outl(0x0201,
- devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
+ dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG);
break;
default:
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
-
data[0] =
- inl(devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
+ inl(dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_TRIG_STATUS) & 0x1;
return insn->n;
}
struct addi_private *devpriv = dev->private;
unsigned int ui_DO;
- ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; /* Check if VCC OR CC interrupt has occurred. */
+ ui_DO = inl(dev->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; /* Check if VCC OR CC interrupt has occurred. */
if (ui_DO == 0) {
printk("\nInterrupt from unKnown source\n");
if (ui_DO) {
/* Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt. */
ui_Type =
- inl(devpriv->iobase +
+ inl(dev->iobase +
APCI2032_DIGITAL_OP_INTERRUPT_STATUS) & 0x3;
outl(0x0,
- devpriv->iobase + APCI2032_DIGITAL_OP +
+ dev->iobase + APCI2032_DIGITAL_OP +
APCI2032_DIGITAL_OP_INTERRUPT);
if (ui_Type == 1) {
/* Sends signal to user space */
devpriv->b_DigitalOutputRegister = 0;
ui_Type = 0;
- outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP);
- outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
- outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG);
- outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE);
+ outl(0x0, dev->iobase + APCI2032_DIGITAL_OP);
+ outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
+ outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG);
+ outl(0x0, dev->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE);
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);