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

staging: comedi: vmk80xx: cleanup analog output subdevice init

Change the type for the analog output 'ao_chans' boardinfo to match
the comedi_subdevice type it is set to. For aesthetic reasons, rename
the variable also.

Rename the (*insn_write) and (*insn_read) functions for the analog
output subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 658cd3ac
...@@ -161,7 +161,7 @@ struct vmk80xx_board { ...@@ -161,7 +161,7 @@ struct vmk80xx_board {
const struct comedi_lrange *range; const struct comedi_lrange *range;
int ai_nchans; int ai_nchans;
unsigned int ai_maxdata; unsigned int ai_maxdata;
__u8 ao_chans; int ao_nchans;
__u8 di_chans; __u8 di_chans;
__le16 cnt_bits; __le16 cnt_bits;
__u8 pwm_chans; __u8 pwm_chans;
...@@ -175,7 +175,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = { ...@@ -175,7 +175,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
.range = &vmk8055_range, .range = &vmk8055_range,
.ai_nchans = 2, .ai_nchans = 2,
.ai_maxdata = 0x00ff, .ai_maxdata = 0x00ff,
.ao_chans = 2, .ao_nchans = 2,
.di_chans = 6, .di_chans = 6,
.cnt_bits = 16, .cnt_bits = 16,
.pwm_chans = 0, .pwm_chans = 0,
...@@ -187,7 +187,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = { ...@@ -187,7 +187,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
.range = &vmk8061_range, .range = &vmk8061_range,
.ai_nchans = 8, .ai_nchans = 8,
.ai_maxdata = 0x03ff, .ai_maxdata = 0x03ff,
.ao_chans = 8, .ao_nchans = 8,
.di_chans = 8, .di_chans = 8,
.cnt_bits = 0, .cnt_bits = 0,
.pwm_chans = 1, .pwm_chans = 1,
...@@ -585,9 +585,10 @@ static int vmk80xx_ai_insn_read(struct comedi_device *dev, ...@@ -585,9 +585,10 @@ static int vmk80xx_ai_insn_read(struct comedi_device *dev,
return n; return n;
} }
static int vmk80xx_ao_winsn(struct comedi_device *dev, static int vmk80xx_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn,
unsigned int *data)
{ {
struct vmk80xx_private *devpriv = dev->private; struct vmk80xx_private *devpriv = dev->private;
int chan; int chan;
...@@ -629,9 +630,10 @@ static int vmk80xx_ao_winsn(struct comedi_device *dev, ...@@ -629,9 +630,10 @@ static int vmk80xx_ao_winsn(struct comedi_device *dev,
return n; return n;
} }
static int vmk80xx_ao_rinsn(struct comedi_device *dev, static int vmk80xx_ao_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn,
unsigned int *data)
{ {
struct vmk80xx_private *devpriv = dev->private; struct vmk80xx_private *devpriv = dev->private;
int chan; int chan;
...@@ -1204,15 +1206,15 @@ static int vmk80xx_attach_common(struct comedi_device *dev) ...@@ -1204,15 +1206,15 @@ static int vmk80xx_attach_common(struct comedi_device *dev)
/* Analog output subdevice */ /* Analog output subdevice */
s = &dev->subdevices[1]; s = &dev->subdevices[1];
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = boardinfo->ao_chans; s->n_chan = boardinfo->ao_nchans;
s->maxdata = 0x00ff; s->maxdata = 0x00ff;
s->range_table = boardinfo->range; s->range_table = boardinfo->range;
s->insn_write = vmk80xx_ao_winsn; s->insn_write = vmk80xx_ao_insn_write;
if (devpriv->model == VMK8061_MODEL) { if (devpriv->model == VMK8061_MODEL) {
s->subdev_flags |= SDF_READABLE; s->subdev_flags |= SDF_READABLE;
s->insn_read = vmk80xx_ao_rinsn; s->insn_read = vmk80xx_ao_insn_read;
} }
/* Digital input subdevice */ /* Digital input subdevice */
......
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