Commit 9ad681c4 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice

[ Upstream commit e083926b ]

The PFI subdevice flags indicate that the subdevice is readable and
writeable, but that is only true for the supported "M-series" boards,
not the older "E-series" boards.  Only set the SDF_READABLE and
SDF_WRITABLE subdevice flags for the M-series boards.  These two flags
are mainly for informational purposes.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 66236f1b
...@@ -5275,11 +5275,11 @@ static int ni_E_init(struct comedi_device *dev, ...@@ -5275,11 +5275,11 @@ static int ni_E_init(struct comedi_device *dev,
/* Digital I/O (PFI) subdevice */ /* Digital I/O (PFI) subdevice */
s = &dev->subdevices[NI_PFI_DIO_SUBDEV]; s = &dev->subdevices[NI_PFI_DIO_SUBDEV];
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL;
s->maxdata = 1; s->maxdata = 1;
if (devpriv->is_m_series) { if (devpriv->is_m_series) {
s->n_chan = 16; s->n_chan = 16;
s->insn_bits = ni_pfi_insn_bits; s->insn_bits = ni_pfi_insn_bits;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL;
ni_writew(dev, s->state, NI_M_PFI_DO_REG); ni_writew(dev, s->state, NI_M_PFI_DO_REG);
for (i = 0; i < NUM_PFI_OUTPUT_SELECT_REGS; ++i) { for (i = 0; i < NUM_PFI_OUTPUT_SELECT_REGS; ++i) {
...@@ -5288,6 +5288,7 @@ static int ni_E_init(struct comedi_device *dev, ...@@ -5288,6 +5288,7 @@ static int ni_E_init(struct comedi_device *dev,
} }
} else { } else {
s->n_chan = 10; s->n_chan = 10;
s->subdev_flags = SDF_INTERNAL;
} }
s->insn_config = ni_pfi_insn_config; s->insn_config = ni_pfi_insn_config;
......
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