staging: comedi: vmk80xx: cleanup digital input subdevice init
Change the type for the digital input 'di_chans' boardinfo to match the comedi_subdevice type it is set to. For aesthetic reasons, rename the variable also. 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_read) and (*insn_bits) 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
8b3ec9f155
commit
268e5148aa
1 changed files with 18 additions and 15 deletions
|
@ -162,7 +162,7 @@ struct vmk80xx_board {
|
||||||
int ai_nchans;
|
int ai_nchans;
|
||||||
unsigned int ai_maxdata;
|
unsigned int ai_maxdata;
|
||||||
int ao_nchans;
|
int ao_nchans;
|
||||||
__u8 di_chans;
|
int di_nchans;
|
||||||
__le16 cnt_bits;
|
__le16 cnt_bits;
|
||||||
__u8 pwm_chans;
|
__u8 pwm_chans;
|
||||||
__le16 pwm_bits;
|
__le16 pwm_bits;
|
||||||
|
@ -176,7 +176,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
|
||||||
.ai_nchans = 2,
|
.ai_nchans = 2,
|
||||||
.ai_maxdata = 0x00ff,
|
.ai_maxdata = 0x00ff,
|
||||||
.ao_nchans = 2,
|
.ao_nchans = 2,
|
||||||
.di_chans = 6,
|
.di_nchans = 6,
|
||||||
.cnt_bits = 16,
|
.cnt_bits = 16,
|
||||||
.pwm_chans = 0,
|
.pwm_chans = 0,
|
||||||
.pwm_bits = 0,
|
.pwm_bits = 0,
|
||||||
|
@ -188,7 +188,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
|
||||||
.ai_nchans = 8,
|
.ai_nchans = 8,
|
||||||
.ai_maxdata = 0x03ff,
|
.ai_maxdata = 0x03ff,
|
||||||
.ao_nchans = 8,
|
.ao_nchans = 8,
|
||||||
.di_chans = 8,
|
.di_nchans = 8,
|
||||||
.cnt_bits = 0,
|
.cnt_bits = 0,
|
||||||
.pwm_chans = 1,
|
.pwm_chans = 1,
|
||||||
.pwm_bits = 10,
|
.pwm_bits = 10,
|
||||||
|
@ -663,9 +663,10 @@ static int vmk80xx_ao_insn_read(struct comedi_device *dev,
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vmk80xx_di_bits(struct comedi_device *dev,
|
static int vmk80xx_di_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;
|
unsigned char *rx_buf;
|
||||||
|
@ -705,9 +706,10 @@ static int vmk80xx_di_bits(struct comedi_device *dev,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vmk80xx_di_rinsn(struct comedi_device *dev,
|
static int vmk80xx_di_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;
|
||||||
|
@ -1219,12 +1221,13 @@ static int vmk80xx_attach_common(struct comedi_device *dev)
|
||||||
|
|
||||||
/* Digital input subdevice */
|
/* Digital input subdevice */
|
||||||
s = &dev->subdevices[2];
|
s = &dev->subdevices[2];
|
||||||
s->type = COMEDI_SUBD_DI;
|
s->type = COMEDI_SUBD_DI;
|
||||||
s->subdev_flags = SDF_READABLE | SDF_GROUND;
|
s->subdev_flags = SDF_READABLE;
|
||||||
s->n_chan = boardinfo->di_chans;
|
s->n_chan = boardinfo->di_nchans;
|
||||||
s->maxdata = 1;
|
s->maxdata = 1;
|
||||||
s->insn_read = vmk80xx_di_rinsn;
|
s->range_table = &range_digital;
|
||||||
s->insn_bits = vmk80xx_di_bits;
|
s->insn_read = vmk80xx_di_insn_read;
|
||||||
|
s->insn_bits = vmk80xx_di_insn_bits;
|
||||||
|
|
||||||
/* Digital output subdevice */
|
/* Digital output subdevice */
|
||||||
s = &dev->subdevices[3];
|
s = &dev->subdevices[3];
|
||||||
|
|
Loading…
Reference in a new issue