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

staging: comedi: cb_pcidas: tidy up caldac_8800_write()

Rename this function so it has namespace associated with the driver.

For aesthetics, remove the 'static const' local variables. They don't
add any significant value.

Remove the 'bitstream' local variable. Change the type of the 'value'
param to match the callers type and write_calibration_bitstream()'s
type.
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 6eb2455d
...@@ -552,21 +552,22 @@ static void write_calibration_bitstream(struct comedi_device *dev, ...@@ -552,21 +552,22 @@ static void write_calibration_bitstream(struct comedi_device *dev,
} }
} }
static void caldac_8800_write(struct comedi_device *dev, static void cb_pcidas_caldac_8800_write(struct comedi_device *dev,
unsigned int chan, u8 val) unsigned int chan, unsigned int val)
{ {
struct cb_pcidas_private *devpriv = dev->private; struct cb_pcidas_private *devpriv = dev->private;
static const int bitstream_length = 11;
unsigned int bitstream = ((chan & 0x7) << 8) | val;
static const int caldac_8800_udelay = 1;
write_calibration_bitstream(dev, cal_enable_bits(dev), bitstream, /* write 11-bit value */
bitstream_length); write_calibration_bitstream(dev, cal_enable_bits(dev),
((chan & 0x7) << 8) | val, 11);
udelay(1);
udelay(caldac_8800_udelay); /* select caldac */
outw(cal_enable_bits(dev) | PCIDAS_CALIB_8800_SEL, outw(cal_enable_bits(dev) | PCIDAS_CALIB_8800_SEL,
devpriv->pcibar1 + PCIDAS_CALIB_REG); devpriv->pcibar1 + PCIDAS_CALIB_REG);
udelay(caldac_8800_udelay); udelay(1);
/* latch value */
outw(cal_enable_bits(dev), devpriv->pcibar1 + PCIDAS_CALIB_REG); outw(cal_enable_bits(dev), devpriv->pcibar1 + PCIDAS_CALIB_REG);
} }
...@@ -581,7 +582,7 @@ static int cb_pcidas_caldac_insn_write(struct comedi_device *dev, ...@@ -581,7 +582,7 @@ static int cb_pcidas_caldac_insn_write(struct comedi_device *dev,
unsigned int val = data[insn->n - 1]; unsigned int val = data[insn->n - 1];
if (s->readback[chan] != val) { if (s->readback[chan] != val) {
caldac_8800_write(dev, chan, val); cb_pcidas_caldac_8800_write(dev, chan, val);
s->readback[chan] = val; s->readback[chan] = val;
} }
} }
...@@ -1431,7 +1432,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, ...@@ -1431,7 +1432,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
return ret; return ret;
for (i = 0; i < s->n_chan; i++) { for (i = 0; i < s->n_chan; i++) {
caldac_8800_write(dev, i, s->maxdata / 2); cb_pcidas_caldac_8800_write(dev, i, s->maxdata / 2);
s->readback[i] = s->maxdata / 2; s->readback[i] = s->maxdata / 2;
} }
......
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