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

staging: comedi: addi_common.h: remove ADDIDATA_{EN, DIS}ABLE defines

These defines don't add any additional clarity to the addi_data drivers.
Just remove them.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 223a6402
......@@ -26,13 +26,6 @@
#define ADDIDATA_93C76 "93C76"
#define ADDIDATA_S5920 "S5920"
/* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0
/* Structures */
/* structure for the boardtype */
struct addi_board {
const char *pc_DriverName; /* driver name */
int i_IorangeBase1;
......
......@@ -177,8 +177,7 @@ static int apci035_timer_config(struct comedi_device *dev,
/* Disable the hardware trigger */
ui_Command = ui_Command & 0xFFFFF89FUL;
if (data[4] == ADDIDATA_ENABLE) {
if (data[4] == 1) {
/* Set the hardware trigger level */
ui_Command = ui_Command | (data[5] << 5);
}
......@@ -188,8 +187,7 @@ static int apci035_timer_config(struct comedi_device *dev,
/* Disable the hardware gate */
ui_Command = ui_Command & 0xFFFFF87FUL;
if (data[6] == ADDIDATA_ENABLE) {
if (data[6] == 1) {
/* Set the hardware gate level */
ui_Command = ui_Command | (data[7] << 7);
}
......@@ -203,8 +201,7 @@ static int apci035_timer_config(struct comedi_device *dev,
/* Set the hardware output level */
ui_Command = ui_Command | (data[8] << 2);
outl(ui_Command, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
if (data[9] == ADDIDATA_ENABLE) {
if (data[9] == 1) {
/* Set the reload value */
outl(data[11],
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 24);
......
......@@ -111,7 +111,7 @@ static int apci1564_di_config(struct comedi_device *dev,
devpriv->tsk_Current = current;
/* Set the digital input logic */
if (data[0] == ADDIDATA_ENABLE) {
if (data[0] == 1) {
data[2] = data[2] << 4;
data[3] = data[3] << 4;
outl(data[2], devpriv->i_IobaseAmcc + APCI1564_DI_INT_MODE1_REG);
......@@ -150,16 +150,16 @@ static int apci1564_do_config(struct comedi_device *dev,
}
if (data[0])
devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE;
devpriv->b_OutputMemoryStatus = 1;
else
devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE;
devpriv->b_OutputMemoryStatus = 0;
if (data[1] == ADDIDATA_ENABLE)
if (data[1] == 1)
ul_Command = ul_Command | 0x1;
else
ul_Command = ul_Command & 0xFFFFFFFE;
if (data[2] == ADDIDATA_ENABLE)
if (data[2] == 1)
ul_Command = ul_Command | 0x2;
else
ul_Command = ul_Command & 0xFFFFFFFD;
......
......@@ -689,17 +689,11 @@ static int i_APCI3200_Read1AnalogInputChannel(struct comedi_device *dev,
ui_CommandRegister = ui_ChannelNo | (ui_ChannelNo << 8) | 0x80000;
/*********************************/
/*Test if the interrupt is enable */
/*********************************/
/* if (i_InterruptFlag == ADDIDATA_ENABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_ENABLE) {
/************************/
if (s_BoardInfos[dev->minor].i_InterruptFlag == 1) {
/* Enable the interrupt */
/************************/
ui_CommandRegister = ui_CommandRegister | 0x00100000;
} /* if (i_InterruptFlag == ADDIDATA_ENABLE) */
}
/******************************/
/* Write the command register */
......@@ -712,11 +706,8 @@ static int i_APCI3200_Read1AnalogInputChannel(struct comedi_device *dev,
outl(ui_CommandRegister,
devpriv->iobase + s_BoardInfos[dev->minor].i_Offset + 8);
/*****************************/
/*Test if interrupt is enable */
/*****************************/
/* if (i_InterruptFlag == ADDIDATA_DISABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_DISABLE) {
if (s_BoardInfos[dev->minor].i_InterruptFlag == 0) {
do {
/*************************/
/*Read the EOC Status bit */
......@@ -738,7 +729,7 @@ static int i_APCI3200_Read1AnalogInputChannel(struct comedi_device *dev,
s_BoardInfos[dev->minor].i_Offset + 28);
/* END JK 06.07.04: Management of sevrals boards */
} /* if (i_InterruptFlag == ADDIDATA_DISABLE) */
}
return 0;
}
......@@ -800,20 +791,11 @@ static int i_APCI3200_ReadCalibrationOffsetValue(struct comedi_device *dev,
ui_CommandRegister = 0;
/*********************************/
/*Test if the interrupt is enable */
/*********************************/
/* if (i_InterruptFlag == ADDIDATA_ENABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_ENABLE) {
/**********************/
if (s_BoardInfos[dev->minor].i_InterruptFlag == 1) {
/*Enable the interrupt */
/**********************/
ui_CommandRegister = ui_CommandRegister | 0x00100000;
} /* if (i_InterruptFlag == ADDIDATA_ENABLE) */
}
/**********************/
/*Start the conversion */
......@@ -830,13 +812,8 @@ static int i_APCI3200_ReadCalibrationOffsetValue(struct comedi_device *dev,
outl(ui_CommandRegister,
devpriv->iobase + s_BoardInfos[dev->minor].i_Offset + 8);
/*****************************/
/*Test if interrupt is enable */
/*****************************/
/* if (i_InterruptFlag == ADDIDATA_DISABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_DISABLE) {
if (s_BoardInfos[dev->minor].i_InterruptFlag == 0) {
do {
/*******************/
/*Read the EOC flag */
......@@ -856,7 +833,7 @@ static int i_APCI3200_ReadCalibrationOffsetValue(struct comedi_device *dev,
data[0] =
inl(devpriv->iobase +
s_BoardInfos[dev->minor].i_Offset + 28);
} /* if (i_InterruptFlag == ADDIDATA_DISABLE) */
}
return 0;
}
......@@ -915,20 +892,11 @@ static int i_APCI3200_ReadCalibrationGainValue(struct comedi_device *dev,
ui_CommandRegister = 0;
/*********************************/
/*Test if the interrupt is enable */
/*********************************/
/* if (i_InterruptFlag == ADDIDATA_ENABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_ENABLE) {
/**********************/
if (s_BoardInfos[dev->minor].i_InterruptFlag == 1) {
/*Enable the interrupt */
/**********************/
ui_CommandRegister = ui_CommandRegister | 0x00100000;
} /* if (i_InterruptFlag == ADDIDATA_ENABLE) */
}
/**********************/
/*Start the conversion */
......@@ -945,13 +913,8 @@ static int i_APCI3200_ReadCalibrationGainValue(struct comedi_device *dev,
outl(ui_CommandRegister,
devpriv->iobase + s_BoardInfos[dev->minor].i_Offset + 8);
/*****************************/
/*Test if interrupt is enable */
/*****************************/
/* if (i_InterruptFlag == ADDIDATA_DISABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_DISABLE) {
if (s_BoardInfos[dev->minor].i_InterruptFlag == 0) {
do {
/*******************/
......@@ -973,7 +936,7 @@ static int i_APCI3200_ReadCalibrationGainValue(struct comedi_device *dev,
inl(devpriv->iobase +
s_BoardInfos[dev->minor].i_Offset + 28);
} /* if (i_InterruptFlag == ADDIDATA_DISABLE) */
}
return 0;
}
......@@ -1020,14 +983,9 @@ static int i_APCI3200_ReadCJCValue(struct comedi_device *dev,
/*Initialise dw_CommandRegister */
/*******************************/
ui_CommandRegister = 0;
/*********************************/
/*Test if the interrupt is enable */
/*********************************/
/* if (i_InterruptFlag == ADDIDATA_ENABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_ENABLE) {
/**********************/
if (s_BoardInfos[dev->minor].i_InterruptFlag == 1) {
/*Enable the interrupt */
/**********************/
ui_CommandRegister = ui_CommandRegister | 0x00100000;
}
......@@ -1047,12 +1005,8 @@ static int i_APCI3200_ReadCJCValue(struct comedi_device *dev,
outl(ui_CommandRegister,
devpriv->iobase + s_BoardInfos[dev->minor].i_Offset + 8);
/*****************************/
/*Test if interrupt is enable */
/*****************************/
/* if (i_InterruptFlag == ADDIDATA_DISABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_DISABLE) {
if (s_BoardInfos[dev->minor].i_InterruptFlag == 0) {
do {
/*******************/
......@@ -1073,8 +1027,7 @@ static int i_APCI3200_ReadCJCValue(struct comedi_device *dev,
data[0] =
inl(devpriv->iobase +
s_BoardInfos[dev->minor].i_Offset + 28);
} /* if (i_InterruptFlag == ADDIDATA_DISABLE) */
}
return 0;
}
......@@ -1128,17 +1081,10 @@ static int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev,
/*Initialise ui_CommandRegister */
/*******************************/
ui_CommandRegister = 0;
/*********************************/
/*Test if the interrupt is enable */
/*********************************/
/* if (i_InterruptFlag == ADDIDATA_ENABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_ENABLE) {
/**********************/
if (s_BoardInfos[dev->minor].i_InterruptFlag == 1) {
/*Enable the interrupt */
/**********************/
ui_CommandRegister = ui_CommandRegister | 0x00100000;
}
/**********************/
......@@ -1154,8 +1100,7 @@ static int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev,
/* outl(ui_CommandRegister,devpriv->iobase+i_Offset + 8); */
outl(ui_CommandRegister,
devpriv->iobase + s_BoardInfos[dev->minor].i_Offset + 8);
/* if (i_InterruptFlag == ADDIDATA_DISABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_DISABLE) {
if (s_BoardInfos[dev->minor].i_InterruptFlag == 0) {
do {
/*******************/
/*Read the EOC flag */
......@@ -1172,7 +1117,7 @@ static int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev,
data[0] =
inl(devpriv->iobase +
s_BoardInfos[dev->minor].i_Offset + 28);
} /* if (i_InterruptFlag == ADDIDATA_DISABLE) */
}
return 0;
}
......@@ -1224,14 +1169,9 @@ static int i_APCI3200_ReadCJCCalGain(struct comedi_device *dev,
/*Initialise dw_CommandRegister */
/*******************************/
ui_CommandRegister = 0;
/*********************************/
/*Test if the interrupt is enable */
/*********************************/
/* if (i_InterruptFlag == ADDIDATA_ENABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_ENABLE) {
/**********************/
if (s_BoardInfos[dev->minor].i_InterruptFlag == 1) {
/*Enable the interrupt */
/**********************/
ui_CommandRegister = ui_CommandRegister | 0x00100000;
}
/**********************/
......@@ -1247,8 +1187,7 @@ static int i_APCI3200_ReadCJCCalGain(struct comedi_device *dev,
/* outl(ui_CommandRegister ,devpriv->iobase+i_Offset + 8); */
outl(ui_CommandRegister,
devpriv->iobase + s_BoardInfos[dev->minor].i_Offset + 8);
/* if (i_InterruptFlag == ADDIDATA_DISABLE) */
if (s_BoardInfos[dev->minor].i_InterruptFlag == ADDIDATA_DISABLE) {
if (s_BoardInfos[dev->minor].i_InterruptFlag == 0) {
do {
/*******************/
/*Read the EOC flag */
......@@ -1264,7 +1203,7 @@ static int i_APCI3200_ReadCJCCalGain(struct comedi_device *dev,
data[0] =
inl(devpriv->iobase +
s_BoardInfos[dev->minor].i_Offset + 28);
} /* if (i_InterruptFlag == ADDIDATA_DISABLE) */
}
return 0;
}
......@@ -2136,8 +2075,7 @@ static int apci3200_ai_bits_test(struct comedi_device *dev,
i_ADDIDATAConversionTimeUnit= 1; */
/* i_Temp= i_InterruptFlag ; */
i_Temp = s_BoardInfos[dev->minor].i_InterruptFlag;
/* i_InterruptFlag = ADDIDATA_DISABLE; */
s_BoardInfos[dev->minor].i_InterruptFlag = ADDIDATA_DISABLE;
s_BoardInfos[dev->minor].i_InterruptFlag = 0;
i_APCI3200_Read1AnalogInputChannel(dev, s, insn, data);
/* if(i_AutoCalibration == FALSE) */
if (s_BoardInfos[dev->minor].i_AutoCalibration == FALSE) {
......@@ -2176,8 +2114,7 @@ static int apci3200_ai_bits_test(struct comedi_device *dev,
i_ADDIDATAConversionTimeUnit= 1; */
/* i_Temp= i_InterruptFlag ; */
i_Temp = s_BoardInfos[dev->minor].i_InterruptFlag;
/* i_InterruptFlag = ADDIDATA_DISABLE; */
s_BoardInfos[dev->minor].i_InterruptFlag = ADDIDATA_DISABLE;
s_BoardInfos[dev->minor].i_InterruptFlag = 0;
i_APCI3200_Read1AnalogInputChannel(dev, s, insn, data);
/* if(i_AutoCalibration == FALSE) */
if (s_BoardInfos[dev->minor].i_AutoCalibration == FALSE) {
......
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