Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317608
b: refs/heads/master
c: e05b98b
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 26, 2012
1 parent 1812a29 commit 7b21c47
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 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: cf2592d06a4e37f98eba17d1abe32af7fe521d19
refs/heads/master: e05b98b6425d46e7a0f77d16499407f6df35427f
30 changes: 20 additions & 10 deletions trunk/drivers/staging/comedi/drivers/cb_das16_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,11 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data)
{
struct das16cs_private *devpriv = dev->private;
int chan = CR_CHAN(insn->chanspec);
int range = CR_RANGE(insn->chanspec);
int aref = CR_AREF(insn->chanspec);
int i;
int to;
int aref;
int range;
int chan;
static int range_bits[] = { 0x800, 0x000, 0x100, 0x200 };

chan = CR_CHAN(insn->chanspec);
aref = CR_AREF(insn->chanspec);
range = CR_RANGE(insn->chanspec);

outw(chan, dev->iobase + 2);

Expand All @@ -129,7 +124,22 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
outw(devpriv->status1, dev->iobase + 4);

devpriv->status2 &= ~0xff00;
devpriv->status2 |= range_bits[range];
switch (range) {
case 0:
devpriv->status2 |= 0x800;
break;
case 1:
devpriv->status2 |= 0x000;
break;
case 2:
devpriv->status2 |= 0x100;
break;
case 3:
devpriv->status2 |= 0x200;
break;
default:
return -EINVAL;
}
outw(devpriv->status2, dev->iobase + 6);

for (i = 0; i < insn->n; i++) {
Expand All @@ -144,7 +154,7 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
dev_dbg(dev->class_dev, "cb_das16_cs: ai timeout\n");
return -ETIME;
}
data[i] = (unsigned short)inw(dev->iobase + 0);
data[i] = inw(dev->iobase + 0);
}

return i;
Expand Down

0 comments on commit 7b21c47

Please sign in to comment.