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

staging: comedi: adv_pci1710: rename pci171x_ao_insn_write()

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

For aesthetics, move the function so it is located in the middle of
the analog input support functions.
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 60392786
...@@ -362,31 +362,6 @@ static int pci171x_ai_insn_read(struct comedi_device *dev, ...@@ -362,31 +362,6 @@ static int pci171x_ai_insn_read(struct comedi_device *dev,
return ret ? ret : insn->n; return ret ? ret : insn->n;
} }
static int pci171x_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct pci1710_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int range = CR_RANGE(insn->chanspec);
unsigned int val = s->readback[chan];
int i;
devpriv->da_ranges &= ~(1 << (chan << 1));
devpriv->da_ranges |= (range << (chan << 1));
outw(devpriv->da_ranges, dev->iobase + PCI171X_DAREF_REG);
for (i = 0; i < insn->n; i++) {
val = data[i];
outw(val, dev->iobase + PCI171X_DA_REG(chan));
}
s->readback[chan] = val;
return insn->n;
}
static int pci171x_ai_cancel(struct comedi_device *dev, static int pci171x_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
...@@ -645,6 +620,31 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev, ...@@ -645,6 +620,31 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev,
return 0; return 0;
} }
static int pci1710_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct pci1710_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int range = CR_RANGE(insn->chanspec);
unsigned int val = s->readback[chan];
int i;
devpriv->da_ranges &= ~(1 << (chan << 1));
devpriv->da_ranges |= (range << (chan << 1));
outw(devpriv->da_ranges, dev->iobase + PCI171X_DAREF_REG);
for (i = 0; i < insn->n; i++) {
val = data[i];
outw(val, dev->iobase + PCI171X_DA_REG(chan));
}
s->readback[chan] = val;
return insn->n;
}
static int pci1710_di_insn_bits(struct comedi_device *dev, static int pci1710_di_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, struct comedi_insn *insn,
...@@ -823,7 +823,7 @@ static int pci1710_auto_attach(struct comedi_device *dev, ...@@ -823,7 +823,7 @@ static int pci1710_auto_attach(struct comedi_device *dev,
s->n_chan = 2; s->n_chan = 2;
s->maxdata = 0x0fff; s->maxdata = 0x0fff;
s->range_table = &pci171x_ao_range; s->range_table = &pci171x_ao_range;
s->insn_write = pci171x_ao_insn_write; s->insn_write = pci1710_ao_insn_write;
ret = comedi_alloc_subdev_readback(s); ret = comedi_alloc_subdev_readback(s);
if (ret) if (ret)
......
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