aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c')
-rw-r--r--drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
index 3c408652141..0966ad6214a 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
@@ -53,7 +53,7 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
*/
#include "hwdrv_apci1032.h"
#include <linux/delay.h>
-//Global variables
+/* Global variables */
unsigned int ui_InterruptStatus = 0;
/*
@@ -107,11 +107,11 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd
outl(0x4, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
ui_TmpValue =
inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
- } //if (data[1] == ADDIDATA_OR)
+ } /* if (data[1] == ADDIDATA_OR) */
else {
outl(0x6, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
- } //else if(data[1] == ADDIDATA_OR)
- } // if( data[0] == ADDIDATA_ENABLE)
+ } /* else if(data[1] == ADDIDATA_OR) */
+ } /* if( data[0] == ADDIDATA_ENABLE) */
else {
ul_Command1 = ul_Command1 & 0xFFFF0000;
ul_Command2 = ul_Command2 & 0xFFFF0000;
@@ -120,7 +120,7 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd
outl(ul_Command2,
devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2);
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
- } //else if ( data[0] == ADDIDATA_ENABLE)
+ } /* else if ( data[0] == ADDIDATA_ENABLE) */
return insn->n;
}
@@ -152,14 +152,16 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
ui_Channel = CR_CHAN(insn->chanspec);
if (ui_Channel >= 0 && ui_Channel <= 31) {
ui_TmpValue = (unsigned int) inl(devpriv->iobase + APCI1032_DIGITAL_IP);
- // since only 1 channel reqd to bring it to last bit it is rotated
- // 8 +(chan - 1) times then ANDed with 1 for last bit.
+/*
+* since only 1 channel reqd to bring it to last bit it is rotated 8
+* +(chan - 1) times then ANDed with 1 for last bit.
+*/
*data = (ui_TmpValue >> ui_Channel) & 0x1;
- } //if(ui_Channel >= 0 && ui_Channel <=31)
+ } /* if(ui_Channel >= 0 && ui_Channel <=31) */
else {
- //comedi_error(dev," \n chan spec wrong\n");
- return -EINVAL; // "sorry channel spec wrong "
- } //else if(ui_Channel >= 0 && ui_Channel <=31)
+ /* comedi_error(dev," \n chan spec wrong\n"); */
+ return -EINVAL; /* "sorry channel spec wrong " */
+ } /* else if(ui_Channel >= 0 && ui_Channel <=31) */
return insn->n;
}
@@ -213,16 +215,16 @@ int i_APCI1032_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
case 31:
break;
default:
- //comedi_error(dev," \nchan spec wrong\n");
- return -EINVAL; // "sorry channel spec wrong "
+ /* comedi_error(dev," \nchan spec wrong\n"); */
+ return -EINVAL; /* "sorry channel spec wrong " */
break;
- } //switch(ui_NoOfChannels)
- } //if(data[1]==0)
+ } /* switch(ui_NoOfChannels) */
+ } /* if(data[1]==0) */
else {
if (data[1] == 1) {
*data = ui_InterruptStatus;
- } //if(data[1]==1)
- } //else if(data[1]==0)
+ } /* if(data[1]==1) */
+ } /* else if(data[1]==0) */
return insn->n;
}
@@ -248,15 +250,15 @@ static void v_APCI1032_Interrupt(int irq, void *d)
struct comedi_device *dev = d;
unsigned int ui_Temp;
- //disable the interrupt
+ /* disable the interrupt */
ui_Temp = inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
outl(ui_Temp & APCI1032_DIGITAL_IP_INTERRUPT_DISABLE,
devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
ui_InterruptStatus =
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS);
ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
- send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample
- outl(ui_Temp, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //enable the interrupt
+ send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
+ outl(ui_Temp, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); /* enable the interrupt */
return;
}
@@ -277,9 +279,9 @@ static void v_APCI1032_Interrupt(int irq, void *d)
int i_APCI1032_Reset(struct comedi_device * dev)
{
- outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //disable the interrupts
- inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); //Reset the interrupt status register
- outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE1); //Disable the and/or interrupt
+ outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); /* disable the interrupts */
+ inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); /* Reset the interrupt status register */
+ outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE1); /* Disable the and/or interrupt */
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2);
return 0;
}