Revert "staging: comedi: skel: use comedi_dio_insn_config()"

This reverts commit 42ef678bef.

It's incorrect as well... time for more coffee...

Cc: 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:
Greg Kroah-Hartman 2013-08-12 15:17:17 -07:00
parent 99ac7cccb5
commit 987f3c86a1
1 changed files with 23 additions and 19 deletions

View File

@ -362,27 +362,31 @@ static int skel_dio_insn_bits(struct comedi_device *dev,
static int skel_dio_insn_config(struct comedi_device *dev, static int skel_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, struct comedi_insn *insn, unsigned int *data)
unsigned int *data)
{ {
int ret; int chan = CR_CHAN(insn->chanspec);
/* /* The input or output configuration of each digital line is
* The input or output configuration of each digital line is * configured by a special insn_config instruction. chanspec
* configured by special insn_config instructions. * contains the channel to be changed, and data[0] contains the
* * value COMEDI_INPUT or COMEDI_OUTPUT. */
* chanspec contains the channel to be changed switch (data[0]) {
* data[0] contains the instruction to perform on the channel case INSN_CONFIG_DIO_OUTPUT:
* s->io_bits |= 1 << chan;
* Normally the core provided comedi_dio_insn_config() function break;
* can be used to handle the boilerplpate. case INSN_CONFIG_DIO_INPUT:
*/ s->io_bits &= ~(1 << chan);
ret = comedi_dio_insn_config(dev, s, insn, data, 0); break;
if (ret) case INSN_CONFIG_DIO_QUERY:
return ret; data[1] =
(s->io_bits & (1 << chan)) ? COMEDI_OUTPUT : COMEDI_INPUT;
/* Update the hardware to the new configuration */ return insn->n;
/* outw(s->io_bits, dev->iobase + SKEL_DIO_CONFIG); */ break;
default:
return -EINVAL;
break;
}
/* outw(s->io_bits,dev->iobase + SKEL_DIO_CONFIG); */
return insn->n; return insn->n;
} }