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

staging: comedi: APCI1710_82x54: remove forward declarations

This source file is #include'd when building the addi_apci_1710 driver.
All the functions in this file are actually static and should not be
exported to the kernel.

Move some of the functions to remove the need for the forward declarations
and make all of the functions in this file static. Note, this patch does
not try to fix any of the coding style issues in the functions.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 86bb5038
...@@ -218,9 +218,10 @@ int i_InsnConfig_InitTimer(struct comedi_device *dev,struct comedi_subdevice *s, ...@@ -218,9 +218,10 @@ int i_InsnConfig_InitTimer(struct comedi_device *dev,struct comedi_subdevice *s,
| -9: Selection from hardware gate level is wrong | | -9: Selection from hardware gate level is wrong |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev,
int i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn,
unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -447,10 +448,10 @@ i_ReturnValue=insn->n; ...@@ -447,10 +448,10 @@ i_ReturnValue=insn->n;
| See function "i_APCI1710_SetBoardIntRoutineX" | | See function "i_APCI1710_SetBoardIntRoutineX" |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,
int i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_subdevice *s, struct comedi_insn *insn,
struct comedi_insn *insn, unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -590,9 +591,10 @@ int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev,struct comedi_sub ...@@ -590,9 +591,10 @@ int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev,struct comedi_sub
| "i_APCI1710_InitTimer" | | "i_APCI1710_InitTimer" |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev,
int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn,
unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -668,70 +670,6 @@ int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_su ...@@ -668,70 +670,6 @@ int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_su
return i_ReturnValue; return i_ReturnValue;
} }
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev,
struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read write functions for Timer |
+----------------------------------------------------------------------------+
| Input Parameters :
+----------------------------------------------------------------------------+
| Output Parameters : - |
+----------------------------------------------------------------------------+
| Return Value :
+----------------------------------------------------------------------------+
*/
int i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
unsigned char b_BitsType;
int i_ReturnValue = 0;
b_BitsType = data[0];
printk("\n82X54");
switch (b_BitsType) {
case APCI1710_TIMER_READVALUE:
i_ReturnValue = i_APCI1710_ReadTimerValue(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned int *) &data[0]);
break;
case APCI1710_TIMER_GETOUTPUTLEVEL:
i_ReturnValue = i_APCI1710_GetTimerOutputLevel(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned char *) &data[0]);
break;
case APCI1710_TIMER_GETPROGRESSSTATUS:
i_ReturnValue = i_APCI1710_GetTimerProgressStatus(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned char *)&data[0]);
break;
case APCI1710_TIMER_WRITEVALUE:
i_ReturnValue = i_APCI1710_WriteTimerValue(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned int)data[1]);
break;
default:
printk("Bits Config Parameter Wrong\n");
i_ReturnValue = -1;
}
if (i_ReturnValue >= 0)
i_ReturnValue = insn->n;
return i_ReturnValue;
}
/* /*
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
| Function Name : _INT_ i_APCI1710_ReadTimerValue | | Function Name : _INT_ i_APCI1710_ReadTimerValue |
...@@ -761,10 +699,10 @@ int i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice ...@@ -761,10 +699,10 @@ int i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice
| "i_APCI1710_InitTimer" | | "i_APCI1710_InitTimer" |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_ReadTimerValue(struct comedi_device *dev,
int i_APCI1710_ReadTimerValue(struct comedi_device *dev, unsigned char b_ModulNbr,
unsigned char b_ModulNbr, unsigned char b_TimerNbr, unsigned char b_TimerNbr,
unsigned int *pul_TimerValue) unsigned int *pul_TimerValue)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -850,10 +788,10 @@ int i_APCI1710_ReadTimerValue(struct comedi_device *dev, ...@@ -850,10 +788,10 @@ int i_APCI1710_ReadTimerValue(struct comedi_device *dev,
| "i_APCI1710_InitTimer" | | "i_APCI1710_InitTimer" |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev,
int i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev, unsigned char b_ModulNbr,
unsigned char b_ModulNbr, unsigned char b_TimerNbr, unsigned char b_TimerNbr,
unsigned char *pb_OutputLevel) unsigned char *pb_OutputLevel)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -930,10 +868,10 @@ int i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev, ...@@ -930,10 +868,10 @@ int i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev,
| "i_APCI1710_InitTimer" | | "i_APCI1710_InitTimer" |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev,
int i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev, unsigned char b_ModulNbr,
unsigned char b_ModulNbr, unsigned char b_TimerNbr, unsigned char b_TimerNbr,
unsigned char *pb_TimerStatus) unsigned char *pb_TimerStatus)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -1010,10 +948,10 @@ int i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev, ...@@ -1010,10 +948,10 @@ int i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev,
| "i_APCI1710_InitTimer" | | "i_APCI1710_InitTimer" |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
static int i_APCI1710_WriteTimerValue(struct comedi_device *dev,
int i_APCI1710_WriteTimerValue(struct comedi_device *dev, unsigned char b_ModulNbr,
unsigned char b_ModulNbr, unsigned char b_TimerNbr, unsigned char b_TimerNbr,
unsigned int ul_WriteValue) unsigned int ul_WriteValue)
{ {
struct addi_private *devpriv = dev->private; struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0; int i_ReturnValue = 0;
...@@ -1051,3 +989,68 @@ int i_APCI1710_WriteTimerValue(struct comedi_device *dev, ...@@ -1051,3 +989,68 @@ int i_APCI1710_WriteTimerValue(struct comedi_device *dev,
return i_ReturnValue; return i_ReturnValue;
} }
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev,
struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read write functions for Timer |
+----------------------------------------------------------------------------+
| Input Parameters :
+----------------------------------------------------------------------------+
| Output Parameters : - |
+----------------------------------------------------------------------------+
| Return Value :
+----------------------------------------------------------------------------+
*/
static int i_APCI1710_InsnBitsTimer(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
unsigned char b_BitsType;
int i_ReturnValue = 0;
b_BitsType = data[0];
printk("\n82X54");
switch (b_BitsType) {
case APCI1710_TIMER_READVALUE:
i_ReturnValue = i_APCI1710_ReadTimerValue(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned int *) &data[0]);
break;
case APCI1710_TIMER_GETOUTPUTLEVEL:
i_ReturnValue = i_APCI1710_GetTimerOutputLevel(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned char *) &data[0]);
break;
case APCI1710_TIMER_GETPROGRESSSTATUS:
i_ReturnValue = i_APCI1710_GetTimerProgressStatus(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned char *)&data[0]);
break;
case APCI1710_TIMER_WRITEVALUE:
i_ReturnValue = i_APCI1710_WriteTimerValue(dev,
(unsigned char)CR_AREF(insn->chanspec),
(unsigned char)CR_CHAN(insn->chanspec),
(unsigned int)data[1]);
break;
default:
printk("Bits Config Parameter Wrong\n");
i_ReturnValue = -1;
}
if (i_ReturnValue >= 0)
i_ReturnValue = insn->n;
return i_ReturnValue;
}
...@@ -30,44 +30,3 @@ ...@@ -30,44 +30,3 @@
#define APCI1710_10MHZ 10 #define APCI1710_10MHZ 10
#endif #endif
/* END JK 27.10.03 : Add the possibility to use a 40 Mhz quartz */ /* END JK 27.10.03 : Add the possibility to use a 40 Mhz quartz */
/*
* 82X54 TIMER INISIALISATION FUNCTION
*/
int i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
/*
* 82X54 READ FUNCTION
*/
int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
/*
* 82X54 READ & WRITE FUNCTION
*/
int i_APCI1710_ReadTimerValue(struct comedi_device *dev,
unsigned char b_ModulNbr, unsigned char b_TimerNbr,
unsigned int *pul_TimerValue);
int i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev,
unsigned char b_ModulNbr, unsigned char b_TimerNbr,
unsigned char *pb_OutputLevel);
int i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev,
unsigned char b_ModulNbr, unsigned char b_TimerNbr,
unsigned char *pb_TimerStatus);
/*
* 82X54 WRITE FUNCTION
*/
int i_APCI1710_WriteTimerValue(struct comedi_device *dev,
unsigned char b_ModulNbr, unsigned char b_TimerNbr,
unsigned int ul_WriteValue);
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