Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354380
b: refs/heads/master
c: 6a911d8
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Feb 5, 2013
1 parent 6c9fb1c commit 9e041d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 62100fefbc4f7f45149df1f537de17b4acf01391
refs/heads/master: 6a911d8aa54bc79256e766580a19bbd91e76d48f
26 changes: 17 additions & 9 deletions trunk/drivers/staging/comedi/drivers/quatech_daqp_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,20 +686,28 @@ static int daqp_di_insn_bits(struct comedi_device *dev,
return insn->n;
}

/* Digital output routine */

static int daqp_do_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int daqp_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
struct daqp_private *devpriv = dev->private;
unsigned int mask = data[0];
unsigned int bits = data[1];

if (devpriv->stop)
return -EIO;

outw(data[0] & 0xf, dev->iobase + DAQP_DIGITAL_IO);
if (mask) {
s->state &= ~mask;
s->state |= (bits & mask);

return 1;
outb(s->state, dev->iobase + DAQP_DIGITAL_IO);
}

data[1] = s->state;

return insn->n;
}

static int daqp_auto_attach(struct comedi_device *dev,
Expand Down Expand Up @@ -764,8 +772,8 @@ static int daqp_auto_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITEABLE;
s->n_chan = 1;
s->len_chanlist = 1;
s->insn_write = daqp_do_insn_write;
s->maxdata = 1;
s->insn_bits = daqp_do_insn_bits;

return 0;
}
Expand Down

0 comments on commit 9e041d2

Please sign in to comment.