staging: comedi: addi_apci_3xxx: remove 'b_SingleDiff' private data
The analog reference desired for the acquisition is stored in the insn->chanspec that is passed to the (*insn_read) function. There is no need to use a private data variable to hold the desired analog reference that is set in the (*insn_config). 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>
This commit is contained in:
parent
8d4729066c
commit
040540763b
|
@ -41,14 +41,10 @@ static int apci3xxx_ai_configure(struct comedi_device *dev,
|
|||
{
|
||||
const struct apci3xxx_boardinfo *board = comedi_board(dev);
|
||||
struct apci3xxx_private *devpriv = dev->private;
|
||||
unsigned int aref_mode = data[1];
|
||||
unsigned int time_base = data[2];
|
||||
unsigned int reload_time = data[3];
|
||||
unsigned int acq_ns;
|
||||
|
||||
if (aref_mode != 0 && aref_mode != 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (time_base > 2)
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -80,7 +76,6 @@ static int apci3xxx_ai_configure(struct comedi_device *dev,
|
|||
|
||||
devpriv->ui_EocEosConversionTime = reload_time;
|
||||
devpriv->b_EocEosConversionTimeBase = time_base;
|
||||
devpriv->b_SingelDiff = aref_mode;
|
||||
|
||||
/* Set the convert timing unit */
|
||||
writel(time_base, devpriv->mmio + 36);
|
||||
|
@ -116,6 +111,7 @@ static int apci3xxx_ai_insn_read(struct comedi_device *dev,
|
|||
struct apci3xxx_private *devpriv = dev->private;
|
||||
unsigned int chan = CR_CHAN(insn->chanspec);
|
||||
unsigned int range = CR_RANGE(insn->chanspec);
|
||||
unsigned int aref = CR_AREF(insn->chanspec);
|
||||
unsigned char use_interrupt = 0; /* FIXME: use interrupts */
|
||||
unsigned int delay_mode;
|
||||
unsigned int val;
|
||||
|
@ -139,7 +135,7 @@ static int apci3xxx_ai_insn_read(struct comedi_device *dev,
|
|||
|
||||
/* Make the configuration */
|
||||
val = (range & 3) | ((range >> 2) << 6) |
|
||||
(devpriv->b_SingelDiff << 7);
|
||||
((aref == AREF_DIFF) << 7);
|
||||
writel(val, devpriv->mmio + 0);
|
||||
|
||||
/* Channel selection */
|
||||
|
|
|
@ -356,7 +356,6 @@ struct apci3xxx_private {
|
|||
unsigned char b_EocEosInterrupt;
|
||||
unsigned int ui_EocEosConversionTime;
|
||||
unsigned char b_EocEosConversionTimeBase;
|
||||
unsigned char b_SingelDiff;
|
||||
};
|
||||
|
||||
#include "addi-data/hwdrv_apci3xxx.c"
|
||||
|
@ -611,9 +610,6 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
|
|||
s->insn_config = apci3xxx_ai_insn_config;
|
||||
s->insn_read = apci3xxx_ai_insn_read;
|
||||
|
||||
if ((board->ai_subdev_flags & (SDF_COMMON | SDF_GROUND)) == 0)
|
||||
devpriv->b_SingelDiff = 1;
|
||||
|
||||
} else {
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue