]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: addi_apci_1710: separate from addi_common.h
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 24 Jul 2013 18:12:35 +0000 (11:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 20:20:17 +0000 (13:20 -0700)
Move the necessary bits from addi_common.h to remove it's dependency
and make this driver standalone.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi_apci_1710.c

index 3035b2aa20cb98e48fa925451f5ae4283866029b..9157ac50815ed1c94afbaf2f87e02ff8ba22ffcf 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/interrupt.h>
 
 #include <asm/i387.h>
 
@@ -7,7 +8,146 @@
 #include "comedi_fc.h"
 #include "amcc_s5933.h"
 
-#include "addi-data/addi_common.h"
+#define APCI1710_SAVE_INTERRUPT        1
+
+union str_ModuleInfo {
+       /* Incremental counter infos */
+       struct {
+               union {
+                       struct {
+                               unsigned char b_ModeRegister1;
+                               unsigned char b_ModeRegister2;
+                               unsigned char b_ModeRegister3;
+                               unsigned char b_ModeRegister4;
+                       } s_ByteModeRegister;
+                       unsigned int dw_ModeRegister1_2_3_4;
+               } s_ModeRegister;
+
+               struct {
+                       unsigned int b_IndexInit:1;
+                       unsigned int b_CounterInit:1;
+                       unsigned int b_ReferenceInit:1;
+                       unsigned int b_IndexInterruptOccur:1;
+                       unsigned int b_CompareLogicInit:1;
+                       unsigned int b_FrequencyMeasurementInit:1;
+                       unsigned int b_FrequencyMeasurementEnable:1;
+               } s_InitFlag;
+
+       } s_SiemensCounterInfo;
+
+       /* SSI infos */
+       struct {
+               unsigned char b_SSIProfile;
+               unsigned char b_PositionTurnLength;
+               unsigned char b_TurnCptLength;
+               unsigned char b_SSIInit;
+       } s_SSICounterInfo;
+
+       /* TTL I/O infos */
+       struct {
+               unsigned char b_TTLInit;
+               unsigned char b_PortConfiguration[4];
+       } s_TTLIOInfo;
+
+       /* Digital I/O infos */
+       struct {
+               unsigned char b_DigitalInit;
+               unsigned char b_ChannelAMode;
+               unsigned char b_ChannelBMode;
+               unsigned char b_OutputMemoryEnabled;
+               unsigned int dw_OutputMemory;
+       } s_DigitalIOInfo;
+
+       /* 82X54 timer infos */
+       struct {
+               struct {
+                       unsigned char b_82X54Init;
+                       unsigned char b_InputClockSelection;
+                       unsigned char b_InputClockLevel;
+                       unsigned char b_OutputLevel;
+                       unsigned char b_HardwareGateLevel;
+                       unsigned int dw_ConfigurationWord;
+               } s_82X54TimerInfo[3];
+               unsigned char b_InterruptMask;
+       } s_82X54ModuleInfo;
+
+       /* Chronometer infos */
+       struct {
+               unsigned char b_ChronoInit;
+               unsigned char b_InterruptMask;
+               unsigned char b_PCIInputClock;
+               unsigned char b_TimingUnit;
+               unsigned char b_CycleMode;
+               double d_TimingInterval;
+               unsigned int dw_ConfigReg;
+       } s_ChronoModuleInfo;
+
+       /* Pulse encoder infos */
+       struct {
+               struct {
+                       unsigned char b_PulseEncoderInit;
+               } s_PulseEncoderInfo[4];
+               unsigned int dw_SetRegister;
+               unsigned int dw_ControlRegister;
+               unsigned int dw_StatusRegister;
+       } s_PulseEncoderModuleInfo;
+
+       /* Tor conter infos */
+       struct {
+               struct {
+                       unsigned char b_TorCounterInit;
+                       unsigned char b_TimingUnit;
+                       unsigned char b_InterruptEnable;
+                       double d_TimingInterval;
+                       unsigned int ul_RealTimingInterval;
+               } s_TorCounterInfo[2];
+               unsigned char b_PCIInputClock;
+       } s_TorCounterModuleInfo;
+
+       /* PWM infos */
+       struct {
+               struct {
+                       unsigned char b_PWMInit;
+                       unsigned char b_TimingUnit;
+                       unsigned char b_InterruptEnable;
+                       double d_LowTiming;
+                       double d_HighTiming;
+                       unsigned int ul_RealLowTiming;
+                       unsigned int ul_RealHighTiming;
+               } s_PWMInfo[2];
+               unsigned char b_ClockSelection;
+       } s_PWMModuleInfo;
+
+       /* CDA infos */
+       struct {
+               unsigned char b_CDAEnable;
+               unsigned char b_FctSelection;
+       } s_CDAModuleInfo;
+};
+
+struct addi_private {
+       /* Pointer to the current process */
+       struct task_struct *tsk_Current;
+
+       struct {
+               unsigned int ui_Address;
+               unsigned char b_BoardVersion;
+               unsigned int dw_MolduleConfiguration[4];
+       } s_BoardInfos;
+
+       struct {
+               unsigned int ul_InterruptOccur;
+               unsigned int ui_Read;
+               unsigned int ui_Write;
+               struct {
+                       unsigned char b_OldModuleMask;
+                       unsigned int ul_OldInterruptMask;
+                       unsigned int ul_OldCounterLatchValue;
+               } s_FIFOInterruptParameters[APCI1710_SAVE_INTERRUPT];
+       } s_InterruptParameters;
+
+       union str_ModuleInfo s_ModuleInfo[4];
+};
 
 static void fpu_begin(void)
 {