staging: comedi: vmk80xx: cleanup digital input subdevice init
Remove the SDF_GROUND flag from s->subdev_flags. This flag only has meaning for analog subdevices. Add the missing s->range_table for the subdevice. Rename the (*insn_write), (*insn_bits), and (*insn_read) functions for the digital input subdevice to make grepping easier. For aesthetic reasons, add some whitespace to the subdevice init. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
268e5148aa
commit
b639e09608
1 changed files with 21 additions and 17 deletions
|
@ -752,9 +752,10 @@ static int vmk80xx_di_insn_read(struct comedi_device *dev,
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vmk80xx_do_winsn(struct comedi_device *dev,
|
static int vmk80xx_do_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;
|
||||||
|
@ -800,9 +801,10 @@ static int vmk80xx_do_winsn(struct comedi_device *dev,
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vmk80xx_do_rinsn(struct comedi_device *dev,
|
static int vmk80xx_do_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;
|
||||||
|
@ -832,9 +834,10 @@ static int vmk80xx_do_rinsn(struct comedi_device *dev,
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vmk80xx_do_bits(struct comedi_device *dev,
|
static int vmk80xx_do_insn_bits(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;
|
||||||
unsigned char *rx_buf, *tx_buf;
|
unsigned char *rx_buf, *tx_buf;
|
||||||
|
@ -1231,15 +1234,16 @@ static int vmk80xx_attach_common(struct comedi_device *dev)
|
||||||
|
|
||||||
/* Digital output subdevice */
|
/* Digital output subdevice */
|
||||||
s = &dev->subdevices[3];
|
s = &dev->subdevices[3];
|
||||||
s->type = COMEDI_SUBD_DO;
|
s->type = COMEDI_SUBD_DO;
|
||||||
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
|
s->subdev_flags = SDF_WRITEABLE;
|
||||||
s->n_chan = 8;
|
s->n_chan = 8;
|
||||||
s->maxdata = 1;
|
s->maxdata = 1;
|
||||||
s->insn_write = vmk80xx_do_winsn;
|
s->range_table = &range_digital;
|
||||||
s->insn_bits = vmk80xx_do_bits;
|
s->insn_write = vmk80xx_do_insn_write;
|
||||||
|
s->insn_bits = vmk80xx_do_insn_bits;
|
||||||
if (devpriv->model == VMK8061_MODEL) {
|
if (devpriv->model == VMK8061_MODEL) {
|
||||||
s->subdev_flags |= SDF_READABLE;
|
s->subdev_flags |= SDF_READABLE;
|
||||||
s->insn_read = vmk80xx_do_rinsn;
|
s->insn_read = vmk80xx_do_insn_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Counter subdevice */
|
/* Counter subdevice */
|
||||||
|
|
Loading…
Add table
Reference in a new issue