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

staging: comedi: addi_apci_3120: separate from addi_common.h

Remove the need to include addi_common.h by introducing a new private
data definition. Only include the members that are actually used by
the driver.
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 1b7d0642
...@@ -246,7 +246,7 @@ static int apci3120_ai_insn_config(struct comedi_device *dev, ...@@ -246,7 +246,7 @@ static int apci3120_ai_insn_config(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int i; unsigned int i;
if ((data[0] != APCI3120_EOC_MODE) && (data[0] != APCI3120_EOS_MODE)) if ((data[0] != APCI3120_EOC_MODE) && (data[0] != APCI3120_EOS_MODE))
...@@ -300,7 +300,7 @@ static int apci3120_setup_chan_list(struct comedi_device *dev, ...@@ -300,7 +300,7 @@ static int apci3120_setup_chan_list(struct comedi_device *dev,
unsigned int *chanlist, unsigned int *chanlist,
char check) char check)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int i; unsigned int i;
unsigned int gain; unsigned int gain;
unsigned short us_TmpValue; unsigned short us_TmpValue;
...@@ -349,7 +349,7 @@ static int apci3120_ai_insn_read(struct comedi_device *dev, ...@@ -349,7 +349,7 @@ static int apci3120_ai_insn_read(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned short us_ConvertTiming, us_TmpValue, i; unsigned short us_ConvertTiming, us_TmpValue, i;
unsigned char b_Tmp; unsigned char b_Tmp;
...@@ -585,7 +585,7 @@ static int apci3120_ai_insn_read(struct comedi_device *dev, ...@@ -585,7 +585,7 @@ static int apci3120_ai_insn_read(struct comedi_device *dev,
static int apci3120_reset(struct comedi_device *dev) static int apci3120_reset(struct comedi_device *dev)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int i; unsigned int i;
unsigned short us_TmpValue; unsigned short us_TmpValue;
...@@ -638,7 +638,7 @@ static int apci3120_reset(struct comedi_device *dev) ...@@ -638,7 +638,7 @@ static int apci3120_reset(struct comedi_device *dev)
static int apci3120_exttrig_enable(struct comedi_device *dev) static int apci3120_exttrig_enable(struct comedi_device *dev)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
devpriv->us_OutputRegister |= APCI3120_ENABLE_EXT_TRIGGER; devpriv->us_OutputRegister |= APCI3120_ENABLE_EXT_TRIGGER;
outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS); outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS);
...@@ -647,7 +647,7 @@ static int apci3120_exttrig_enable(struct comedi_device *dev) ...@@ -647,7 +647,7 @@ static int apci3120_exttrig_enable(struct comedi_device *dev)
static int apci3120_exttrig_disable(struct comedi_device *dev) static int apci3120_exttrig_disable(struct comedi_device *dev)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
devpriv->us_OutputRegister &= ~APCI3120_ENABLE_EXT_TRIGGER; devpriv->us_OutputRegister &= ~APCI3120_ENABLE_EXT_TRIGGER;
outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS); outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS);
...@@ -657,7 +657,7 @@ static int apci3120_exttrig_disable(struct comedi_device *dev) ...@@ -657,7 +657,7 @@ static int apci3120_exttrig_disable(struct comedi_device *dev)
static int apci3120_cancel(struct comedi_device *dev, static int apci3120_cancel(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
/* Disable A2P Fifo write and AMWEN signal */ /* Disable A2P Fifo write and AMWEN signal */
outw(0, devpriv->i_IobaseAddon + 4); outw(0, devpriv->i_IobaseAddon + 4);
...@@ -778,7 +778,7 @@ static int apci3120_cyclic_ai(int mode, ...@@ -778,7 +778,7 @@ static int apci3120_cyclic_ai(int mode,
struct comedi_device *dev, struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
unsigned char b_Tmp; unsigned char b_Tmp;
unsigned int ui_Tmp, ui_DelayTiming = 0, ui_TimerValue1 = 0, dmalen0 = unsigned int ui_Tmp, ui_DelayTiming = 0, ui_TimerValue1 = 0, dmalen0 =
...@@ -1200,7 +1200,7 @@ static int apci3120_cyclic_ai(int mode, ...@@ -1200,7 +1200,7 @@ static int apci3120_cyclic_ai(int mode,
static int apci3120_ai_cmd(struct comedi_device *dev, static int apci3120_ai_cmd(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
/* loading private structure with cmd structure inputs */ /* loading private structure with cmd structure inputs */
...@@ -1225,7 +1225,7 @@ static void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev, ...@@ -1225,7 +1225,7 @@ static void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev,
unsigned short *dma_buffer, unsigned short *dma_buffer,
unsigned int num_samples) unsigned int num_samples)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
devpriv->ui_AiActualScan += devpriv->ui_AiActualScan +=
...@@ -1245,7 +1245,7 @@ static void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev, ...@@ -1245,7 +1245,7 @@ static void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev,
static void apci3120_interrupt_dma(int irq, void *d) static void apci3120_interrupt_dma(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
unsigned int next_dma_buf, samplesinbuf; unsigned int next_dma_buf, samplesinbuf;
...@@ -1393,7 +1393,7 @@ static void apci3120_interrupt_dma(int irq, void *d) ...@@ -1393,7 +1393,7 @@ static void apci3120_interrupt_dma(int irq, void *d)
*/ */
static int apci3120_interrupt_handle_eos(struct comedi_device *dev) static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
int n_chan, i; int n_chan, i;
int err = 1; int err = 1;
...@@ -1414,7 +1414,7 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev) ...@@ -1414,7 +1414,7 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
static irqreturn_t apci3120_interrupt(int irq, void *d) static irqreturn_t apci3120_interrupt(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
unsigned short int_daq; unsigned short int_daq;
unsigned int int_amcc, ui_Check, i; unsigned int int_amcc, ui_Check, i;
...@@ -1600,7 +1600,7 @@ static int apci3120_config_insn_timer(struct comedi_device *dev, ...@@ -1600,7 +1600,7 @@ static int apci3120_config_insn_timer(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int ui_Timervalue2; unsigned int ui_Timervalue2;
unsigned short us_TmpValue; unsigned short us_TmpValue;
unsigned char b_Tmp; unsigned char b_Tmp;
...@@ -1737,7 +1737,7 @@ static int apci3120_write_insn_timer(struct comedi_device *dev, ...@@ -1737,7 +1737,7 @@ static int apci3120_write_insn_timer(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int ui_Timervalue2 = 0; unsigned int ui_Timervalue2 = 0;
unsigned short us_TmpValue; unsigned short us_TmpValue;
unsigned char b_Tmp; unsigned char b_Tmp;
...@@ -1902,7 +1902,7 @@ static int apci3120_read_insn_timer(struct comedi_device *dev, ...@@ -1902,7 +1902,7 @@ static int apci3120_read_insn_timer(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned char b_Tmp; unsigned char b_Tmp;
unsigned short us_TmpValue, us_TmpValue_2, us_StatusValue; unsigned short us_TmpValue, us_TmpValue_2, us_StatusValue;
...@@ -1950,7 +1950,7 @@ static int apci3120_di_insn_bits(struct comedi_device *dev, ...@@ -1950,7 +1950,7 @@ static int apci3120_di_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int val; unsigned int val;
/* the input channels are bits 11:8 of the status reg */ /* the input channels are bits 11:8 of the status reg */
...@@ -1965,7 +1965,7 @@ static int apci3120_do_insn_bits(struct comedi_device *dev, ...@@ -1965,7 +1965,7 @@ static int apci3120_do_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
if (comedi_dio_update_state(s, data)) { if (comedi_dio_update_state(s, data)) {
/* The do channels are bits 7:4 of the do register */ /* The do channels are bits 7:4 of the do register */
...@@ -1985,7 +1985,7 @@ static int apci3120_ao_insn_write(struct comedi_device *dev, ...@@ -1985,7 +1985,7 @@ static int apci3120_ao_insn_write(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
unsigned int ui_Range, ui_Channel; unsigned int ui_Range, ui_Channel;
unsigned short us_TmpValue; unsigned short us_TmpValue;
......
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include "../comedidev.h" #include "../comedidev.h"
#include "comedi_fc.h" #include "comedi_fc.h"
#include "amcc_s5933.h" #include "amcc_s5933.h"
#include "addi-data/addi_common.h"
#include "addi-data/hwdrv_apci3120.c"
enum apci3120_boardid { enum apci3120_boardid {
BOARD_APCI3120, BOARD_APCI3120,
BOARD_APCI3001, BOARD_APCI3001,
...@@ -31,12 +29,44 @@ static const struct apci3120_board apci3120_boardtypes[] = { ...@@ -31,12 +29,44 @@ static const struct apci3120_board apci3120_boardtypes[] = {
}, },
}; };
struct apci3120_private {
int iobase;
int i_IobaseAmcc;
int i_IobaseAddon;
int i_IobaseReserved;
unsigned int ui_AiActualScan;
unsigned int ui_AiNbrofChannels;
unsigned int ui_AiChannelList[32];
unsigned int ui_AiReadData[32];
unsigned short us_UseDma;
unsigned char b_DmaDoubleBuffer;
unsigned int ui_DmaActualBuffer;
unsigned short *ul_DmaBufferVirtual[2];
dma_addr_t ul_DmaBufferHw[2];
unsigned int ui_DmaBufferSize[2];
unsigned int ui_DmaBufferUsesize[2];
unsigned char b_DigitalOutputRegister;
unsigned char b_TimerSelectMode;
unsigned char b_ModeSelectRegister;
unsigned short us_OutputRegister;
unsigned char b_Timer2Mode;
unsigned char b_Timer2Interrupt;
unsigned int ai_running:1;
unsigned char b_InterruptMode;
unsigned char b_EocEosInterrupt;
unsigned int ui_EocEosConversionTime;
unsigned char b_ExttrigEnable;
struct task_struct *tsk_Current;
};
#include "addi-data/hwdrv_apci3120.c"
static int apci3120_auto_attach(struct comedi_device *dev, static int apci3120_auto_attach(struct comedi_device *dev,
unsigned long context) unsigned long context)
{ {
struct pci_dev *pcidev = comedi_to_pci_dev(dev); struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct apci3120_board *this_board = NULL; const struct apci3120_board *this_board = NULL;
struct addi_private *devpriv; struct apci3120_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret, order, i; int ret, order, i;
...@@ -163,7 +193,7 @@ static int apci3120_auto_attach(struct comedi_device *dev, ...@@ -163,7 +193,7 @@ static int apci3120_auto_attach(struct comedi_device *dev,
static void apci3120_detach(struct comedi_device *dev) static void apci3120_detach(struct comedi_device *dev)
{ {
struct addi_private *devpriv = dev->private; struct apci3120_private *devpriv = dev->private;
if (dev->iobase) if (dev->iobase)
apci3120_reset(dev); apci3120_reset(dev);
......
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